fix(transaction-pay-controller): skip EIP-7702 upgrade check for direct mUSD vault deposits#9250
Merged
Merged
Conversation
de6aade to
ba5f886
Compare
OGPoyraz
previously approved these changes
Jun 24, 2026
…ct mUSD vault deposits
ba5f886 to
84d28a3
Compare
OGPoyraz
approved these changes
Jun 24, 2026
runway-github Bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 24, 2026
## Summary Applies the two-level error prefix pattern to `getAmountData` in `amount-data-callback.ts`: - **Outer** (entire `getAmountData` function): `Update Amount Data: ` - **Inner** (around `buildMoneyAccountDepositBatch`): `Money Account Deposit: ` A failure during deposit calldata building now surfaces as: ``` Update Amount Data: Money Account Deposit: <original error> ``` This matches the naming convention on the core side (MetaMask/core#9250) and in the `useUpdateTransactionPayAmount` hook, making it immediately clear from the error message that the failure occurred in the amount data callback and specifically in the money account deposit build step. ## Also included - `disableUpgrade: true` added to `useMoneyAccount` deposit and withdrawal `addTransactionBatch` calls (the Money Account is always already upgraded on Monad) - `error-prefix.ts`: `reason` in CALL_EXCEPTION handling made optional to handle ethers errors where `reason` may be `null` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted error-handling and transaction-batch flags for money account flows; no auth or broad architectural changes. > > **Overview** > Improves **mUSD / money account deposit** failures during MM Pay amount updates by wrapping `getAmountData` in a **two-level** `prefixError` pattern (`Update Amount Data:` → `Money Account Deposit:`), so users and support can tell the failure is in the amount-data callback and specifically in deposit calldata building. > > **`prefixError`** now treats ethers **`CALL_EXCEPTION`** `reason` as optional: when `reason` is missing or non-string, messages use `eth_call failed - <method>` instead of falling back to the full verbose ethers string. > > Money account **deposit and withdrawal** `addTransactionBatch` calls set **`disableUpgrade: true`** because the money account is already upgraded on Monad, avoiding unnecessary upgrade logic in the batch pipeline. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 128eb69. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
runway-github Bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 24, 2026
## Summary Applies the two-level error prefix pattern to `getAmountData` in `amount-data-callback.ts`: - **Outer** (entire `getAmountData` function): `Update Amount Data: ` - **Inner** (around `buildMoneyAccountDepositBatch`): `Money Account Deposit: ` A failure during deposit calldata building now surfaces as: ``` Update Amount Data: Money Account Deposit: <original error> ``` This matches the naming convention on the core side (MetaMask/core#9250) and in the `useUpdateTransactionPayAmount` hook, making it immediately clear from the error message that the failure occurred in the amount data callback and specifically in the money account deposit build step. ## Also included - `disableUpgrade: true` added to `useMoneyAccount` deposit and withdrawal `addTransactionBatch` calls (the Money Account is always already upgraded on Monad) - `error-prefix.ts`: `reason` in CALL_EXCEPTION handling made optional to handle ethers errors where `reason` may be `null` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted error-handling and transaction-batch flags for money account flows; no auth or broad architectural changes. > > **Overview** > Improves **mUSD / money account deposit** failures during MM Pay amount updates by wrapping `getAmountData` in a **two-level** `prefixError` pattern (`Update Amount Data:` → `Money Account Deposit:`), so users and support can tell the failure is in the amount-data callback and specifically in deposit calldata building. > > **`prefixError`** now treats ethers **`CALL_EXCEPTION`** `reason` as optional: when `reason` is missing or non-string, messages use `eth_call failed - <method>` instead of falling back to the full verbose ethers string. > > Money account **deposit and withdrawal** `addTransactionBatch` calls set **`disableUpgrade: true`** because the money account is already upgraded on Monad, avoiding unnecessary upgrade logic in the batch pipeline. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 128eb69. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
runway-github Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 24, 2026
…a error prefixes (#32314) ## Summary Applies the two-level error prefix pattern to `getAmountData` in `amount-data-callback.ts`: - **Outer** (entire `getAmountData` function): `Update Amount Data: ` - **Inner** (around `buildMoneyAccountDepositBatch`): `Money Account Deposit: ` A failure during deposit calldata building now surfaces as: ``` Update Amount Data: Money Account Deposit: <original error> ``` This matches the naming convention on the core side (MetaMask/core#9250) and in the `useUpdateTransactionPayAmount` hook, making it immediately clear from the error message that the failure occurred in the amount data callback and specifically in the money account deposit build step. ## Also included - `disableUpgrade: true` added to `useMoneyAccount` deposit and withdrawal `addTransactionBatch` calls (the Money Account is always already upgraded on Monad) - `error-prefix.ts`: `reason` in CALL_EXCEPTION handling made optional to handle ethers errors where `reason` may be `null` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted error-handling and transaction-batch flags for money account flows; no auth or broad architectural changes. > > **Overview** > Improves **mUSD / money account deposit** failures during MM Pay amount updates by wrapping `getAmountData` in a **two-level** `prefixError` pattern (`Update Amount Data:` → `Money Account Deposit:`), so users and support can tell the failure is in the amount-data callback and specifically in deposit calldata building. > > **`prefixError`** now treats ethers **`CALL_EXCEPTION`** `reason` as optional: when `reason` is missing or non-string, messages use `eth_call failed - <method>` instead of falling back to the full verbose ethers string. > > Money account **deposit and withdrawal** `addTransactionBatch` calls set **`disableUpgrade: true`** because the money account is already upgraded on Monad, avoiding unnecessary upgrade logic in the batch pipeline. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 128eb69. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
pull Bot
pushed a commit
to Dustin4444/metamask-mobile
that referenced
this pull request
Jun 24, 2026
…32314) ## Summary Applies the two-level error prefix pattern to `getAmountData` in `amount-data-callback.ts`: - **Outer** (entire `getAmountData` function): `Update Amount Data: ` - **Inner** (around `buildMoneyAccountDepositBatch`): `Money Account Deposit: ` A failure during deposit calldata building now surfaces as: ``` Update Amount Data: Money Account Deposit: <original error> ``` This matches the naming convention on the core side (MetaMask/core#9250) and in the `useUpdateTransactionPayAmount` hook, making it immediately clear from the error message that the failure occurred in the amount data callback and specifically in the money account deposit build step. ## Also included - `disableUpgrade: true` added to `useMoneyAccount` deposit and withdrawal `addTransactionBatch` calls (the Money Account is always already upgraded on Monad) - `error-prefix.ts`: `reason` in CALL_EXCEPTION handling made optional to handle ethers errors where `reason` may be `null` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Targeted error-handling and transaction-batch flags for money account flows; no auth or broad architectural changes. > > **Overview** > Improves **mUSD / money account deposit** failures during MM Pay amount updates by wrapping `getAmountData` in a **two-level** `prefixError` pattern (`Update Amount Data:` → `Money Account Deposit:`), so users and support can tell the failure is in the amount-data callback and specifically in deposit calldata building. > > **`prefixError`** now treats ethers **`CALL_EXCEPTION`** `reason` as optional: when `reason` is missing or non-string, messages use `eth_call failed - <method>` instead of falling back to the full verbose ethers string. > > Money account **deposit and withdrawal** `addTransactionBatch` calls set **`disableUpgrade: true`** because the money account is already upgraded on Monad, avoiding unnecessary upgrade logic in the batch pipeline. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 128eb69. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
Adds
disableUpgrade: trueto theaddTransactionBatchcall in the direct mUSD Money Account vault deposit path.The Money Account is always already upgraded to EIP-7702 on Monad, so the upgrade check (
isAccountUpgradedToEIP7702) is unnecessary and adds latency. This skips it entirely.Also updates the test assertion to explicitly verify
disableHook: true,disableSequential: true, anddisableUpgrade: trueare passed to the batch.Related
Builds on top of #9240 (
disableHook: true,disableSequential: true,finallyblock forend()).Note
Low Risk
Narrow change to batch submission flags on a fiat path that already assumes a pre-upgraded Money Account; wrong assumption would only affect this deposit flow.
Overview
Direct mUSD Money Account vault deposits now pass
disableUpgrade: trueonTransactionController:addTransactionBatch, alongside the existingdisableHookanddisableSequentialflags. That skips the redundant EIP-7702 upgrade probe (isAccountUpgradedToEIP7702) because the Money Account is already upgraded on Monad.The direct mUSD vault test now asserts all three batch options explicitly, and the changelog records the fix under Fixed.
Reviewed by Cursor Bugbot for commit 84d28a3. Bugbot is set up for automated code reviews on this repo. Configure here.