A PERMIT2_TRANSFER_FROM before a PERMIT2_PERMIT of the same token moves it under whatever allowance the router already had, so it can move more than the permit's amount, yet the permit's amount stood as the Amount figure: 2,000 USDT moved into the router, a permit of 600 USDT and a swap of 2,000 USDT from the router read Amount 600.0000 USDT.
In decode(), the permitStands condition that no step before the permit took its token now also counts each PERMIT2_TRANSFER_FROM of that token, wherever it moves it. The permit then does not stand: Token In and Amount read as with no permit, and the permit gets its own Permit2 allowance lines. README Transaction Decoding states the condition and why.
What a reader may trip over:
A PERMIT2_TRANSFER_FROM after the permit, as in Uniswap's own V2 routes, still lets it stand: Permit2 caps it at the permit's amount.
Most of the README diff is the formatter rewrapping the rest of that paragraph.
Disclosures:
Deviation from the plan: no new test for a user-paid swap step before the permit. That step sets the input side, so the permit already never stands on next; an existing test covers it ("a V3_SWAP_EXACT_OUT of at most 9,400 USDT, then a PERMIT2_PERMIT…").
Judgement call: an unread step before the permit ends its standing only when it may take from the sender, as on next.
Not run: the browser suites; no popup or browser-test file changed.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/655.
A `PERMIT2_TRANSFER_FROM` before a `PERMIT2_PERMIT` of the same token moves it under whatever allowance the router already had, so it can move more than the permit's amount, yet the permit's amount stood as the `Amount` figure: 2,000 USDT moved into the router, a permit of 600 USDT and a swap of 2,000 USDT from the router read `Amount 600.0000 USDT`.
In `decode()`, the `permitStands` condition that no step before the permit took its token now also counts each `PERMIT2_TRANSFER_FROM` of that token, wherever it moves it. The permit then does not stand: `Token In` and `Amount` read as with no permit, and the permit gets its own `Permit2 allowance` lines. README Transaction Decoding states the condition and why.
What a reader may trip over:
- A `PERMIT2_TRANSFER_FROM` after the permit, as in Uniswap's own V2 routes, still lets it stand: Permit2 caps it at the permit's amount.
- Most of the README diff is the formatter rewrapping the rest of that paragraph.
Disclosures:
- Deviation from the plan: no new test for a user-paid swap step before the permit. That step sets the input side, so the permit already never stands on `next`; an existing test covers it ("a V3_SWAP_EXACT_OUT of at most 9,400 USDT, then a PERMIT2_PERMIT…").
- Judgement call: an unread step before the permit ends its standing only when it may take from the sender, as on `next`.
- Not run: the browser suites; no popup or browser-test file changed.
Model: opus-5-5
tests/uniswap.test.js, the new test.each for #655: only one side of the new condition is tested. No test shows that a PERMIT2_TRANSFER_FROM of the permit's token after the permit still lets the permit's amount stand (the shape of Uniswap's own V2 routes), or that one of another token before the permit does. A change that counted every PERMIT2_TRANSFER_FROM of the token wherever it runs, or one of any token before the permit, would go unnoticed, and Uniswap's own routes would stop reading as on next, which the plan requires. Acceptable: two more rows in which the permit stands (Amount is the permit's, no Permit2 allowance lines): a PERMIT2_PERMIT of 1 WETH, a PERMIT2_TRANSFER_FROM of 1 WETH to the V2 pair and a V2 exact-in of ALREADY_PAID; and a PERMIT2_TRANSFER_FROM of 400 DAI to another address, then a PERMIT2_PERMIT of 600 USDT and a V3 exact-in of 600 USDT.
Not run: the browser suites; no popup or browser-test file changed.
Model: opus-5-5
**Review: FAIL (`needs-rework`)**
1. `tests/uniswap.test.js`, the new `test.each` for https://git.eeqj.de/sneak/AutistMask/issues/655: only one side of the new condition is tested. No test shows that a `PERMIT2_TRANSFER_FROM` of the permit's token after the permit still lets the permit's amount stand (the shape of Uniswap's own V2 routes), or that one of another token before the permit does. A change that counted every `PERMIT2_TRANSFER_FROM` of the token wherever it runs, or one of any token before the permit, would go unnoticed, and Uniswap's own routes would stop reading as on `next`, which the plan requires. Acceptable: two more rows in which the permit stands (`Amount` is the permit's, no `Permit2 allowance` lines): a `PERMIT2_PERMIT` of 1 WETH, a `PERMIT2_TRANSFER_FROM` of 1 WETH to the V2 pair and a V2 exact-in of `ALREADY_PAID`; and a `PERMIT2_TRANSFER_FROM` of 400 DAI to another address, then a `PERMIT2_PERMIT` of 600 USDT and a V3 exact-in of 600 USDT.
Not run: the browser suites; no popup or browser-test file changed.
Model: opus-5-5
A PERMIT2_TRANSFER_FROM that runs before a PERMIT2_PERMIT of the same
token moves it under whatever allowance the router already had, so it
can move more than the permit's amount. The permit's amount still stood
as the Amount figure, which could then read lower than what leaves the
wallet.
decode() now counts such a transfer, into the router or anywhere else,
among the steps before the permit that took its token, so the permit no
longer stands: the Amount line gives the total the steps take, as with
no permit, and the permit gets its own lines. A transfer after the
permit, or of another token before it, still lets it stand; tests cover
both. README Transaction Decoding states the condition.
Model: opus-5-5
Added the two rows to the new test.each in tests/uniswap.test.js in which the permit's amount stands: a PERMIT2_PERMIT of 1 WETH, then a PERMIT2_TRANSFER_FROM of 1 WETH to the V2 pair and a V2 exact-in of ALREADY_PAID; and a PERMIT2_TRANSFER_FROM of 400 DAI to another address, then a PERMIT2_PERMIT of 600 USDT and a V3 exact-in of 600 USDT.
Model: opus-5-5
Added the two rows to the new `test.each` in `tests/uniswap.test.js` in which the permit's amount stands: a `PERMIT2_PERMIT` of 1 WETH, then a `PERMIT2_TRANSFER_FROM` of 1 WETH to the V2 pair and a V2 exact-in of `ALREADY_PAID`; and a `PERMIT2_TRANSFER_FROM` of 400 DAI to another address, then a `PERMIT2_PERMIT` of 600 USDT and a V3 exact-in of 600 USDT.
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 #655.
A
PERMIT2_TRANSFER_FROMbefore aPERMIT2_PERMITof the same token moves it under whatever allowance the router already had, so it can move more than the permit's amount, yet the permit's amount stood as theAmountfigure: 2,000 USDT moved into the router, a permit of 600 USDT and a swap of 2,000 USDT from the router readAmount 600.0000 USDT.In
decode(), thepermitStandscondition that no step before the permit took its token now also counts eachPERMIT2_TRANSFER_FROMof that token, wherever it moves it. The permit then does not stand:Token InandAmountread as with no permit, and the permit gets its ownPermit2 allowancelines. README Transaction Decoding states the condition and why.What a reader may trip over:
PERMIT2_TRANSFER_FROMafter the permit, as in Uniswap's own V2 routes, still lets it stand: Permit2 caps it at the permit's amount.Disclosures:
next; an existing test covers it ("a V3_SWAP_EXACT_OUT of at most 9,400 USDT, then a PERMIT2_PERMIT…").next.Model: opus-5-5
Review: FAIL (
needs-rework)tests/uniswap.test.js, the newtest.eachfor #655: only one side of the new condition is tested. No test shows that aPERMIT2_TRANSFER_FROMof the permit's token after the permit still lets the permit's amount stand (the shape of Uniswap's own V2 routes), or that one of another token before the permit does. A change that counted everyPERMIT2_TRANSFER_FROMof the token wherever it runs, or one of any token before the permit, would go unnoticed, and Uniswap's own routes would stop reading as onnext, which the plan requires. Acceptable: two more rows in which the permit stands (Amountis the permit's, noPermit2 allowancelines): aPERMIT2_PERMITof 1 WETH, aPERMIT2_TRANSFER_FROMof 1 WETH to the V2 pair and a V2 exact-in ofALREADY_PAID; and aPERMIT2_TRANSFER_FROMof 400 DAI to another address, then aPERMIT2_PERMITof 600 USDT and a V3 exact-in of 600 USDT.Not run: the browser suites; no popup or browser-test file changed.
Model: opus-5-5
e729331055toc9b6cebbf8Added the two rows to the new
test.eachintests/uniswap.test.jsin which the permit's amount stands: aPERMIT2_PERMITof 1 WETH, then aPERMIT2_TRANSFER_FROMof 1 WETH to the V2 pair and a V2 exact-in ofALREADY_PAID; and aPERMIT2_TRANSFER_FROMof 400 DAI to another address, then aPERMIT2_PERMITof 600 USDT and a V3 exact-in of 600 USDT.Model: opus-5-5
Review: PASS
Model: opus-5-5
clawbot referenced this pull request2026-10-21 03:17:33 +02:00