A V4 step's Min. received was the sum of the amountOutMin of the swap actions that buy its output currency. When another swap action in the same step spends some of that currency, the user gets less than that sum: buying at least 0.5 WETH with 1,000 USDT, swapping 0.3 WETH of it for USDC and taking both read Min. received 0.5000 WETH. decodeV4Swap() now sets no minimum when any swap action in the step spends the output currency, so the screen has no Min. received line, as it already does for other minimums it cannot state.
Things the diff does not show:
Only a step whose TAKE or TAKE_ALL names the output currency can hit this. An output side found from the swap actions alone is always a currency none of them spends.
A multi-hop action records only the currency it spends and the one it ends with, so a path through WETH does not count as spending WETH. Uniswap's own routes read as before.
One existing row in tests/uniswapRecipient.test.js (a step that buys USDC, then spends 1 USDC of it to buy WETH back) now shows no minimum. Its 1990 USDC figure overstated what is paid out.
Judgement call: the three V4 rules are written in README Display Consistency, which Transaction Decoding points to, so rule 2 is updated there.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/574.
A V4 step's `Min. received` was the sum of the `amountOutMin` of the swap actions that buy its output currency. When another swap action in the same step spends some of that currency, the user gets less than that sum: buying at least 0.5 WETH with 1,000 USDT, swapping 0.3 WETH of it for USDC and taking both read `Min. received 0.5000 WETH`. `decodeV4Swap()` now sets no minimum when any swap action in the step spends the output currency, so the screen has no `Min. received` line, as it already does for other minimums it cannot state.
Things the diff does not show:
- Only a step whose `TAKE` or `TAKE_ALL` names the output currency can hit this. An output side found from the swap actions alone is always a currency none of them spends.
- A multi-hop action records only the currency it spends and the one it ends with, so a path through WETH does not count as spending WETH. Uniswap's own routes read as before.
- One existing row in `tests/uniswapRecipient.test.js` (a step that buys USDC, then spends 1 USDC of it to buy WETH back) now shows no minimum. Its 1990 USDC figure overstated what is paid out.
- Judgement call: the three V4 rules are written in README Display Consistency, which Transaction Decoding points to, so rule 2 is updated there.
Model: opus-5-5
clawbot
self-assigned this 2026-10-21 06:52:57 +02:00
A V4 step's Min. received was the sum of the minimums of the swap
actions that buy its output currency, even when another swap action in
the same step spends some of that currency. The user then receives
less than that figure. decodeV4Swap() now gives no minimum when a swap
action in the step also spends the output currency, as it already does
for other minimums it cannot state. A multi-hop action counts only the
currency it spends and the one it ends with, so a path through an
intermediate currency is not read as spending it.
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.
Fixes #574.
A V4 step's
Min. receivedwas the sum of theamountOutMinof the swap actions that buy its output currency. When another swap action in the same step spends some of that currency, the user gets less than that sum: buying at least 0.5 WETH with 1,000 USDT, swapping 0.3 WETH of it for USDC and taking both readMin. received 0.5000 WETH.decodeV4Swap()now sets no minimum when any swap action in the step spends the output currency, so the screen has noMin. receivedline, as it already does for other minimums it cannot state.Things the diff does not show:
TAKEorTAKE_ALLnames the output currency can hit this. An output side found from the swap actions alone is always a currency none of them spends.tests/uniswapRecipient.test.js(a step that buys USDC, then spends 1 USDC of it to buy WETH back) now shows no minimum. Its 1990 USDC figure overstated what is paid out.Model: opus-5-5
Review: PASS
Model: opus-5-5