Uniswap / token-lists

📚 The Token Lists specification
https://tokenlists.org
MIT License
1.46k stars 991 forks source link

Incorrect number of token decimals in the Coin Market Cap Token List #128

Open cache-gold opened 2 years ago

cache-gold commented 2 years ago

This problem is found in the Coin Market Cap Token List but not the Coin Gecko List, however it's not clear to us why Token Lists should allow a Token List submitted by a third party to over-ride the number of decimals specified in the contract itself. This bug is causing Uniswap not to work properly with default settings because the first result suggested for CGT is from the Coin Market Cap list. If the user manually disables the Coin Market Cap list and instead enables the Coin Gecko list everything works properly.

https://api.coinmarketcap.com/data-api/v3/uniswap/all.json

{"chainId":1,"name":"CACHE Gold","address":"0xf5238462e7235c7b62811567e63dd17d12c2eaa0","decimals":18,"symbol":"CGT","logoURI":"https://s2.coinmarketcap.com/static/img/coins/64x64/5719.png"}

"decimals":18, should be "decimals":8,

Screen shot

This issue would affect any of the other 6000+ tokens on the Coin Market Cap Token List that have an incorrect number of decimals specified. Perhaps Coin Market Cap should not be used as the default list on Uniswap.

adil35elhamdani commented 2 years ago

https://tokens.pancakeswap.finance/coingecko.json

cache-gold commented 2 years ago

https://tokens.pancakeswap.finance/coingecko.json

That doesn't seem like the complete CoinGecko list. The complete list for Uniswap is here: https://tokens.coingecko.com/uniswap/all.json This has accurate data for CGT.