fix: Send refuses every amount the confirmation screen would refuse (closes #532)
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:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user