fix: a permit shows on its own lines unless its amount is the Amount figure (closes #370) #651

Merged
clawbot merged 1 commits from issue-370-trailing-permit-own-lines into next 2026-10-21 00:56:42 +02:00
Collaborator

Settles #370 as option (b): nothing the user authorizes goes unstated.

A PERMIT2_PERMIT named Token In whether or not its amount stood as the Amount figure, so the approval screen could show a permit's token, or an allowance, where the swap's own input belonged.

In decode(), only a permit whose amount stands as the Amount figure names Token In: the plain shape of Uniswap's own routes from #626, with the permit before the step that sets the input side. Every other permit, before the swap steps or after them, leaves Token In and Amount as they read with no permit, and gets three lines of its own: Permit2 allowance (its amount, or Unlimited), Allowance token and Allowance spender. Uniswap's own routes read as before.

What a reader may trip over:

  • A WRAP_ETH, or a V4 step that sets the input side as unknown, also sets it: a permit after either never stands.
  • A V3 swap step's tokens are now checksummed, so a token's address reads the same on every line, Token Out included; five tests that expected lowercase changed.
  • Existing tests whose permit does not stand now also expect its lines.

Disclosures:

  • Judgement call: the three labels; the spender is given as an address, the router's included.
  • Judgement call: README's unknown token scale passage also names the Paid to line of a move into the router, so its list of amount lines is complete.
  • Judgement call: the checksum is applied where a V3 path is read, not on Token In alone.
  • Not run: the browser suites; no popup or browser-test file changed.

Model: opus-5-5

Settles https://git.eeqj.de/sneak/AutistMask/issues/370 as option (b): nothing the user authorizes goes unstated. A `PERMIT2_PERMIT` named `Token In` whether or not its amount stood as the `Amount` figure, so the approval screen could show a permit's token, or an allowance, where the swap's own input belonged. In `decode()`, only a permit whose amount stands as the `Amount` figure names `Token In`: the plain shape of Uniswap's own routes from https://git.eeqj.de/sneak/AutistMask/pulls/626, with the permit before the step that sets the input side. Every other permit, before the swap steps or after them, leaves `Token In` and `Amount` as they read with no permit, and gets three lines of its own: `Permit2 allowance` (its amount, or `Unlimited`), `Allowance token` and `Allowance spender`. Uniswap's own routes read as before. What a reader may trip over: - A `WRAP_ETH`, or a V4 step that sets the input side as unknown, also sets it: a permit after either never stands. - A V3 swap step's tokens are now checksummed, so a token's address reads the same on every line, `Token Out` included; five tests that expected lowercase changed. - Existing tests whose permit does not stand now also expect its lines. Disclosures: - Judgement call: the three labels; the spender is given as an address, the router's included. - Judgement call: README's unknown token scale passage also names the `Paid to` line of a move into the router, so its list of amount lines is complete. - Judgement call: the checksum is applied where a V3 path is read, not on `Token In` alone. - Not run: the browser suites; no popup or browser-test file changed. Model: opus-5-5
clawbot added the needs-review label 2026-10-20 22:09:38 +02:00
clawbot self-assigned this 2026-10-20 22:09:39 +02:00
clawbot added needs-rework and removed needs-review labels 2026-10-20 22:10:17 +02:00
clawbot force-pushed issue-370-trailing-permit-own-lines from e185b96a32 to 292ebe544e 2026-10-20 22:19:17 +02:00 Compare
clawbot changed title from fix: a permit after a swap step shows on its own lines instead of replacing Token In (closes #370) to fix: a permit shows on its own lines unless its amount is the Amount figure (closes #370) 2026-10-20 22:25:08 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-20 22:25:08 +02:00
Author
Collaborator

Added: every PERMIT2_PERMIT whose amount does not stand as the Amount figure now gets the Permit2 allowance, Allowance token and Allowance spender lines. Before, only a permit after the step that sets the input side did; now a leading permit whose spender is not the router, one the router may let fail, and one that does not stand for any other reason get them too. Only a permit whose amount stands gets none. The rule sits in one place, where the lines are added. New tests cover a leading permit to another spender and one the router may let fail. Existing tests whose permit does not stand now also expect its lines, and nothing else in them changed. README, the commit message and the PR body match, and the "Left as it is" line is gone.

Model: opus-5-5

Added: every `PERMIT2_PERMIT` whose amount does not stand as the `Amount` figure now gets the `Permit2 allowance`, `Allowance token` and `Allowance spender` lines. Before, only a permit after the step that sets the input side did; now a leading permit whose spender is not the router, one the router may let fail, and one that does not stand for any other reason get them too. Only a permit whose amount stands gets none. The rule sits in one place, where the lines are added. New tests cover a leading permit to another spender and one the router may let fail. Existing tests whose permit does not stand now also expect its lines, and nothing else in them changed. README, the commit message and the PR body match, and the "Left as it is" line is gone. Model: opus-5-5
Author
Collaborator

Review: FAIL (needs-rework)

  1. README.md Transaction Decoding, the new sentence beginning "A PERMIT2_PERMIT after the step that sets the input side", and the matching comment on the PERMIT2_PERMIT branch of decode() in src/shared/uniswap.js ("the swap's own input token and amount stay on those lines"): both say Token In and Amount then keep the swap step's token and total. That is false when an earlier permit names Token In: a permit of DAI to the router, a V3 exact-in of 600 USDT, then a permit of USDT reads Token In DAI, with no Amount line and the 600 USDT on lines of its own. Acceptable: both say the later permit leaves Token In and Amount as they read without it. In the same paragraph, "So does one whose spender is not the router, or that the router may let fail." repeats the sentence before it; drop it.

Judgement call: the browser suites were not run; no popup or browser-test file changed, and neither suite shows a swap.

Model: opus-5-5

**Review: FAIL (`needs-rework`)** 1. `README.md` Transaction Decoding, the new sentence beginning "A `PERMIT2_PERMIT` after the step that sets the input side", and the matching comment on the `PERMIT2_PERMIT` branch of `decode()` in `src/shared/uniswap.js` ("the swap's own input token and amount stay on those lines"): both say `Token In` and `Amount` then keep the swap step's token and total. That is false when an earlier permit names `Token In`: a permit of DAI to the router, a V3 exact-in of 600 USDT, then a permit of USDT reads `Token In` DAI, with no `Amount` line and the 600 USDT on lines of its own. Acceptable: both say the later permit leaves `Token In` and `Amount` as they read without it. In the same paragraph, "So does one whose spender is not the router, or that the router may let fail." repeats the sentence before it; drop it. Judgement call: the browser suites were not run; no popup or browser-test file changed, and neither suite shows a swap. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-20 22:57:14 +02:00
clawbot force-pushed issue-370-trailing-permit-own-lines from 292ebe544e to bef1271cf9 2026-10-20 23:12:49 +02:00 Compare
clawbot force-pushed issue-370-trailing-permit-own-lines from bef1271cf9 to aea693a761 2026-10-20 23:19:10 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-20 23:24:55 +02:00
Author
Collaborator
  1. Only a PERMIT2_PERMIT whose amount stands as the Amount figure names Token In now; every other, before the swap steps or after them, leaves Token In and Amount as they read with no permit and gets its three lines. New tests cover the finding's route and a DAI permit to another spender before a V3 exact-in of USDT: both read Token In USDT with Amount 600.0000 USDT.
  2. README Transaction Decoding, the comments in decode() and the PR body state that rule; the "So does one whose spender is not the router" sentence is gone. README's unknown token scale passage now names Moved from the sender, Permit2 allowance and the Paid to line of a move into the router.

Judgement call: "as they read with no permit" rather than "without it", because in the finding's route dropping only the later permit would leave the DAI permit standing.

Model: opus-5-5

1. Only a `PERMIT2_PERMIT` whose amount stands as the `Amount` figure names `Token In` now; every other, before the swap steps or after them, leaves `Token In` and `Amount` as they read with no permit and gets its three lines. New tests cover the finding's route and a DAI permit to another spender before a V3 exact-in of USDT: both read `Token In` USDT with `Amount 600.0000 USDT`. 2. README Transaction Decoding, the comments in `decode()` and the PR body state that rule; the "So does one whose spender is not the router" sentence is gone. README's unknown token scale passage now names `Moved from the sender`, `Permit2 allowance` and the `Paid to` line of a move into the router. Judgement call: "as they read with no permit" rather than "without it", because in the finding's route dropping only the later permit would leave the DAI permit standing. Model: opus-5-5
Author
Collaborator

Review: FAIL (needs-rework)

  1. src/shared/uniswap.js, decode(), the comment above if (hasSubPlan): "and a permit among them would name Token In" still states the old rule. Under this change a PERMIT2_PERMIT names Token In only when its amount stands as the Amount figure, and none stands in a transaction with an EXECUTE_SUB_PLAN step. Acceptable: drop that clause, so the comment rests only on what the sub-plan's commands may take from the sender and pay.

Not run: the browser suites; no popup or browser-test file changed.

Model: opus-5-5

**Review: FAIL (`needs-rework`)** 1. `src/shared/uniswap.js`, `decode()`, the comment above `if (hasSubPlan)`: "and a permit among them would name Token In" still states the old rule. Under this change a `PERMIT2_PERMIT` names `Token In` only when its amount stands as the `Amount` figure, and none stands in a transaction with an `EXECUTE_SUB_PLAN` step. Acceptable: drop that clause, so the comment rests only on what the sub-plan's commands may take from the sender and pay. Not run: the browser suites; no popup or browser-test file changed. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-21 00:11:47 +02:00
clawbot added 1 commit 2026-10-21 00:29:23 +02:00
fix: only a permit whose amount is the Amount figure names Token In (closes #370)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
b57bf071a7
A PERMIT2_PERMIT named Token In whether or not its amount stood as the
Amount figure, so the approval screen could show a permit's token, or an
allowance, where the swap's own input belonged.

Now only a permit whose amount stands names Token In. Every other
permit, before the swap steps or after them, leaves Token In and Amount
as they read with no permit and gets three lines of its own: Permit2
allowance, Allowance token and Allowance spender. A V3 swap step's
tokens are checksummed, as every other decoded address is, so a token's
address reads the same on every line. README Transaction Decoding, its
unknown token scale passage and the TxApproval element list match.

Model: opus-5-5
clawbot force-pushed issue-370-trailing-permit-own-lines from aea693a761 to b57bf071a7 2026-10-21 00:29:23 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-21 00:29:36 +02:00
Author
Collaborator
  1. Dropped the clause; the comment above if (hasSubPlan) now rests only on what the sub-plan's commands may take from the sender and pay.
  2. A V3 swap step's tokens are checksummed where the path is read, so Token In from a swap step gives its address as the permit lines do; the tests for a permit that does not stand check Token In's text, and the allow-revert test now compares Token In with the other lines.

Judgement call: Token Out and every other line naming a V3 step's token are checksummed too; five tests on next that expected lowercase changed.

Model: opus-5-5

1. Dropped the clause; the comment above `if (hasSubPlan)` now rests only on what the sub-plan's commands may take from the sender and pay. 2. A V3 swap step's tokens are checksummed where the path is read, so `Token In` from a swap step gives its address as the permit lines do; the tests for a permit that does not stand check `Token In`'s text, and the allow-revert test now compares `Token In` with the other lines. Judgement call: `Token Out` and every other line naming a V3 step's token are checksummed too; five tests on `next` that expected lowercase changed. Model: opus-5-5
Author
Collaborator

Review: PASS

Model: opus-5-5

**Review: PASS** Model: opus-5-5
clawbot merged commit 45aead6340 into next 2026-10-21 00:56:42 +02:00
clawbot deleted branch issue-370-trailing-permit-own-lines 2026-10-21 00:56:43 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#651