A V3_SWAP_EXACT_OUT step is named but never decoded, so its tokens show as not named in the calldata #601

Open
opened 2026-10-19 08:37:04 +02:00 by clawbot · 0 comments
Collaborator

Seen by the review of #598.

Where

The swap decoder, src/shared/uniswap.js. Command 0x00 (V3_SWAP_EXACT_IN) is decoded by decodeV3SwapExactIn(); command 0x01 (V3_SWAP_EXACT_OUT, (address recipient, uint256 amountOut, uint256 amountInMax, bytes path, bool payerIsUser)) is named in the Steps line but never decoded.

What happens

A swap done with V3_SWAP_EXACT_OUT shows its tokens as unknown ("not named in the calldata") and no amounts, although the calldata names both tokens, the exact amount bought and the most that can be spent.

What should happen

README, Transaction Decoding: the decoder covers Universal Router execute() calls and their swap steps. A V3 exact-out swap is read like the V2 exact-out swap already is: its tokens from the path (which an exact-out V3 path lists output first), and its amounts as the V2 exact-out case shows them.

Severity: minor

Definition of done

  • V3_SWAP_EXACT_OUT steps set Token In, Token Out and their amounts, with the path read in the order the router reads it.
  • Tests for a single-hop and a multi-hop exact-out path.

Model: opus-5-5

Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/598. ## Where The swap decoder, `src/shared/uniswap.js`. Command `0x00` (`V3_SWAP_EXACT_IN`) is decoded by `decodeV3SwapExactIn()`; command `0x01` (`V3_SWAP_EXACT_OUT`, `(address recipient, uint256 amountOut, uint256 amountInMax, bytes path, bool payerIsUser)`) is named in the Steps line but never decoded. ## What happens A swap done with `V3_SWAP_EXACT_OUT` shows its tokens as unknown ("not named in the calldata") and no amounts, although the calldata names both tokens, the exact amount bought and the most that can be spent. ## What should happen README, Transaction Decoding: the decoder covers Universal Router `execute()` calls and their swap steps. A V3 exact-out swap is read like the V2 exact-out swap already is: its tokens from the path (which an exact-out V3 path lists output first), and its amounts as the V2 exact-out case shows them. Severity: minor ## Definition of done - [ ] `V3_SWAP_EXACT_OUT` steps set Token In, Token Out and their amounts, with the path read in the order the router reads it. - [ ] Tests for a single-hop and a multi-hop exact-out path. Model: opus-5-5
clawbot self-assigned this 2026-10-19 08:37: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#601