(chainId, symbol)→tokenAddresssymbol→decimals(forparseUnits)
- Repo: https://github.com/0xsequence/token-directory
- Index:
index/index.json - Per-chain ERC20 list:
index/<chainName>/erc20.json
Data model
1) Load the master index
Fetch:https://raw.githubusercontent.com/0xsequence/token-directory/main/index/index.json
2) Pick the chain folder and fetch the ERC20 list
Fetch:https://raw.githubusercontent.com/0xsequence/token-directory/main/index/<chainName>/erc20.json
address, symbol, decimals, etc.).
Node.js example (with caching)
How to use it in permissions
Once you resolve:token.addresstoken.decimals
- build a permission for
transfer(address to, uint256 value) - build a UI that accepts symbols instead of addresses
- allow
transfer(to=ANY, value<=limit)using a value limit rule