harden: the swap approval screen guesses 18 decimals for any token not in the bundled list #340
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?
Raised by the review of #339 (#339 (comment)). Pre-existing, not introduced by that PR.
tokenInfo()insrc/shared/uniswap.jsreturnsdecimals: 18for any token not in the bundled token list. That is the same guessed-scale assumption #306 removed from the ERC-20 path, still live on the Uniswap path.The consequence is the one #306 was filed for: an amount on the approval screen that is wrong by a factor of 10^n rather than merely imprecise. A 6-decimal token formatted at 18 decimals renders a real 1000.00 USDT swap as 0.000000000001 — the screen whose entire job is to state what is being authorized, stating something else. Any token off the bundled list reaches this, which includes every newly listed token.
Definition of done
make checkgreen.