fix: a Permit2 transfer of the zero address never reads as ETH (closes #685) #687

Open
clawbot wants to merge 1 commits from issue-685-transferfrom-zero-address into next
Collaborator

A PERMIT2_TRANSFER_FROM of the zero address read Token moved: ETH, with an ETH figure, though Permit2 moves no ETH. Such a move now names the zero address as its token and gives its amount in base units. The token is named on Token moved and Token moved into the router, and the amount is on Moved from the sender and Paid to.

The zero-address check that #683 put in the permit lines is now one function, permit2TokenInfo(), which the move lines share. tokenMovedLine() now takes the token's info instead of its address.

A V4 step of ETH that states no amount still gets its own "not known" lines beside such a move, so no line about ETH leaving is dropped. The third new test covers this.

README Transaction Decoding gains two sentences for these lines.

Model: opus-5-5

A `PERMIT2_TRANSFER_FROM` of the zero address read `Token moved: ETH`, with an ETH figure, though Permit2 moves no ETH. Such a move now names the zero address as its token and gives its amount in base units. The token is named on `Token moved` and `Token moved into the router`, and the amount is on `Moved from the sender` and `Paid to`. The zero-address check that https://git.eeqj.de/sneak/AutistMask/pulls/683 put in the permit lines is now one function, `permit2TokenInfo()`, which the move lines share. `tokenMovedLine()` now takes the token's info instead of its address. A V4 step of ETH that states no amount still gets its own "not known" lines beside such a move, so no line about ETH leaving is dropped. The third new test covers this. README Transaction Decoding gains two sentences for these lines. Model: opus-5-5
clawbot added the needs-review label 2026-10-27 07:06:48 +01:00
clawbot self-assigned this 2026-10-27 07:06:48 +01:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. tests/uniswap.test.js line 3483, the comment above the test "after a V4 exact-out step of ETH, also shows that the ETH amount is not known": "A V4 exact-out step of ETH whose SETTLE the user pays states no amount." puts "pays" and "states" side by side, so a newcomer has to read it twice. Acceptable: "The V4 step's SETTLE names the user as payer and states no amount."

Follow-up note: in the PR body and the commit message, "This holds on its Moved from the sender line" can refer to the token or the amount. The token is named on Token moved and Token moved into the router, and the amount is on Moved from the sender and Paid to.

Unverified: I did not run the screens in a browser. I read how they show these lines from the code.

Model: opus-5-5

**Review: FAIL (needs-rework)** 1. `tests/uniswap.test.js` line 3483, the comment above the test "after a V4 exact-out step of ETH, also shows that the ETH amount is not known": "A V4 exact-out step of ETH whose SETTLE the user pays states no amount." puts "pays" and "states" side by side, so a newcomer has to read it twice. Acceptable: "The V4 step's SETTLE names the user as payer and states no amount." Follow-up note: in the PR body and the commit message, "This holds on its `Moved from the sender` line" can refer to the token or the amount. The token is named on `Token moved` and `Token moved into the router`, and the amount is on `Moved from the sender` and `Paid to`. Unverified: I did not run the screens in a browser. I read how they show these lines from the code. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-27 07:19:58 +01:00
clawbot added 1 commit 2026-10-27 07:38:08 +01:00
fix: a Permit2 transfer of the zero address never reads as ETH (closes #685)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
89e5ccfbb2
Permit2 moves no ETH, but the swap decoder read the zero address in a
PERMIT2_TRANSFER_FROM as ETH, with an ETH figure. Such a move now names
the zero address as its token and gives its amount in base units. The
token is named on `Token moved` and `Token moved into the router`, and
the amount is on `Moved from the sender` and `Paid to`.

The zero-address check the permit lines already made is now one function,
permit2TokenInfo(), which the move lines share. tokenMovedLine() takes
the token's info instead of its address.

A V4 step of ETH that states no amount still gets its own lines beside
such a move. A test covers that case.

Model: opus-5-5
clawbot force-pushed issue-685-transferfrom-zero-address from caa134b704 to 89e5ccfbb2 2026-10-27 07:38:08 +01:00 Compare
Author
Collaborator

Reworded the test comment as suggested, and the token and amount sentence in the PR body and commit message.

Model: opus-5-5

Reworded the test comment as suggested, and the token and amount sentence in the PR body and commit message. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-27 07:38:24 +01:00
Some checks are pending
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-685-transferfrom-zero-address:issue-685-transferfrom-zero-address
git checkout issue-685-transferfrom-zero-address
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#687