The calldata decoder names tokens from the active network's tokens, not the transaction's #629

Closed
opened 2026-10-20 02:37:51 +02:00 by clawbot · 2 comments
Collaborator

Seen by the review of #627.

Where

decodeCalldata() in src/popup/views/approval.js, used by TxApproval and TransactionDetail. It looks up a token's symbol and decimals in state.trackedTokens and the wallets' balances, which hold the active network's tokens only, whatever chain id it is given.

What happens

With Ethereum Mainnet active, TransactionDetail for a Sepolia token transfer (the popup can reopen onto one after a network switch) shows the token by address only and its amount as one whose scale is unknown, although the wallet tracks that token on Sepolia. TxApproval has the same gap for a transaction reviewed for a network other than the active one.

What should happen

A transaction screen describes the transaction on the network it was sent on, its tokens included: the symbol and decimals come from what the wallet knows of that network's tokens.

Severity: minor

Definition of done

  • decodeCalldata() names a token and scales its amount from the wallet's tokens on the network whose chain id it is given.
  • A Jest test opening a Sepolia token transfer on TransactionDetail with mainnet active, failing on next.

Model: opus-5-5

Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/627. ## Where `decodeCalldata()` in `src/popup/views/approval.js`, used by TxApproval and TransactionDetail. It looks up a token's symbol and decimals in `state.trackedTokens` and the wallets' balances, which hold the active network's tokens only, whatever chain id it is given. ## What happens With Ethereum Mainnet active, TransactionDetail for a Sepolia token transfer (the popup can reopen onto one after a network switch) shows the token by address only and its amount as one whose scale is unknown, although the wallet tracks that token on Sepolia. TxApproval has the same gap for a transaction reviewed for a network other than the active one. ## What should happen A transaction screen describes the transaction on the network it was sent on, its tokens included: the symbol and decimals come from what the wallet knows of that network's tokens. Severity: minor ## Definition of done - [ ] `decodeCalldata()` names a token and scales its amount from the wallet's tokens on the network whose chain id it is given. - [ ] A Jest test opening a Sepolia token transfer on TransactionDetail with mainnet active, failing on `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-20 02:37:51 +02:00
Author
Collaborator

Plan: one PR to next, in decodeCalldata() in src/popup/views/approval.js. The tracked tokens it looks a token up in are those of the network whose chain id it is given: state.trackedTokens when that is the active network, otherwise the list the wallet keeps for that network in state.networkTrackedTokens. The wallets' token balances, which hold the active network's only, are used only when the chain id is the active network's. A Jest test opening a Sepolia token transfer on TransactionDetail with mainnet active, failing on next; the SuccessTx token label the review of #627 noted is covered by the same change.

Model: opus-5-5

Plan: one PR to `next`, in `decodeCalldata()` in `src/popup/views/approval.js`. The tracked tokens it looks a token up in are those of the network whose chain id it is given: `state.trackedTokens` when that is the active network, otherwise the list the wallet keeps for that network in `state.networkTrackedTokens`. The wallets' token balances, which hold the active network's only, are used only when the chain id is the active network's. A Jest test opening a Sepolia token transfer on TransactionDetail with mainnet active, failing on `next`; the SuccessTx token label the review of https://git.eeqj.de/sneak/AutistMask/pulls/627 noted is covered by the same change. Model: opus-5-5
Author
Collaborator

#630 does this as planned: the token lookup follows the chain id it is given, and TxApproval's and SuccessTx's token labels use the same lookup.

Model: opus-5-5

https://git.eeqj.de/sneak/AutistMask/pulls/630 does this as planned: the token lookup follows the chain id it is given, and TxApproval's and SuccessTx's token labels use the same lookup. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#629