From d69a19aee51cdef4718063b895491f5dbe7e15b1 Mon Sep 17 00:00:00 2001 From: ninglinLiu Date: Thu, 29 Oct 2026 15:21:35 +0800 Subject: [PATCH] docs: document V4 commands and which forge install tag includes them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README command table still matched the pre-V4 layout (0x0e-0x20 unused) while Commands.sol on main defines V4_SWAP and related commands. Refresh the table and note that forge install without a ref can land on v1.6.0, which lacks V4_SWAP — use a 2.x tag or main for V4 guides. Fixes #484 --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7e385ca..a989337d 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Each command is a `bytes1` containing the following 8 bits: ├──────┼───────────────────────────────┤ │ 0x06 │ PAY_PORTION │ ├──────┼───────────────────────────────┤ - │ 0x07 │ ------- │ + │ 0x07 │ PAY_PORTION_FULL_PRECISION │ ├──────┼───────────────────────────────┤ │ 0x08 │ V2_SWAP_EXACT_IN │ ├──────┼───────────────────────────────┤ @@ -84,18 +84,36 @@ Each command is a `bytes1` containing the following 8 bits: ├──────┼───────────────────────────────┤ │ 0x0d │ PERMIT2_TRANSFER_FROM_BATCH │ ├──────┼───────────────────────────────┤ - │ 0x0e-│ ------- │ + │ 0x0e │ BALANCE_CHECK_ERC20 │ + ├──────┼───────────────────────────────┤ + │ 0x0f │ ------- │ + ├──────┼───────────────────────────────┤ + │ 0x10 │ V4_SWAP │ + ├──────┼───────────────────────────────┤ + │ 0x11 │ V3_POSITION_MANAGER_PERMIT │ + ├──────┼───────────────────────────────┤ + │ 0x12 │ V3_POSITION_MANAGER_CALL │ + ├──────┼───────────────────────────────┤ + │ 0x13 │ V4_INITIALIZE_POOL │ + ├──────┼───────────────────────────────┤ + │ 0x14 │ V4_POSITION_MANAGER_CALL │ + ├──────┼───────────────────────────────┤ + │ 0x15-│ ------- │ │ 0x20 │ │ ├──────┼───────────────────────────────┤ │ 0x21 │ EXECUTE_SUB_PLAN │ ├──────┼───────────────────────────────┤ │ 0x22-│ ------- │ │ 0x3f │ │ + ├──────┼───────────────────────────────┤ + │ 0x40 │ ACROSS_V4_DEPOSIT_V3 │ └──────┴───────────────────────────────┘ ``` Note that some of the commands in the middle of the series are unused. These gaps allowed us to create gas-efficiencies when selecting which command to execute. +> **V4 commands and `forge install`:** Uniswap V4 guides use `V4_SWAP` (`0x10`). That command exists on `main` and on the `2.x` git tags (for example `2.2.0`). The older `v1.6.0` tag does **not** include it. Prefer `forge install Uniswap/universal-router@2.2.0` (or `@main`) rather than a bare `forge install Uniswap/universal-router`, which may resolve to `v1.6.0`. + #### How the input bytes are structures Each input bytes string is merely the abi encoding of a set of parameters. Depending on the command chosen, the input bytes string will be different. For example: