harden: the input side has the same null-means-ETH collapse — an undetermined inputToken is asserted as "ETH (native)" #357

Closed
opened 2026-08-23 18:07:35 +02:00 by clawbot · 0 comments
Collaborator

Found while resolving #353. The output side is fixed by #356; this is its exact twin on the input side, left out of that unit's scope.

src/shared/uniswap.js:478-480tokenInfo(null) for a null inputToken yields Token In: ETH (native).

The determination made for the output side applies unchanged, and is cited on #353: in the V4 encoding Currency is a user-defined value type over address, so native ETH arrives as the truthy string 0x0000000000000000000000000000000000000000, never as null. WRAP_ETH already sets that explicit zero address. So a null inputToken likewise means undetermined, never native ETH.

Same class as #340 and #306: the approval screen asserting a fact it has not established — and as on the output side, it names the wrong asset rather than merely mis-scaling it.

Definition of done

  • An undetermined inputToken is stated as undetermined, using the refusal vocabulary established by #340 — never collapsed to ETH.
  • A genuine native-ETH input (explicit zero address, including via WRAP_ETH) still renders as ETH. Pin it with a test so the interpretation cannot silently change.
  • Check the same two-line pattern for the stale-value hazard fixed on the output side: a later step overwriting an amount while an earlier hop's token stays on screen.
  • Test: fails against current head — state the mutation and observed result.
  • make check green.
Found while resolving https://git.eeqj.de/sneak/AutistMask/issues/353. The output side is fixed by https://git.eeqj.de/sneak/AutistMask/pulls/356; this is its exact twin on the input side, left out of that unit's scope. `src/shared/uniswap.js:478-480` — `tokenInfo(null)` for a null `inputToken` yields `Token In: ETH (native)`. The determination made for the output side applies unchanged, and is cited on https://git.eeqj.de/sneak/AutistMask/issues/353: in the V4 encoding `Currency` is a user-defined value type over `address`, so native ETH arrives as the truthy string `0x0000000000000000000000000000000000000000`, never as null. `WRAP_ETH` already sets that explicit zero address. So a null `inputToken` likewise means **undetermined**, never native ETH. Same class as https://git.eeqj.de/sneak/AutistMask/issues/340 and https://git.eeqj.de/sneak/AutistMask/issues/306: the approval screen asserting a fact it has not established — and as on the output side, it names the wrong asset rather than merely mis-scaling it. ## Definition of done - [ ] An undetermined `inputToken` is stated as undetermined, using the refusal vocabulary established by https://git.eeqj.de/sneak/AutistMask/issues/340 — never collapsed to ETH. - [ ] A genuine native-ETH input (explicit zero address, including via `WRAP_ETH`) still renders as ETH. Pin it with a test so the interpretation cannot silently change. - [ ] Check the same two-line pattern for the stale-value hazard fixed on the output side: a later step overwriting an amount while an earlier hop's token stays on screen. - [ ] Test: fails against current head — state the mutation and observed result. - [ ] `make check` green.
clawbot added this to the 1.0.0 milestone 2026-08-23 18:07:35 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#357