fix: the swap decoder shows the ETH of a WRAP_ETH that does not set the input side (closes #721)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

A later WRAP_ETH of a stated amount now counts as a take from the sender.
When it pays anyone but the router, it gets its own Moved from the sender
lines, with the recipient on Moved to. When it pays the router, it joins
the Amount line if Token In is ETH, and otherwise gets those lines too.
When the router may already hold ETH, the amount reads Up to.

A WRAP_ETH whose input this decoder cannot read gets a line saying the
amount could not be decoded.

A WRAP_ETH of CONTRACT_BALANCE states no amount and reads as before, so
Uniswap's own routes do not change.

Model: opus-5-5
This commit is contained in:
2026-11-03 05:08:45 +00:00
committed by sneak
parent 1a4fb0803d
commit 1a3fefde4a
4 changed files with 226 additions and 17 deletions
+8 -3
View File
@@ -1365,9 +1365,14 @@ when both tokens are known. The lines are:
the sender that the `Amount` line does not include. The same three lines show
what a `PERMIT2_TRANSFER_FROM` moves and where. A `WRAP_ETH` can pay its WETH
to a recipient other than the router. When its amount gets these lines, its
`Moved to` line names that recipient, or reads `The sender`. ETH that the
sender pays a V4 step can get these three lines when the router may hold ETH
from an earlier step. When the decoder knows the amount, its
`Moved to` line names that recipient, or reads `The sender`. A `WRAP_ETH`
after the step that sets `Token In` takes the amount it states from the
sender. When it pays anyone but the router, that amount gets these lines. When
it pays the router, that amount joins the `Amount` line if `Token In` is ETH,
and gets these lines if not. A later `WRAP_ETH` of `CONTRACT_BALANCE` states
no amount, so it gets no lines. ETH that the sender pays a V4 step or a
`WRAP_ETH` of a stated amount can get these three lines when the router may
hold ETH from an earlier step. When the decoder knows the amount, its
`Moved from the sender` line reads `Up to` and the amount.
- `Permit2 allowance`, `Allowance token` and `Allowance spender`: each allowance
that a `PERMIT2_PERMIT` or `PERMIT2_PERMIT_BATCH` grants, unless the permit's