Add zero-amount send warning for EVM chains#6058
Open
j0ntz wants to merge 2 commits into
Open
Conversation
Sending a zero amount on Ethereum and other EVM chains is allowed but still spends gas, and users have accidentally done so. Confirm the user's intent with a warning modal before broadcasting a zero-amount send on any EVM coin or token. Other chains are unaffected since they already disable the slider for zero amounts.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
EVM chains (Ethereum and other
allowZeroTxchains) let you broadcast a zero-amount transaction, which still spends gas. Users have accidentally sent zero-amount transactions and wasted gas (multiple Zendesk tickets).This adds a confirmation warning when the user slides to confirm a send whose amount is zero on an EVM wallet or token. The warning explains gas is still charged and offers Continue / Cancel. Cancel resets the slider and aborts; Continue proceeds with the normal sign and broadcast. The ability to send a zero amount is preserved, the user is just asked to confirm.
Implementation:
SendScene2.tsxhandleSliderComplete: before signing/broadcasting, ifisEvmWallet(coreWallet)and every spend target amount is zero, show aButtonsModalconfirmation and bail on cancel.isEvmWallethelper (walletConnectV2ChainId.namespace === 'eip155'), so it covers EVM coin and token sends. Non-EVM chains already disable the slider for zero amounts and are unaffected.en_US.tsstrings for the modal title and message.confirmSliderThumbtestID toSafeSliderso the maestro confirm-slider selector resolves (separate commit).Asana: https://app.asana.com/0/1215088146871429/1206403488324344
Tested on the iOS simulator: drove a zero-amount ETH send from a funded Arbitrum (EVM) wallet to a valid address, slid to confirm, and confirmed the "Send Zero Amount?" warning modal appears before any broadcast. Cancel dismissed the modal and reset the slider with no transaction sent. Screenshots below.
Note
Low Risk
Targeted send-flow UX change on EVM only; cancel path aborts before signing with no change to non-EVM behavior.
Overview
Adds a Send Zero Amount? confirmation when users slide to confirm an EVM send whose spend targets are all zero, because those txs still consume gas while non-EVM chains usually block zero amounts on the slider.
In
SendScene2,handleSliderCompletenow checksisEvmWalletand zeronativeAmounton every target, shows aButtonsModalwith new copy, resets the slider on cancel, and only then continues to sign/broadcast.SafeSlidergetstestID="confirmSliderThumb"for Maestro; snapshots anden_USstrings were updated.Reviewed by Cursor Bugbot for commit 74c96e0. Bugbot is set up for automated code reviews on this repo. Configure here.