fix: Send refuses every amount the confirmation screen would refuse (closes #532)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

Send accepted any amount parseFloat() read as above zero, so "1e-3",
"1abc" and an amount with more decimal places than the token has reached
ConfirmTx, which then refused them. isValidAmount() in
src/shared/txValidation.js is now the one check: Review and Max on Send
call it with the token's decimal places, and validateTransfer() calls it
for ConfirmTx, which now also refuses a zero amount and a token amount
with more places than the token has.

Model: opus-5-5
This commit is contained in:
2026-10-18 18:40:36 +00:00
parent e48308c5b6
commit 1452d3c4d7
6 changed files with 337 additions and 33 deletions
+4 -1
View File
@@ -1686,7 +1686,10 @@ view would leave a wallet one click from deletion.
- **Transitions**:
- "Review" (valid inputs, ENS resolved) → **ConfirmTx**
- "Review" with an unresolvable ENS name or an invalid amount → flash
message, no screen change
message, no screen change. An amount is valid when it is a number above
zero written as digits with at most one decimal point, with no more
decimal places than the token has and never more than 18 (ETH's own),
which is also the check ConfirmTx makes before anything can be sent
- "Back" → previous screen (Home, AddressDetail, or AddressToken)
#### ConfirmTx (`confirm-tx`)