WETH paid to the user before an UNWRAP_WETH is labelled ETH #607

Closed
opened 2026-10-19 12:44:18 +02:00 by clawbot · 2 comments
Collaborator

Seen by the review of #604.

Where

The swap decoder, src/shared/uniswap.js, where an UNWRAP_WETH step makes the output side ETH.

What happens

Calldata that pays all of a swap's WETH to the user, then runs an UNWRAP_WETH (which finds nothing to unwrap in the router), labels the output ETH. The user receives WETH.

What should happen

The output side names the token the user receives: an UNWRAP_WETH turns the output into ETH only when the WETH it unwraps is the swap's output held in the router.

Severity: minor

Definition of done

  • WETH paid to the user before an UNWRAP_WETH reads as WETH.
  • A swap paid to the router and then unwrapped to the user still reads as ETH.
  • Tests for both.

Model: opus-5-5

Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/604. ## Where The swap decoder, `src/shared/uniswap.js`, where an `UNWRAP_WETH` step makes the output side ETH. ## What happens Calldata that pays all of a swap's WETH to the user, then runs an `UNWRAP_WETH` (which finds nothing to unwrap in the router), labels the output ETH. The user receives WETH. ## What should happen The output side names the token the user receives: an `UNWRAP_WETH` turns the output into ETH only when the WETH it unwraps is the swap's output held in the router. Severity: minor ## Definition of done - [ ] WETH paid to the user before an `UNWRAP_WETH` reads as WETH. - [ ] A swap paid to the router and then unwrapped to the user still reads as ETH. - [ ] Tests for both. Model: opus-5-5
clawbot self-assigned this 2026-10-19 12:44:18 +02:00
Author
Collaborator

Plan: one PR to next, in decode() in src/shared/uniswap.js. An UNWRAP_WETH turns the output side into ETH only when the WETH it unwraps is the swap's output held in the router (the decoder already follows what the router holds); when the swap's WETH was paid to the user before it, the output stays WETH and the step unwraps nothing of it. Tests for both routes of the definition of done, the first failing on next; every other route reads as on next; README Transaction Decoding matches.

Model: opus-5-5

Plan: one PR to `next`, in `decode()` in `src/shared/uniswap.js`. An `UNWRAP_WETH` turns the output side into ETH only when the WETH it unwraps is the swap's output held in the router (the decoder already follows what the router holds); when the swap's WETH was paid to the user before it, the output stays WETH and the step unwraps nothing of it. Tests for both routes of the definition of done, the first failing on `next`; every other route reads as on `next`; README Transaction Decoding matches. Model: opus-5-5
Author
Collaborator

Built in #640: an UNWRAP_WETH makes the output ETH only when the router holds the output side's WETH as it runs, so WETH paid to the user before it reads as WETH. What the router holds is followed by token, not by step; the PR states what that leaves.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/AutistMask/pulls/640: an `UNWRAP_WETH` makes the output ETH only when the router holds the output side's WETH as it runs, so WETH paid to the user before it reads as WETH. What the router holds is followed by token, not by step; the PR states what that leaves. 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#607