Skip to content

fix(transaction-pay-controller): skip EIP-7702 upgrade check for direct mUSD vault deposits#9250

Merged
matthewwalsh0 merged 1 commit into
mainfrom
fix/musd-error-prefixes
Jun 24, 2026
Merged

fix(transaction-pay-controller): skip EIP-7702 upgrade check for direct mUSD vault deposits#9250
matthewwalsh0 merged 1 commit into
mainfrom
fix/musd-error-prefixes

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Adds disableUpgrade: true to the addTransactionBatch call 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, and disableUpgrade: true are passed to the batch.

Related

Builds on top of #9240 (disableHook: true, disableSequential: true, finally block for end()).


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: true on TransactionController:addTransactionBatch, alongside the existing disableHook and disableSequential flags. 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.

@matthewwalsh0 matthewwalsh0 force-pushed the fix/musd-error-prefixes branch from de6aade to ba5f886 Compare June 24, 2026 11:15
@matthewwalsh0 matthewwalsh0 changed the title fix: rename mUSD fiat error prefixes to Update Amount Data and Money Account Deposit fix(transaction-pay-controller): skip EIP-7702 upgrade check for direct mUSD vault deposits Jun 24, 2026
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review June 24, 2026 11:21
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners June 24, 2026 11:21
@matthewwalsh0 matthewwalsh0 requested a review from OGPoyraz June 24, 2026 11:32
OGPoyraz
OGPoyraz previously approved these changes Jun 24, 2026
@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 4c7c626 Jun 24, 2026
396 checks passed
@matthewwalsh0 matthewwalsh0 deleted the fix/musd-error-prefixes branch June 24, 2026 12:16
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants