fix: a PERMIT2_PERMIT_BATCH, and a permit that cannot be read, state what they allow (closes #652) #656

Merged
clawbot merged 1 commits from issue-652-permit-batch-allowances into next 2026-10-21 01:41:35 +02:00
Collaborator

Fixes #652.

A PERMIT2_PERMIT_BATCH was never read, and a PERMIT2_PERMIT whose input could not be read got no lines, so the approval screen showed nothing of the allowances either grants.

What changed, in src/shared/uniswap.js:

  • decodePermit2Batch() reads the batch in the shape every pinned release's Dispatcher.sol hands to Permit2. Each allowance joins the single permits' list and gets the same three lines (Permit2 allowance, Allowance token, Allowance spender) from the same loop.
  • A permit or batch that cannot be read gets one Permit2 allowance line reading Unknown (could not be decoded), and there is no Amount line.
  • A batch pays nobody, so it no longer adds Paid to: Unknown (could not be decoded). Without that line the minimum can read Min. received.

README Transaction Decoding and the TxApproval element list match.

What a reader may trip over:

  • A batch names one spender for all its allowances, so the "another spender" test is a batch whose spender is not the router.
  • Judgement call: any batch in the transaction now keeps a PERMIT2_PERMIT's amount from standing as the Amount figure. On next only a batch after the permit did, by going unread; a batch before it let the permit stand. Counting every batch is as simple as the existing "only PERMIT2_PERMIT" condition, and the Amount line then gives the total the steps take.
  • A batch still counts, as on next, as a step that may take WETH out of the router (the UNWRAP_WETH minimum rule), where a single permit does not. I left that alone as outside this issue.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/652. A `PERMIT2_PERMIT_BATCH` was never read, and a `PERMIT2_PERMIT` whose input could not be read got no lines, so the approval screen showed nothing of the allowances either grants. What changed, in `src/shared/uniswap.js`: - `decodePermit2Batch()` reads the batch in the shape every pinned release's `Dispatcher.sol` hands to Permit2. Each allowance joins the single permits' list and gets the same three lines (`Permit2 allowance`, `Allowance token`, `Allowance spender`) from the same loop. - A permit or batch that cannot be read gets one `Permit2 allowance` line reading `Unknown (could not be decoded)`, and there is no `Amount` line. - A batch pays nobody, so it no longer adds `Paid to: Unknown (could not be decoded)`. Without that line the minimum can read `Min. received`. README Transaction Decoding and the TxApproval element list match. What a reader may trip over: - A batch names one spender for all its allowances, so the "another spender" test is a batch whose spender is not the router. - Judgement call: any batch in the transaction now keeps a `PERMIT2_PERMIT`'s amount from standing as the `Amount` figure. On `next` only a batch after the permit did, by going unread; a batch before it let the permit stand. Counting every batch is as simple as the existing "only `PERMIT2_PERMIT`" condition, and the `Amount` line then gives the total the steps take. - A batch still counts, as on `next`, as a step that may take WETH out of the router (the `UNWRAP_WETH` minimum rule), where a single permit does not. I left that alone as outside this issue. Model: opus-5-5
clawbot added the needs-review label 2026-10-21 01:17:45 +02:00
clawbot self-assigned this 2026-10-21 01:17:46 +02:00
clawbot added 1 commit 2026-10-21 01:17:46 +02:00
fix: a PERMIT2_PERMIT_BATCH, and a permit that cannot be read, state what they allow (closes #652)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
8984a5e52b
A PERMIT2_PERMIT_BATCH was never read, and a PERMIT2_PERMIT whose input
could not be read got no lines, so the approval screen showed nothing of
the allowances either grants.

Each allowance of a batch now gets the three lines a permit whose amount
does not stand gets: Permit2 allowance, Allowance token and Allowance
spender. A permit or batch that cannot be read gets one Permit2 allowance
line reading Unknown (could not be decoded) and leaves no Amount line.
Any batch in the transaction keeps a PERMIT2_PERMIT's amount from
standing. A batch pays nobody, so it no longer adds a Paid to line.
README Transaction Decoding and the TxApproval element list match.

Model: opus-5-5
Author
Collaborator

Review: PASS

Model: opus-5-5

**Review: PASS** Model: opus-5-5
clawbot merged commit f53b503b15 into next 2026-10-21 01:41:35 +02:00
clawbot deleted branch issue-652-permit-batch-allowances 2026-10-21 01:41:35 +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#656