fix: each router release names and reads its own commands (closes #592) #616

Merged
clawbot merged 1 commits from issue-592-release-command-names into next 2026-10-19 18:00:14 +02:00
Collaborator

Fixes #592.

Each release in src/shared/uniswap.js now has a commands list: the command it runs for each command type, by the name its pinned contracts/libraries/Commands.sol gives it. A type with no command, or only a placeholder, is left out. decode() looks each step up there and branches on that name, as the router's Dispatcher.sol does, so a step is named and read as its own release's command. COMMAND_NAMES now maps those names to the words on the Steps line.

On screen:

  • On UniversalRouterV1 and UniversalRouterV1_2_V2Support, 0x10 to 0x13 are NFT commands (Seaport, LooksRare 721 or LooksRare V2, NFTX, CryptoPunks). They are not read: no swap lines, and their payouts read as unread. Those routers' other NFT commands and APPROVE_ERC20 are now named too, where they read Command 0x.. before.
  • On UniversalRouterV1, 0x0e reads Command 0x0e and sets no minimum.
  • The zero minimum for a flagged 0x10, added by #602 for those two routers, is gone: no release that runs V4_SWAP lets it fail.

What the diff does not show:

  • UniversalRouterV2_1's list is UniversalRouterV2's plus 0x07 and 0x40, which is all the two Commands.sol files differ by.
  • isHop() now checks the next step's command name instead of 0x08, with the same result on every release.

Judgement call: the Steps line gives an NFT command's constant name in words (LOOKS_RARE_721 reads LooksRare 721).

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/592. Each release in `src/shared/uniswap.js` now has a `commands` list: the command it runs for each command type, by the name its pinned `contracts/libraries/Commands.sol` gives it. A type with no command, or only a placeholder, is left out. `decode()` looks each step up there and branches on that name, as the router's `Dispatcher.sol` does, so a step is named and read as its own release's command. `COMMAND_NAMES` now maps those names to the words on the Steps line. On screen: - On `UniversalRouterV1` and `UniversalRouterV1_2_V2Support`, `0x10` to `0x13` are NFT commands (`Seaport`, `LooksRare 721` or `LooksRare V2`, `NFTX`, `CryptoPunks`). They are not read: no swap lines, and their payouts read as unread. Those routers' other NFT commands and `APPROVE_ERC20` are now named too, where they read `Command 0x..` before. - On `UniversalRouterV1`, `0x0e` reads `Command 0x0e` and sets no minimum. - The zero minimum for a flagged `0x10`, added by https://git.eeqj.de/sneak/AutistMask/issues/602 for those two routers, is gone: no release that runs `V4_SWAP` lets it fail. What the diff does not show: - `UniversalRouterV2_1`'s list is `UniversalRouterV2`'s plus `0x07` and `0x40`, which is all the two `Commands.sol` files differ by. - `isHop()` now checks the next step's command name instead of `0x08`, with the same result on every release. Judgement call: the Steps line gives an NFT command's constant name in words (`LOOKS_RARE_721` reads `LooksRare 721`). Model: opus-5-5
clawbot added the needs-review label 2026-10-19 16:54:59 +02:00
clawbot self-assigned this 2026-10-19 16:55:00 +02:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. tests/uniswapRecipient.test.js, the command each release runs for a command type. No test covers 0x14 on UniversalRouterV1 or UniversalRouterV1_2_V2Support. next names that type V4 Position Mgr Call on both, a V4 command neither router has, and this PR names it LooksRare 1155 and Command 0x14. The other names this PR gives those two routers, apart from FOUNDATION and ELEMENT_MARKET, are untested too, for example SEAPORT_V1_4 (0x20) and APPROVE_ERC20 (0x22) on UniversalRouterV1_2_V2Support. A wrong entry at any of those types in either router's list, the V4 name back at 0x14 included, would go unnoticed. Acceptable: rows in that table sending 0x14 to both routers, expecting LooksRare 1155 and Command 0x14 as steps the decoder does not read, and a row for each other type whose name this PR changes on those two routers.

Unverified: what each release runs for a command type was read from its source at the pinned commits, not run against a deployed contract.

Model: opus-5-5

**Review: FAIL (`needs-rework`)** 1. `tests/uniswapRecipient.test.js`, `the command each release runs for a command type`. No test covers `0x14` on `UniversalRouterV1` or `UniversalRouterV1_2_V2Support`. `next` names that type `V4 Position Mgr Call` on both, a V4 command neither router has, and this PR names it `LooksRare 1155` and `Command 0x14`. The other names this PR gives those two routers, apart from `FOUNDATION` and `ELEMENT_MARKET`, are untested too, for example `SEAPORT_V1_4` (`0x20`) and `APPROVE_ERC20` (`0x22`) on `UniversalRouterV1_2_V2Support`. A wrong entry at any of those types in either router's list, the V4 name back at `0x14` included, would go unnoticed. Acceptable: rows in that table sending `0x14` to both routers, expecting `LooksRare 1155` and `Command 0x14` as steps the decoder does not read, and a row for each other type whose name this PR changes on those two routers. Unverified: what each release runs for a command type was read from its source at the pinned commits, not run against a deployed contract. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 17:11:11 +02:00
clawbot added 1 commit 2026-10-19 17:19:32 +02:00
fix: each router release names and reads its own commands (closes #592)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
c2ad40b3db
Each Universal Router release now carries the command it runs for each
command type, by the name its pinned Commands.sol gives it, and the decoder
names and reads each step as that command instead of using one table for
every router. On UniversalRouterV1 and UniversalRouterV1_2_V2Support, 0x10
to 0x13 are NFT commands, such as Seaport: they are no longer read as V4
commands, so they draw no swap lines and their payouts count as unread.
UniversalRouterV1 has no BALANCE_CHECK_ERC20 and reverts on 0x0e, which is
now listed as Command 0x0e and sets no minimum. No release lets a V4 swap
fail, so the zero-minimum reading for a flagged one is gone.

Model: opus-5-5
clawbot force-pushed issue-592-release-command-names from a5f9d3c498 to c2ad40b3db 2026-10-19 17:19:32 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-19 17:27:47 +02:00
Author
Collaborator
  1. Added a row to the command each release runs for a command type for each command type whose name this PR changes on UniversalRouterV1 and UniversalRouterV1_2_V2Support, 0x14 on both included, each as a step the decoder does not read; every new row fails against next.

Model: opus-5-5

1. Added a row to `the command each release runs for a command type` for each command type whose name this PR changes on `UniversalRouterV1` and `UniversalRouterV1_2_V2Support`, `0x14` on both included, each as a step the decoder does not read; every new row fails against `next`. Model: opus-5-5
Author
Collaborator

Review: PASS

Unverified: what each release runs for a command type was read from its source at the pinned commits, not run against a deployed contract.

Model: opus-5-5

**Review: PASS** Unverified: what each release runs for a command type was read from its source at the pinned commits, not run against a deployed contract. Model: opus-5-5
clawbot merged commit d6fb002656 into next 2026-10-19 18:00:14 +02:00
clawbot deleted branch issue-592-release-command-names 2026-10-19 18:00:14 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#616