The swap decoder, decode() in src/shared/uniswap.js. PERMIT2_PERMIT_BATCH is named in the Steps line but never read, and a PERMIT2_PERMIT the decoder cannot read gets no lines.
What happens
A transaction with a PERMIT2_PERMIT_BATCH asks the user to sign allowances for one or more tokens to a spender, possibly not the router, and the approval screen shows none of them: no token, no amount, no spender. A PERMIT2_PERMIT whose input cannot be read is shown the same way. The user authorizes what the screen does not state.
What should happen
Settled on #370: nothing the user authorizes goes unstated. Each allowance a PERMIT2_PERMIT_BATCH grants is shown with its token, amount and spender, as a single PERMIT2_PERMIT that does not stand now is; a permit or batch that cannot be read is shown as one whose allowances could not be decoded, and leaves no Amount figure that may be too low.
Severity: major
Definition of done
Each allowance of a PERMIT2_PERMIT_BATCH is shown with its token, amount and spender.
A permit or batch the decoder cannot read is shown as not decoded.
Tests for a batch of two allowances (one to another spender) and for an unreadable permit, failing on next.
Model: opus-5-5
Seen by the review of https://git.eeqj.de/sneak/AutistMask/pulls/651.
## Where
The swap decoder, `decode()` in `src/shared/uniswap.js`. `PERMIT2_PERMIT_BATCH` is named in the Steps line but never read, and a `PERMIT2_PERMIT` the decoder cannot read gets no lines.
## What happens
A transaction with a `PERMIT2_PERMIT_BATCH` asks the user to sign allowances for one or more tokens to a spender, possibly not the router, and the approval screen shows none of them: no token, no amount, no spender. A `PERMIT2_PERMIT` whose input cannot be read is shown the same way. The user authorizes what the screen does not state.
## What should happen
Settled on https://git.eeqj.de/sneak/AutistMask/issues/370: nothing the user authorizes goes unstated. Each allowance a `PERMIT2_PERMIT_BATCH` grants is shown with its token, amount and spender, as a single `PERMIT2_PERMIT` that does not stand now is; a permit or batch that cannot be read is shown as one whose allowances could not be decoded, and leaves no `Amount` figure that may be too low.
Severity: major
## Definition of done
- [ ] Each allowance of a `PERMIT2_PERMIT_BATCH` is shown with its token, amount and spender.
- [ ] A permit or batch the decoder cannot read is shown as not decoded.
- [ ] Tests for a batch of two allowances (one to another spender) and for an unreadable permit, failing on `next`.
Model: opus-5-5
clawbot
self-assigned this 2026-10-20 22:58:24 +02:00
Plan: one PR to next, in src/shared/uniswap.js. A decodePermit2PermitBatch() beside the single permit's reader reads (PermitBatch{details[]{token, amount, expiration, nonce}, spender, sigDeadline}, signature); each allowance it grants gets the three lines a permit that does not stand now gets (#651), and a batch never names Token In or stands as the Amount figure. A PERMIT2_PERMIT or batch whose input cannot be read gets one line saying its allowances could not be decoded, and leaves no Amount figure. A batch already ends a single permit's standing; keep that. Tests for a batch of two allowances (one to another spender) and for an unreadable permit and batch, each failing on next.
Model: opus-5-5
Plan: one PR to `next`, in `src/shared/uniswap.js`. A `decodePermit2PermitBatch()` beside the single permit's reader reads `(PermitBatch{details[]{token, amount, expiration, nonce}, spender, sigDeadline}, signature)`; each allowance it grants gets the three lines a permit that does not stand now gets (https://git.eeqj.de/sneak/AutistMask/pulls/651), and a batch never names `Token In` or stands as the `Amount` figure. A `PERMIT2_PERMIT` or batch whose input cannot be read gets one line saying its allowances could not be decoded, and leaves no `Amount` figure. A batch already ends a single permit's standing; keep that. Tests for a batch of two allowances (one to another spender) and for an unreadable permit and batch, each failing on `next`.
Model: opus-5-5
Built in #656: each allowance of a PERMIT2_PERMIT_BATCH gets the three lines of a permit whose amount does not stand, and a permit or batch that cannot be read gets one Permit2 allowance line reading Unknown (could not be decoded) and leaves no Amount line.
Judgement call, stated on the PR: any batch in the transaction now keeps a PERMIT2_PERMIT's amount from standing, a batch before the permit included.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/AutistMask/pulls/656: each allowance of a `PERMIT2_PERMIT_BATCH` gets the three lines of a permit whose amount does not stand, and a permit or batch that cannot be read gets one `Permit2 allowance` line reading `Unknown (could not be decoded)` and leaves no `Amount` line.
Judgement call, stated on the PR: any batch in the transaction now keeps a `PERMIT2_PERMIT`'s amount from standing, a batch before the permit included.
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 #651.
Where
The swap decoder,
decode()insrc/shared/uniswap.js.PERMIT2_PERMIT_BATCHis named in the Steps line but never read, and aPERMIT2_PERMITthe decoder cannot read gets no lines.What happens
A transaction with a
PERMIT2_PERMIT_BATCHasks the user to sign allowances for one or more tokens to a spender, possibly not the router, and the approval screen shows none of them: no token, no amount, no spender. APERMIT2_PERMITwhose input cannot be read is shown the same way. The user authorizes what the screen does not state.What should happen
Settled on #370: nothing the user authorizes goes unstated. Each allowance a
PERMIT2_PERMIT_BATCHgrants is shown with its token, amount and spender, as a singlePERMIT2_PERMITthat does not stand now is; a permit or batch that cannot be read is shown as one whose allowances could not be decoded, and leaves noAmountfigure that may be too low.Severity: major
Definition of done
PERMIT2_PERMIT_BATCHis shown with its token, amount and spender.next.Model: opus-5-5
Plan: one PR to
next, insrc/shared/uniswap.js. AdecodePermit2PermitBatch()beside the single permit's reader reads(PermitBatch{details[]{token, amount, expiration, nonce}, spender, sigDeadline}, signature); each allowance it grants gets the three lines a permit that does not stand now gets (#651), and a batch never namesToken Inor stands as theAmountfigure. APERMIT2_PERMITor batch whose input cannot be read gets one line saying its allowances could not be decoded, and leaves noAmountfigure. A batch already ends a single permit's standing; keep that. Tests for a batch of two allowances (one to another spender) and for an unreadable permit and batch, each failing onnext.Model: opus-5-5
Built in #656: each allowance of a
PERMIT2_PERMIT_BATCHgets the three lines of a permit whose amount does not stand, and a permit or batch that cannot be read gets onePermit2 allowanceline readingUnknown (could not be decoded)and leaves noAmountline.Judgement call, stated on the PR: any batch in the transaction now keeps a
PERMIT2_PERMIT's amount from standing, a batch before the permit included.Model: opus-5-5