feat: allow sending to token contract as user acknowledges warning.#27416
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #27416 +/- ##
==========================================
- Coverage 81.97% 81.96% -0.01%
==========================================
Files 4699 4701 +2
Lines 122881 122920 +39
Branches 27126 27133 +7
==========================================
+ Hits 100737 100757 +20
- Misses 15167 15186 +19
Partials 6977 6977 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These files directly impact the transaction confirmation UI and validation logic for send flows (native token, ERC-20, contract interactions). This falls squarely under the SmokeConfirmations scope, which validates transaction sending, signature flows, smart contract interactions, and confirmation UI behavior. There are no changes to controllers, Engine initialization, network management, trade flows, identity, snaps, or multi-chain session APIs. Therefore, other tags (e.g., SmokeTrade, SmokeNetworkExpansion, SmokeIdentity, SmokeWalletPlatform) are not required. Given that confirmation logic is a critical user path and shared across many transaction types, this represents medium risk and should be validated via SmokeConfirmations E2E coverage. Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Allow user to send to contract address, but add warning for that on both send and confirmation page.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6962
Manual testing steps
Screenshots/Recordings
Screen.Recording.2026-03-12.at.4.59.07.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes recipient validation and submission gating so some address errors become acknowledgeable, which can affect when transactions are allowed to proceed. Also adds a new confirmation alert source and metrics mapping; incorrect classification could lead to missed warnings or unintended sends.
Overview
Users can now proceed when the recipient is detected as a token/smart-contract address by acknowledging a new
SendAlertModal, instead of being hard-blocked at the recipient step.This introduces an acknowledgeable validation state (
toAddressErrorAllowAcknowledge) fromuseToAddressValidation/validateHexAddress, adds a new confirmation-page warning viauseTokenContractAlert(AlertKeys.TokenContractAddress), and wires the new alert key into confirmation alert metrics/name resolution. Tests and i18n strings were updated/added to cover the modal flow and the new alert behavior.Written by Cursor Bugbot for commit fa22e95. This will update automatically on new commits. Configure here.