Summary
The IconRegistry contract has a tokenToIcon mapping that maps token addresses (with chain IDs) to icon slugs. This mapping is currently empty and needs to be populated.
Context
- Contract:
0x342e808c40D8E00656fEd124CA11aEcBB96c61Fc (mainnet)
- The contract already has 9,869 icons uploaded
- Chain ID mappings are set up (184 chains via
chainToIcon)
- Token mappings need a similar approach
Requirements
1. Add mapTokensBatch function to contract
The current contract only has mapToken for single mappings. For efficiency, we need:
function mapTokensBatch(
address[] calldata tokens,
uint256[] calldata chainIds,
string[] calldata slugs
) external onlyOwner
2. Create token mapping data source
Need to build a canonical list of token → icon mappings. Possible sources:
- DefiLlama token lists
- CoinGecko API
- Trust Wallet assets
- Custom curation
3. Create deployment script
Similar to setup-chain-mappings.ts:
- Read token list from JSON
- Check which mappings already exist
- Batch deploy new mappings
- Use Turnkey for signing
Estimated Scope
- ~10,000+ token mappings across multiple chains
- Contract upgrade to add batch function
- New
token-mappings.json data file
setup-token-mappings.ts script
Open Questions
- Should we use the same icon for a token across all chains (e.g., USDC on Ethereum = USDC on Arbitrum)?
- Do we need versioning for token icons?
- Should we integrate with an existing token list standard (Uniswap, etc.)?
Pending oracle review for architecture recommendations.
Summary
The IconRegistry contract has a
tokenToIconmapping that maps token addresses (with chain IDs) to icon slugs. This mapping is currently empty and needs to be populated.Context
0x342e808c40D8E00656fEd124CA11aEcBB96c61Fc(mainnet)chainToIcon)Requirements
1. Add
mapTokensBatchfunction to contractThe current contract only has
mapTokenfor single mappings. For efficiency, we need:2. Create token mapping data source
Need to build a canonical list of token → icon mappings. Possible sources:
3. Create deployment script
Similar to
setup-chain-mappings.ts:Estimated Scope
token-mappings.jsondata filesetup-token-mappings.tsscriptOpen Questions
Pending oracle review for architecture recommendations.