fix: TransactionDetail crashes for every ERC-20 transfer — ReferenceError: addressDotHtml is not defined #151

Closed
opened 2026-08-09 03:42:04 +02:00 by clawbot · 0 comments
Collaborator

Problem

src/popup/views/transactionDetail.js:4-18 destructures from ./helpers
without including addressDotHtml, but transactionDetail.js:136 calls:

const dot = addressDotHtml(tx.contractAddress);

That branch runs whenever tx.contractAddress is set — i.e. for every ERC-20
token transfer
— and it throws before showView("transaction") at
transactionDetail.js:174. So tapping a token-transfer row in any transaction
list opens nothing at all. Native ETH transfers still work.

This is exactly the field specified at README.md:478-479 (token contract with
a color dot), and TransactionDetail is described in the README as "the
authoritative record of a specific transaction" — the one place a user can
verify exact details. It is broken for tokens.

The import was dropped by df031fd ("fix: unify address display with shared
renderAddressHtml utility (#129)"); the usage was added by 3e900dc.

Implementation requirements

  • Add addressDotHtml to the destructured import in transactionDetail.js:4-18,
    after confirming it is exported from src/popup/views/helpers.js.
  • Check whether the surrounding block should instead use the shared
    renderAddressHtml helper that df031fd introduced — if the unification
    that commit intended simply missed this call site, prefer the shared helper
    over re-adding the lower-level one. Match how the From/To address fields in
    this same view are rendered so the token-contract row is visually
    consistent.
  • While in this file, verify no other identifier is used-but-not-imported.
  • Do not suppress with try/catch.

Definition of done

  • Tapping an ERC-20 token-transfer row in the transaction list on both
    AddressDetail and AddressToken opens the TransactionDetail screen.
  • The "Token contract" row renders with a color dot, the full untruncated
    contract address, tap-to-copy, and a working etherscan token link, per
    README.md:478-479.
  • Native ETH transfers still open correctly (no regression).
  • "Back" returns to the originating view (AddressToken when
    selectedToken is set, else AddressDetail).
  • A regression test covers the token-transfer render path, or the PR
    explains why that is disproportionate given the absent jsdom env.
  • TODO.md updated in the same commit.
  • make check passes.
## Problem `src/popup/views/transactionDetail.js:4-18` destructures from `./helpers` without including `addressDotHtml`, but `transactionDetail.js:136` calls: ```js const dot = addressDotHtml(tx.contractAddress); ``` That branch runs whenever `tx.contractAddress` is set — i.e. for **every ERC-20 token transfer** — and it throws before `showView("transaction")` at `transactionDetail.js:174`. So tapping a token-transfer row in any transaction list opens nothing at all. Native ETH transfers still work. This is exactly the field specified at `README.md:478-479` (token contract with a color dot), and TransactionDetail is described in the README as "the authoritative record of a specific transaction" — the one place a user can verify exact details. It is broken for tokens. The import was dropped by `df031fd` ("fix: unify address display with shared renderAddressHtml utility (#129)"); the usage was added by `3e900dc`. ## Implementation requirements - Add `addressDotHtml` to the destructured import in `transactionDetail.js:4-18`, after confirming it is exported from `src/popup/views/helpers.js`. - Check whether the surrounding block should instead use the shared `renderAddressHtml` helper that `df031fd` introduced — if the unification that commit intended simply missed this call site, prefer the shared helper over re-adding the lower-level one. Match how the From/To address fields in this same view are rendered so the token-contract row is visually consistent. - While in this file, verify no other identifier is used-but-not-imported. - Do not suppress with `try/catch`. ## Definition of done - [ ] Tapping an ERC-20 token-transfer row in the transaction list on both AddressDetail and AddressToken opens the TransactionDetail screen. - [ ] The "Token contract" row renders with a color dot, the full untruncated contract address, tap-to-copy, and a working etherscan token link, per `README.md:478-479`. - [ ] Native ETH transfers still open correctly (no regression). - [ ] "Back" returns to the originating view (AddressToken when `selectedToken` is set, else AddressDetail). - [ ] A regression test covers the token-transfer render path, or the PR explains why that is disproportionate given the absent jsdom env. - [ ] `TODO.md` updated in the same commit. - [ ] `make check` passes.
clawbot added this to the 1.0.0 milestone 2026-08-09 03:42:04 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#151