fix: the bundled token list names tokens on Ethereum Mainnet only (closes #632)
bundledToken(address, chainId) in tokenList.js answers only for Ethereum Mainnet's chain id. Every reader of TOKEN_BY_ADDRESS now goes through it, with the chain id of the transaction, balance or history entry it draws. The token sources the screens build carry that chain id. The Uniswap decoder sets the transaction's chain id on them. fetchTokenBalances() takes the chain id of the network it asks about. isSpoofedSymbol() takes the chain id of the token's network. It checks the bundled list's symbols only on Ethereum Mainnet. The native asset's labels stay reserved on every network. Eighteen existing tests and three shared test helpers read the bundled list without naming a network. Each now names Ethereum Mainnet. Model: opus-5-5
This commit is contained in:
+9
-7
@@ -377,13 +377,15 @@ point-in-time snapshot of the highest-market-cap Ethereum mainnet ERC-20s, fixed
|
||||
at build time and updated only when a new release ships a newer snapshot. If a
|
||||
transaction or balance claims to involve a known symbol (like "ETH" or "USDT")
|
||||
but comes from an unrecognized contract, it is identified as a spoof and hidden.
|
||||
In your transaction history this is the "Hide fake tokens impersonating a known
|
||||
symbol" setting, which you can switch off; doing so also stops new entries being
|
||||
added to the fraud contract blocklist below, since detecting a spoof is what
|
||||
fills it. The send token list always applies the check. Your balances apply it
|
||||
too, with one exception: a token claiming the symbol "ETH" is not filtered
|
||||
there, so a fake "ETH" token can still show up in your balance list even though
|
||||
it is hidden from your transaction history and from the send token list.
|
||||
On Sepolia, only "ETH" and "SepoliaETH" count as known symbols, because the
|
||||
bundled list holds Ethereum Mainnet tokens. In your transaction history the
|
||||
check is the "Hide fake tokens impersonating a known symbol" setting, which you
|
||||
can switch off; doing so also stops new entries being added to the fraud
|
||||
contract blocklist below, since detecting a spoof is what fills it. The send
|
||||
token list always applies the check. Your balances apply it too, with one
|
||||
exception: a token claiming the symbol "ETH" is not filtered there, so a fake
|
||||
"ETH" token can still show up in your balance list even though it is hidden from
|
||||
your transaction history and from the send token list.
|
||||
|
||||
**Low-holder token filtering.** Tokens with fewer than 1,000 holders are hidden
|
||||
from transaction history and the send token list, and are left out of your
|
||||
|
||||
Reference in New Issue
Block a user