Compare commits

..
1 Commits
Author SHA1 Message Date
sneak ee24afafd1 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 57s
The README's amount-display section carried a claim that contradicted the
tree: it said a genuine zero renders `0.0000`, but a swap's `Min. received`
worked example now shows `None (no minimum guaranteed)` for a zero minimum.
The claim is corrected — it holds for the ERC-20 amount, while the swap's
`Amount` and `Min. received` state their two misleading zeros (a V4 open
delta and a zero minimum) in words before the floor is reached.

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)`. 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 was checked against the
tree. Docs only; no code or tests change.

Model: opus-4-8
2026-09-21 22:49:20 +00:00
2 changed files with 14 additions and 20 deletions
+6 -10
View File
@@ -884,16 +884,12 @@ instead: `0.000000000000000001 DAI`, not `0.0000 DAI`. The test is on the whole
truncated string, integer part included, so `1.00005` still shows as `1.0000`
the exception only fires where the entire displayed figure would read as zero.
Truncation stays truncation: `0.99999` shows as `0.9999`, never rounded up. A
genuine zero reaching this rule renders `0.0000`. The ERC-20
`approve`/`transfer` amount does exactly that, and so does the swap's `Amount`
line for a literal-zero `amountIn` on a V2 or V3 exact-in swap, or a zero
`WRAP_ETH` (`0.0000 ETH`). Only two zeros are stated in words before the floor:
the swap's `Min. received` line reads `None (no minimum guaranteed)` for any
zero minimum, and its `Amount` line reads `All available (V4 open delta)` for a
V4 exact-in `amountIn` of zero, which V4 treats as the whole open credit rather
than a quantity. So the guarantee that a zero is never shown as `0.0000` covers
the `Min. received` line and the V4 exact-in `Amount`; a V2/V3 or `WRAP_ETH`
`Amount` still renders it (see the list of amount-slot strings below).
genuine zero reaching this rule renders `0.0000`, and the ERC-20
`approve`/`transfer` amount does exactly that. The swap's `Amount` and
`Min. received` lines never hand it one: the two zeros that would mislead there
— a V4 open-delta amount and a zero minimum — are stated in words before the
floor is reached, so on those lines a zero is never shown as `0.0000` (see the
list of amount-slot strings below).
The rule and its exception live in `src/shared/amountDisplay.js` as
`truncateAmount()` and `truncateAmountNeverZero()`. Everything the approval and
+8 -10
View File
@@ -136,16 +136,14 @@ but the review is broader than any of them.
vocabulary and no longer contradicts itself
([#369](https://git.eeqj.de/sneak/AutistMask/issues/369)). The stale claim
that a genuine zero still renders `0.0000` is corrected: it holds for the
ERC-20 amount, and also 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 upstream — the swap's `Min. received` (any zero minimum) and
its V4 exact-in `Amount` (an `amountIn` of zero, V4's open delta). The
amount-display section now names every string a 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)` — and records that a zero `minBalance`
on a `BALANCE_CHECK_ERC20` step now reads `None (no minimum guaranteed)` where
it once read `0.0000`. Docs only; each claim checked against the tree.
ERC-20 amount, but the swap's `Amount` and `Min. received` state their two
misleading zeros in words upstream. The amount-display section now names every
string a 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)` — and records
that a zero `minBalance` on a `BALANCE_CHECK_ERC20` step now reads
`None (no minimum guaranteed)` where it once read `0.0000`. Docs only; each
claim checked against the tree.
- 2026-08-30: An address no longer wraps, or is shortened to fit, in any of the
common views ([#380](https://git.eeqj.de/sneak/AutistMask/issues/380)). The
wallet list was the reported case: the address shared one row with the