Uniswap / Uniswap/interface

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

Open
#3,973 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by tracing token-list decimal loading and the useSingleCallResult entry point for the listed token addresses. Done means the UI uses the correct decimal places rather than incorrect token-list metadata, including for the affected tokens.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.