The swap decoder lists an Execute Sub-Plan step as a V3 exact-out swap #535

Open
opened 2026-10-14 05:16:34 +02:00 by clawbot · 0 comments
Collaborator

Where. src/shared/uniswap.js:503: const cmdId = commandsBytes[i] & 0x1f;

What happens. The router reads the command type with the mask 0x3f (0x7f on its current main branch), which keeps the 0x20 bit; this line drops it. Command 0x21, Execute Sub-Plan, is therefore read as 0x01 and listed in the Steps line as "V3 Swap (Exact Out)". The decoder's own 0x21: "Execute Sub-Plan" entry (uniswap.js:39) can never be reached. The steps inside the sub-plan are not read either, so the Token In, Amount, Token Out and Min. received lines come only from the commands outside it, and a swap done inside a sub-plan is missing from them without the screen saying so.

Should. The Steps line names each command as the router will execute it (README Transaction Decoding: "execution steps").

Severity: minor

Definition of done

  • The command type is read with the router's mask, and a 0x21 command is listed as "Execute Sub-Plan".
  • When the calldata has a sub-plan the decoder does not read, the screen says that some steps are not shown, rather than presenting the outer lines as the whole swap.
  • Tests with a 0x21 command, with and without the allow-revert flag (0xa1).

Model: opus-5-5

**Where.** `src/shared/uniswap.js:503`: `const cmdId = commandsBytes[i] & 0x1f;` **What happens.** The router reads the command type with the mask `0x3f` (`0x7f` on its current main branch), which keeps the `0x20` bit; this line drops it. Command `0x21`, Execute Sub-Plan, is therefore read as `0x01` and listed in the Steps line as "V3 Swap (Exact Out)". The decoder's own `0x21: "Execute Sub-Plan"` entry (`uniswap.js:39`) can never be reached. The steps inside the sub-plan are not read either, so the Token In, Amount, Token Out and Min. received lines come only from the commands outside it, and a swap done inside a sub-plan is missing from them without the screen saying so. **Should.** The Steps line names each command as the router will execute it (README Transaction Decoding: "execution steps"). Severity: minor ## Definition of done - [ ] The command type is read with the router's mask, and a `0x21` command is listed as "Execute Sub-Plan". - [ ] When the calldata has a sub-plan the decoder does not read, the screen says that some steps are not shown, rather than presenting the outer lines as the whole swap. - [ ] Tests with a `0x21` command, with and without the allow-revert flag (`0xa1`). Model: opus-5-5
clawbot self-assigned this 2026-10-14 05:16:34 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#535