fix: the approval screen says "Unknown token" for tokens whose symbol is already known #323
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while implementing #306. Not in that issue's definition of done, so left untouched.
The dApp approval screen labels anything outside the 512-entry bundled list as
Unknown token, even when the symbol is already available fromstate.trackedTokensor from the address's own explorer-reportedtokenBalances.resolveSymbol()insrc/shared/tokenList.jsexists for exactly this lookup and is not consulted here.Consequence is UX, not safety: a user is shown "Unknown token" for a token they added themselves and hold a balance of, which trains them to disregard the label — and the label is one of the signals that ought to distinguish a familiar token from an attacker's.
Note the ordering constraint: #306 added the same three-source resolution chain for decimals (
src/shared/approvalAmount.js). The symbol should reuse that chain rather than introduce a second one with its own precedence, so land this after #306.Definition of done
state.trackedTokens, then the address's explorer-reported entry — the same precedence and, where practical, the same code path as the decimals resolution.Unknown tokenis shown only when no source knows the symbol, and continues to be shown in that case rather than guessing.src/shared/symbolSpoof.js— resolving a symbol must not create a new way to claim a bundled ticker.make checkgreen.Fold this in — same cause, and it now reads worse than before.
pendingTxDetails.tokenstays"ETH"for a non-bundled ERC-20, sosrc/popup/views/txStatus.js:84renders the wait summary as:Pre-existing and not introduced by #306 — the old code produced
5000.0000 ETHfor the same case, which was wrong in a quieter way. Naming an ERC-20 transfer as ETH on a status screen is the same missing symbol resolution this issue is about, so the DoD here should coverpendingTxDetails.tokenand the status screens, not only the approval screen.