feat(confirmations): block hardware wallets for money account deposits#32952
feat(confirmations): block hardware wallets for money account deposits#32952dan437 wants to merge 6 commits into
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
…-hardware-wallet-alert
…-hardware-wallet-alert
- gate useMMPayHardwareAccountAlert to MM Pay transaction types - check accountOverride over txParams.from regardless of type, except withdraws where the override is only the recipient - suppress the alert for any fiat payment, not just money account deposits - register the alert in useConfirmationAlerts so hasBlockingAlerts and BlockingAlertMessage pick it up without manual merges
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.
Reviewed by Cursor Bugbot for commit b62ffaf. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes affect the confirmation UI alert system for MetaMask Pay transactions involving hardware wallets, mUSD conversions, and fiat payments. SmokeConfirmations is the directly relevant tag as it covers transaction confirmation UI, smart contract interactions, token approvals, and transaction sending flows. No other feature areas (swaps, staking, browser, snaps, etc.) are impacted by these changes. Performance Test Selection: |
|




Description
Money Account deposits require an EIP-7702 upgrade on the paying account, which hardware wallets don't support. The existing "Wallet not supported" blocking alert never fired for these deposits, so hardware wallet users hit confusing downstream errors (e.g. fee alerts) instead of a clear message.
Root cause: Money Account deposits are submitted with
txParams.fromset to the money account itself. The account that actually pays lives inTransactionPayControllerasaccountOverride(seeded from the selected account, changeable viaPayAccountSelector).useMMPayHardwareAccountAlertonly checkedtxParams.from, which is never a hardware account.Changes:
useMMPayHardwareAccountAlertnow resolves the paying account asaccountOverride ?? txParams.from, matching howTransactionPayControllerresolves it. Withdraw (post-quote) flows keep usingtxParams.from, because there the override is only the recipient and never signs.PAY_TRANSACTION_TYPES) and registered inuseConfirmationAlerts, so it now flows through the alerts context (hasBlockingAlerts,BlockingAlertMessage). The manual merges incustom-amount-info,musd-max-conversion-info, andusePendingAmountAlertsare removed.Changelog
CHANGELOG entry: Added a blocking alert when a hardware wallet account is selected to pay for a Money Account deposit.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes which accounts trigger blocking alerts across MM Pay confirmation and amount-entry flows; incorrect payer resolution could block or allow the wrong users, though behavior is covered by expanded unit tests.
Overview
Fixes the MM Pay hardware wallet blocking alert so it actually fires for Money Account deposits and other pay flows where the signer is
accountOverride, nottxParams.from.useMMPayHardwareAccountAlertnow resolves the paying account asaccountOverride ?? from, except on pay withdraw flows where override is only the recipient. The alert is limited toPAY_TRANSACTION_TYPES, skipped when a fiat payment method is selected, and still respects the existing mUSD conversion hardware feature-flag / QR wallet rules.The hook is wired into
useConfirmationAlertsso blocking UI flows through the shared alerts context. Manual merges inmusd-max-conversion-infoandusePendingAmountAlertsare removed;useTransactionCustomAmountAlertsstill prioritizes the hardware alert over amount-level messages on the custom amount keyboard.Reviewed by Cursor Bugbot for commit b11dc50. Bugbot is set up for automated code reviews on this repo. Configure here.