The swap decoder, the UNWRAP_WETH branch of decode() in src/shared/uniswap.js.
What happens
Each of these routes shows the swap's WETH minimum as a Min. received in ETH, though less than that may arrive as ETH:
a step between the swap and the UNWRAP_WETH pays out part of the router's WETH (a TRANSFER of a stated amount, a PAY_PORTION);
a WRAP_ETH into the router after the swap's WETH was paid out, then an UNWRAP_WETH;
an UNWRAP_WETH into the router, then a WRAP_ETH of all of its ETH to the user (the user receives WETH, and the screen names ETH).
What should happen
Min. received never states more than the calldata guarantees, and the screen never names a token the user does not receive: where part of the swap's WETH may not reach the UNWRAP_WETH, no ETH minimum is shown, and the token named is the one the last step pays the user.
Severity: minor
Definition of done
Each route above shows no ETH minimum larger than guaranteed and names the token the user receives.
A test for each, failing on next.
Model: opus-5-5
Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/640.
## Where
The swap decoder, the `UNWRAP_WETH` branch of `decode()` in `src/shared/uniswap.js`.
## What happens
Each of these routes shows the swap's WETH minimum as a `Min. received` in ETH, though less than that may arrive as ETH:
- a step between the swap and the `UNWRAP_WETH` pays out part of the router's WETH (a `TRANSFER` of a stated amount, a `PAY_PORTION`);
- a `WRAP_ETH` into the router after the swap's WETH was paid out, then an `UNWRAP_WETH`;
- an `UNWRAP_WETH` into the router, then a `WRAP_ETH` of all of its ETH to the user (the user receives WETH, and the screen names ETH).
## What should happen
`Min. received` never states more than the calldata guarantees, and the screen never names a token the user does not receive: where part of the swap's WETH may not reach the `UNWRAP_WETH`, no ETH minimum is shown, and the token named is the one the last step pays the user.
Severity: minor
## Definition of done
- [ ] Each route above shows no ETH minimum larger than guaranteed and names the token the user receives.
- [ ] A test for each, failing on `next`.
Model: opus-5-5
clawbot
self-assigned this 2026-10-20 14:55:03 +02:00
Plan: one PR to next, in the UNWRAP_WETH branch of decode() in src/shared/uniswap.js, extending the rule #640 put there. The output side reads ETH with its minimum only when the decoder can tell that all the WETH of the step that set the output side is still in the router when the UNWRAP_WETH runs; any step between them that may pay out or add to the router's WETH (a TRANSFER of a stated amount, a PAY_PORTION, a WRAP_ETH into the router) leaves ETH with no minimum. An UNWRAP_WETH into the router followed by a WRAP_ETH of all of its ETH to the user reads as WETH paid to the user. Tests for each route in the issue, failing on next; every other route reads as on next; README Display Consistency matches.
Model: opus-5-5
Plan: one PR to `next`, in the `UNWRAP_WETH` branch of `decode()` in `src/shared/uniswap.js`, extending the rule https://git.eeqj.de/sneak/AutistMask/pulls/640 put there. The output side reads ETH with its minimum only when the decoder can tell that all the WETH of the step that set the output side is still in the router when the `UNWRAP_WETH` runs; any step between them that may pay out or add to the router's WETH (a `TRANSFER` of a stated amount, a `PAY_PORTION`, a `WRAP_ETH` into the router) leaves ETH with no minimum. An `UNWRAP_WETH` into the router followed by a `WRAP_ETH` of all of its ETH to the user reads as WETH paid to the user. Tests for each route in the issue, failing on `next`; every other route reads as on `next`; README Display Consistency matches.
Model: opus-5-5
Built in #645: the first two routes now read ETH with no minimum, and the third reads WETH with no minimum.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/AutistMask/pulls/645: the first two routes now read ETH with no minimum, and the third reads WETH with no minimum.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Seen by the review of #640.
Where
The swap decoder, the
UNWRAP_WETHbranch ofdecode()insrc/shared/uniswap.js.What happens
Each of these routes shows the swap's WETH minimum as a
Min. receivedin ETH, though less than that may arrive as ETH:UNWRAP_WETHpays out part of the router's WETH (aTRANSFERof a stated amount, aPAY_PORTION);WRAP_ETHinto the router after the swap's WETH was paid out, then anUNWRAP_WETH;UNWRAP_WETHinto the router, then aWRAP_ETHof all of its ETH to the user (the user receives WETH, and the screen names ETH).What should happen
Min. receivednever states more than the calldata guarantees, and the screen never names a token the user does not receive: where part of the swap's WETH may not reach theUNWRAP_WETH, no ETH minimum is shown, and the token named is the one the last step pays the user.Severity: minor
Definition of done
next.Model: opus-5-5
Plan: one PR to
next, in theUNWRAP_WETHbranch ofdecode()insrc/shared/uniswap.js, extending the rule #640 put there. The output side reads ETH with its minimum only when the decoder can tell that all the WETH of the step that set the output side is still in the router when theUNWRAP_WETHruns; any step between them that may pay out or add to the router's WETH (aTRANSFERof a stated amount, aPAY_PORTION, aWRAP_ETHinto the router) leaves ETH with no minimum. AnUNWRAP_WETHinto the router followed by aWRAP_ETHof all of its ETH to the user reads as WETH paid to the user. Tests for each route in the issue, failing onnext; every other route reads as onnext; README Display Consistency matches.Model: opus-5-5
Built in #645: the first two routes now read ETH with no minimum, and the third reads WETH with no minimum.
Model: opus-5-5