docs: name every approval-screen amount string, fix stale zero claim (closes #369) #393

Open
clawbot wants to merge 1 commits from issue-369-approval-amount-vocabulary into next
Collaborator

Docs-only. Closes #369.

README.md's Display Consistency section carried a claim that contradicted the tree: it said a genuine zero still renders 0.0000, in a passage whose worked example is a swap's Min. received. After #359, a zero Min. received renders None (no minimum guaranteed), so the claim and its example disagreed.

What changed:

  • The zero claim is corrected. It holds for the floor function and the ERC-20 approve/transfer amount, but the swap's Amount and Min. received lines state their two misleading zeros — a V4 open-delta amount and a zero minimum — in words before the floor is reached, so a zero is never shown as 0.0000 there.
  • A new list names every string an amount slot can show and what each means: a formatted quantity, Unlimited, All available (V4 open delta), None (no minimum guaranteed), base units with decimals unknown, and Unknown (not named in the calldata) (the last being the currency slot, not an amount, noted as such).
  • It records that a zero minBalance on a BALANCE_CHECK_ERC20 step now reads None (no minimum guaranteed) where it once read 0.0000.

Each string and file reference was checked against src/shared/uniswap.js, src/shared/amountDisplay.js, src/shared/approvalAmount.js and src/popup/views/approval.js on next.

Trip-up: Unlimited on the ERC-20 side is the approve line only (a uint256 max); transfer has no such case.

Model: opus-4-8

Docs-only. Closes https://git.eeqj.de/sneak/AutistMask/issues/369. `README.md`'s Display Consistency section carried a claim that contradicted the tree: it said a genuine zero still renders `0.0000`, in a passage whose worked example is a swap's `Min. received`. After https://git.eeqj.de/sneak/AutistMask/issues/359, a zero `Min. received` renders `None (no minimum guaranteed)`, so the claim and its example disagreed. What changed: - The zero claim is corrected. It holds for the floor function and the ERC-20 `approve`/`transfer` amount, but the swap's `Amount` and `Min. received` lines state their two misleading zeros — a V4 open-delta amount and a zero minimum — in words before the floor is reached, so a zero is never shown as `0.0000` there. - A new list names every string an amount slot can show and what each means: a formatted quantity, `Unlimited`, `All available (V4 open delta)`, `None (no minimum guaranteed)`, base units with decimals unknown, and `Unknown (not named in the calldata)` (the last being the currency slot, not an amount, noted as such). - It records that a zero `minBalance` on a `BALANCE_CHECK_ERC20` step now reads `None (no minimum guaranteed)` where it once read `0.0000`. Each string and file reference was checked against `src/shared/uniswap.js`, `src/shared/amountDisplay.js`, `src/shared/approvalAmount.js` and `src/popup/views/approval.js` on `next`. Trip-up: `Unlimited` on the ERC-20 side is the `approve` line only (a `uint256` max); `transfer` has no such case. Model: opus-4-8
clawbot added the needs-review label 2026-09-21 09:45:25 +02:00
clawbot self-assigned this 2026-09-21 09:45:25 +02:00
clawbot added needs-rebase and removed needs-review labels 2026-09-21 18:31:56 +02:00
clawbot force-pushed issue-369-approval-amount-vocabulary from 5543c44551 to ee24afafd1 2026-09-22 00:51:36 +02:00 Compare
clawbot added needs-review and removed needs-rebase labels 2026-09-22 00:51:54 +02:00
Author
Collaborator

Rebased onto current next; new head ee24afafd1e699b61ebb953c13bf82a3bf36da12.

Only TODO.md conflicted; README.md merged cleanly. The conflict was the Completed Steps ordering: this PR's 2026-09-21 entry against the seven 2026-09-21 entries that landed on next. Kept every entry and placed this PR's entry directly after next's 2026-09-21 run (last is #375), before the 2026-08-30 entry.

No README.md sentence needed correcting. Re-read every sentence this PR adds against src/shared/approvalAmount.js, src/popup/views/approval.js and src/shared/uniswap.js as now on next. #323 changed only symbol naming (the Unknown token label), which the added amount-slot list does not describe; every amount-slot claim still holds against the tree — Unlimited (uint256-max approve, uint160-max permit), All available (V4 open delta), None (no minimum guaranteed) including a zero minBalance on a BALANCE_CHECK_ERC20 step, base units with decimals unknown, and Unknown (not named in the calldata).

make check green locally (runner CI broken, #396).

Model: opus-4-8

Rebased onto current `next`; new head `ee24afafd1e699b61ebb953c13bf82a3bf36da12`. Only `TODO.md` conflicted; `README.md` merged cleanly. The conflict was the Completed Steps ordering: this PR's 2026-09-21 entry against the seven 2026-09-21 entries that landed on `next`. Kept every entry and placed this PR's entry directly after `next`'s 2026-09-21 run (last is [#375](https://git.eeqj.de/sneak/AutistMask/issues/375)), before the 2026-08-30 entry. No `README.md` sentence needed correcting. Re-read every sentence this PR adds against `src/shared/approvalAmount.js`, `src/popup/views/approval.js` and `src/shared/uniswap.js` as now on `next`. [#323](https://git.eeqj.de/sneak/AutistMask/issues/323) changed only symbol naming (the `Unknown token` label), which the added amount-slot list does not describe; every amount-slot claim still holds against the tree — `Unlimited` (uint256-max `approve`, uint160-max permit), `All available (V4 open delta)`, `None (no minimum guaranteed)` including a zero `minBalance` on a `BALANCE_CHECK_ERC20` step, base units with decimals unknown, and `Unknown (not named in the calldata)`. `make check` green locally (runner CI broken, [#396](https://git.eeqj.de/sneak/AutistMask/issues/396)). Model: opus-4-8
Author
Collaborator

FAIL

Finding — README.md lines 888–892 (Display Consistency), the corrected zero claim.

The new sentence asserts the swap's Amount line "never hand[s] it one" and that "on those lines a zero is never shown as 0.0000." This is false for the Amount line. Only a V4 exact-in amountIn of zero is mapped away (v4ExactInAmount()All available (V4 open delta)). A V2 or V3 exact-in swap with amountIn = 0n (commands 0x08/0x00), and a WRAP_ETH (0x0b) of zero, fall through to the else branch in src/shared/uniswap.js (~line 617) → amountText()formatAmount()truncateAmountNeverZero(), which renders 0.0000 (0.0000 ETH for the wrap). src/shared/uniswap.js lines 87–90 document this directly: "a zero amountIn there is a literal zero and is displayed as one." So a genuine zero IS shown as 0.0000 on the swap Amount line, contradicting the README — the class of false claim this issue exists to remove.

Same defect in TODO.md (2026-09-21 entry): "the swap's Amount and Min. received state their two misleading zeros in words upstream" holds only for Min. received and the V4 Amount, not the V2/V3/WRAP_ETH Amount.

What acceptable looks like: scope the guarantee to the Min. received line and the V4 exact-in Amount; state that a literal-zero amountIn on a V2/V3 swap, or a zero WRAP_ETH, does render 0.0000 on the Amount line — 0.0000 is reachable in the swap Amount slot, not only the ERC-20 amount slot.

The Min. received correction, the BALANCE_CHECK_ERC20 note, and every amount-slot string in the new list otherwise match the code.

Model: opus-4-8

FAIL **Finding — `README.md` lines 888–892 (Display Consistency), the corrected zero claim.** The new sentence asserts the swap's `Amount` line "never hand[s] it one" and that "on those lines a zero is never shown as `0.0000`." This is false for the `Amount` line. Only a V4 exact-in `amountIn` of zero is mapped away (`v4ExactInAmount()` → `All available (V4 open delta)`). A V2 or V3 exact-in swap with `amountIn` = `0n` (commands `0x08`/`0x00`), and a `WRAP_ETH` (`0x0b`) of zero, fall through to the `else` branch in `src/shared/uniswap.js` (~line 617) → `amountText()` → `formatAmount()` → `truncateAmountNeverZero()`, which renders `0.0000` (`0.0000 ETH` for the wrap). `src/shared/uniswap.js` lines 87–90 document this directly: "a zero `amountIn` there is a literal zero and is displayed as one." So a genuine zero IS shown as `0.0000` on the swap `Amount` line, contradicting the README — the class of false claim this issue exists to remove. Same defect in `TODO.md` (2026-09-21 entry): "the swap's `Amount` and `Min. received` state their two misleading zeros in words upstream" holds only for `Min. received` and the V4 `Amount`, not the V2/V3/`WRAP_ETH` `Amount`. What acceptable looks like: scope the guarantee to the `Min. received` line and the V4 exact-in `Amount`; state that a literal-zero `amountIn` on a V2/V3 swap, or a zero `WRAP_ETH`, does render `0.0000` on the `Amount` line — `0.0000` is reachable in the swap `Amount` slot, not only the ERC-20 amount slot. The `Min. received` correction, the `BALANCE_CHECK_ERC20` note, and every amount-slot string in the new list otherwise match the code. Model: opus-4-8
clawbot added needs-rework and removed needs-review labels 2026-09-22 01:05:57 +02:00
clawbot force-pushed issue-369-approval-amount-vocabulary from ee24afafd1 to eb91568d99 2026-09-22 01:15:43 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-09-22 01:15:55 +02:00
Author
Collaborator

Fixed. The README.md Display Consistency paragraph and the TODO.md 2026-09-21 entry no longer claim the swap Amount line is never handed a zero. Both now state that a literal-zero amountIn on a V2/V3 exact-in swap, or a zero WRAP_ETH, renders 0.0000 (0.0000 ETH for the wrap), and scope the never-0.0000 guarantee to the Min. received line and the V4 exact-in Amount. Corrected the commit message to match. Verified against src/shared/uniswap.js (open-delta only for V4 exact-in; V2/V3 and WRAP_ETH fall through to amountText) and the comment at its lines 87-90.

New head eb91568d99f67ccc187b2ad15be17a9c875175ab. make check green locally (runner CI broken, #396).

Model: opus-4-8

Fixed. The `README.md` Display Consistency paragraph and the `TODO.md` 2026-09-21 entry no longer claim the swap `Amount` line is never handed a zero. Both now state that a literal-zero `amountIn` on a V2/V3 exact-in swap, or a zero `WRAP_ETH`, renders `0.0000` (`0.0000 ETH` for the wrap), and scope the never-`0.0000` guarantee to the `Min. received` line and the V4 exact-in `Amount`. Corrected the commit message to match. Verified against `src/shared/uniswap.js` (open-delta only for V4 exact-in; V2/V3 and `WRAP_ETH` fall through to `amountText`) and the comment at its lines 87-90. New head `eb91568d99f67ccc187b2ad15be17a9c875175ab`. `make check` green locally (runner CI broken, https://git.eeqj.de/sneak/AutistMask/issues/396). Model: opus-4-8
clawbot added 1 commit 2026-09-22 01:31:46 +02:00
docs: name every approval-screen amount string, fix stale zero claim (closes #369)
e2e / e2e-chrome (push) Failing after 1s
e2e / e2e-firefox (push) Failing after 1s
check / check (push) Successful in 1m18s
65d4dd8e0f
The README's amount-display section claimed a genuine zero always renders
`0.0000`. That is corrected and scoped: it holds for the ERC-20 amount and for
the swap's `Amount` line on a literal-zero `amountIn` in a V2/V3 exact-in swap
or a zero `WRAP_ETH`. Only two zeros are stated in words before the floor — the
swap's `Min. received` (any zero minimum) and its V4 exact-in `Amount` (an
`amountIn` of zero, V4's open delta).

A new list names every string an amount slot can show: a formatted quantity,
`Unlimited`, `All available (V4 open delta)`, `None (no minimum guaranteed)`,
base units with decimals unknown, and `Unknown (not named in the calldata)`. It
also records that a zero `minBalance` on a `BALANCE_CHECK_ERC20` step now reads
the no-minimum wording where it once read `0.0000`. Each claim checked against
the tree. Docs only.

Model: opus-4-8
clawbot force-pushed issue-369-approval-amount-vocabulary from eb91568d99 to 65d4dd8e0f 2026-09-22 01:31:46 +02:00 Compare
Author
Collaborator

Rebased onto current origin/next (598de3f). The only conflict was in TODO.md, from the #335 entry landing on next; resolved by keeping every entry and placing this PR's #369 entry directly after the other 2026-09-21 entries. Nothing else changed — README.md carried through untouched. make fmt clean, make check green. New head: 65d4dd8.

Model: opus-4-8

Rebased onto current `origin/next` (`598de3f`). The only conflict was in `TODO.md`, from the #335 entry landing on `next`; resolved by keeping every entry and placing this PR's #369 entry directly after the other 2026-09-21 entries. Nothing else changed — `README.md` carried through untouched. `make fmt` clean, `make check` green. New head: `65d4dd8`. Model: opus-4-8
Some required checks failed
e2e / e2e-chrome (push) Failing after 1s
e2e / e2e-firefox (push) Failing after 1s
check / check (push) Successful in 1m18s
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-369-approval-amount-vocabulary:issue-369-approval-amount-vocabulary
git checkout issue-369-approval-amount-vocabulary
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#393