fix(transaction-pay-controller): account override fixes#8724
Merged
Conversation
…iquid gating - Deliver the Relay-acquired token to transaction.txParams.from (the delegator that executes the inner delegation), not request.from. When accountOverride causes the two to differ, the previous behaviour funded the override while the inner transferFrom(msg.sender, ...) pulled from the delegator, reverting with 'ERC20: transfer amount exceeds balance'. - Gate the Arbitrum-USDC -> Hypercore quote rewrite on transaction.type === TransactionType.perpsDeposit. Without the gate, every Arbitrum-USDC quote was silently rewritten to a direct Hypercore deposit, which is only valid for Perps and breaks Money Account deposits and any other flow targeting Arbitrum USDC.
…com/MetaMask/core into poc/pay-money-account-deposit-fixes
matthewwalsh0
commented
May 7, 2026
jpuri
approved these changes
May 8, 2026
OGPoyraz
approved these changes
May 8, 2026
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.
Summary
Fixes in
transaction-pay-controller's Relay strategy that together unblock Money Account deposits via MetaMask Pay (and any other delegation-based deposit flow targeting Arbitrum USDC).transaction.txParams.from, notrequest.fromperpsDepositRef: https://consensyssoftware.atlassian.net/browse/CONF-1324
Note
Medium Risk
Adjusts Relay quote transaction construction and chain/token rewrite behavior for Arbitrum USDC deposits; mistakes here could misroute funds or produce incorrect quotes for delegation-based flows.
Overview
Fixes Relay quoting for delegation-based flows when
accountOverridecausesrequest.fromto differ from the executing delegator.Relay now funds the delegator address (
transaction.txParams.from) when building the initial token-transfer leg (falling back torequest.fromif unset), and the Arbitrum-USDC → Hypercore (Hyperliquid) quote rewrite is now only applied forTransactionType.perpsDeposit(not for other transaction types or post-quote flows). Tests and the changelog are updated to cover these cases.Reviewed by Cursor Bugbot for commit 882ea79. Bugbot is set up for automated code reviews on this repo. Configure here.