interface icon indicating copy to clipboard operation
interface copied to clipboard

Varying Tokens from varying token list with wrong decimal, suggest using singleCallResult for decimals

Open Rachel-Eichenberger opened this issue 3 years ago • 0 comments

Bug Description This problem has occurred multiple times over multiple tokens and token lists. combining other issue https://github.com/Uniswap/interface/issues/3616

If a token list has the wrong decimals the decimals can be mapped wrong via token lists.

I don't see the exact place where token list loads/reads decimals and the map, and not sure best practice to replace, but given that the decimals play a large role in the trade, and price displayed, my suggestion is that we use "const decimals = useSingleCallResult(tokenContract, 'decimals', undefined, NEVER_RELOAD)" as a constant for Decimal places through out. I know this comes with an extra call which is a lot considering the amount of users, but I do believe this would make for a much more accurate experience

last known tokens are 0x6ADb2E268de2aA1aBF6578E4a8119b960E02928F SHIBDOGE 0xab167e816e4d76089119900e941befdfa37d6b32 SHINJA 0x6fc5af63990aa9e5c5543f5cd8ed148bfa6d9d19 SAINT

Currently only fix is to find the tokenlist with the incorrect decimals, going into to Manage Tokens Lists Section scroll down and find the incorrect Token List click on the little gear box, and then click remove. image

image

this forces the UI to use another token list (hopefully with correct decimals) or forces useSingleCallResult

Expected Behavior using the correct decimal places.

Rachel-Eichenberger avatar Jun 26 '22 17:06 Rachel-Eichenberger