fix: an allowance to another spender leaves no Amount figure for its token and no Min. received (closes #658) #666

Merged
clawbot merged 1 commits from issue-658-allowance-to-another-spender into next 2026-10-21 06:24:52 +02:00
Collaborator

Fixes #658.

Code that a step runs, such as a V4 pool's hook or a token's own code, can call a spender other than the router, which can then take up to its allowance from the user's wallet before the transaction ends. The Amount figure and Min. received took no account of it.

In decode() in src/shared/uniswap.js:

  • An allowance of Token In to a spender other than the router leaves no Amount line, through the condition that already held it back for a permit the decoder cannot read. The swap steps' own takes then get Moved from the sender lines, as since #662.
  • Any allowance to another spender makes the minimum read Min. paid out.
  • Allowances to the router are unchanged, so Uniswap's own routes read as on next.

README Transaction Decoding matches.

What a reader may trip over:

  • An allowance of a token other than Token In keeps the Amount line; only the minimum's label changes.
  • A permit naming a different Universal Router counts as another spender, so the allow-revert test in tests/uniswapRecipient.test.js now expects Min. paid out on the routers it does not name.
  • Tests whose "another spender" rows encoded the old reading moved into the new test block.

Disclosures:

  • Judgement call: a permit or batch the decoder cannot read may be to any spender, so it now also makes the minimum read Min. paid out (it already left no Amount line).
  • Not run: the browser suites; no popup or browser-test file changed.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/658. Code that a step runs, such as a V4 pool's hook or a token's own code, can call a spender other than the router, which can then take up to its allowance from the user's wallet before the transaction ends. The `Amount` figure and `Min. received` took no account of it. In `decode()` in `src/shared/uniswap.js`: - An allowance of `Token In` to a spender other than the router leaves no `Amount` line, through the condition that already held it back for a permit the decoder cannot read. The swap steps' own takes then get `Moved from the sender` lines, as since https://git.eeqj.de/sneak/AutistMask/pulls/662. - Any allowance to another spender makes the minimum read `Min. paid out`. - Allowances to the router are unchanged, so Uniswap's own routes read as on `next`. README Transaction Decoding matches. What a reader may trip over: - An allowance of a token other than `Token In` keeps the `Amount` line; only the minimum's label changes. - A permit naming a different Universal Router counts as another spender, so the allow-revert test in `tests/uniswapRecipient.test.js` now expects `Min. paid out` on the routers it does not name. - Tests whose "another spender" rows encoded the old reading moved into the new test block. Disclosures: - Judgement call: a permit or batch the decoder cannot read may be to any spender, so it now also makes the minimum read `Min. paid out` (it already left no `Amount` line). - Not run: the browser suites; no popup or browser-test file changed. Model: opus-5-5
clawbot added the needs-review label 2026-10-21 05:30:34 +02:00
clawbot self-assigned this 2026-10-21 05:30:34 +02:00
clawbot added 1 commit 2026-10-21 05:30:35 +02:00
fix: an allowance to another spender leaves no Amount figure for its token and no Min. received (closes #658)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
b17376b00b
Code that a step runs, such as a V4 pool's hook, can call a spender other
than the router, which can then take up to its allowance from the user's
wallet before the transaction ends. The Amount figure and Min. received took
no account of it.

In decode(), an allowance of Token In to a spender other than the router
now leaves no Amount line, as an unread permit already did, so the swap
steps' own takes get lines of their own. Any allowance to another spender,
or a permit or batch the decoder cannot read, makes the minimum read
Min. paid out. Permits to the router read as before.

Model: opus-5-5
Author
Collaborator

Review: PASS

Model: opus-5-5

**Review: PASS** Model: opus-5-5
clawbot merged commit 4be625dc06 into next 2026-10-21 06:24:52 +02:00
clawbot deleted branch issue-658-allowance-to-another-spender 2026-10-21 06:24:54 +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#666