Skip to content

feat: [MUSD-445] add build delegations step to money upgrade#8621

Merged
Jwhiles merged 18 commits into
mainfrom
musd-445
May 12, 2026
Merged

feat: [MUSD-445] add build delegations step to money upgrade#8621
Jwhiles merged 18 commits into
mainfrom
musd-445

Conversation

@Jwhiles

@Jwhiles Jwhiles commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Explanation

In this PR we

  • Add the remaining steps required for the upgrade process
  • Update the chomp service so it does not retry 409 errors - since those indicate an error that isn't going to go away with a retry.

This has been tested in the mobile client - and it currently reaches the final step of the upgrade process where we POST https://chomp.dev-api.cx.metamask.io/v1/intent - this currently returns a 500 error after a long delay. We're still investigating the cause of this, as there may be changes required to chomp.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Introduces new delegation-signing/storage and intent-registration steps plus breaking init() and messenger-action requirements in MoneyAccountUpgradeController, which affects upgrade orchestration and on-chain/CHOMP interactions. Also changes ChompApiService retry behavior for 4xx responses, which could alter client error handling and backoff characteristics.

Overview
Completes the money account upgrade sequence by adding build-delegation and register-intents steps after EIP-7702 authorization, including delegation creation/signing (via DelegationController), CHOMP verification, persistence to AuthenticatedUserStorageService, and CHOMP intent registration (skipping existing active intents and re-registering revoked ones).

Breaking API/config changes in MoneyAccountUpgradeController: init() now takes { chainId, boringVaultAddress }, resolves Delegation Framework contract/enforcer addresses from @metamask/delegation-deployments (throws if unsupported), and expands required messenger permissions to include storage, delegation signing, and CHOMP intent/delegation APIs.

Retry semantics change in @metamask/chomp-api-service: default retry policy now does not retry most 4xx responses (except 429), while continuing to retry 5xx and non-HTTP errors; tests updated/added to assert the new behavior and allow overriding via policyOptions.

Reviewed by Cursor Bugbot for commit 0cf880a. Bugbot is set up for automated code reviews on this repo. Configure here.

@socket-security

socket-security Bot commented Apr 28, 2026

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Potential code anomaly (AI signal): npm ox is 100.0% likely to have a medium risk anomaly

Notes: This dependency is a worker-based “salt mining”/proof-of-work compute engine that loads an embedded WebAssembly payload and runs a CPU-intensive loop in Node worker_threads or browser Web Workers, communicating progress and results via postMessage. There is no direct evidence in this fragment of network exfiltration, credential access, persistence, or system modification. The main security concerns are (1) dynamic worker code execution (Node worker eval:true and browser Blob URL execution) and (2) cryptomining-like resource consumption that can be abused for CPU exhaustion. The embedded WASM module itself should be reviewed to confirm it contains only the expected computation and no hidden side effects.

Confidence: 1.00

Severity: 0.60

From: ?npm/@myx-trade/sdk@0.1.265npm/ox@0.14.20

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ox@0.14.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm ox is 100.0% likely to have a medium risk anomaly

Notes: This module implements parallel WebAssembly computation using Node worker_threads and browser Web Workers, including dynamic worker script execution (Node eval:true and browser Blob URL). It communicates only via postMessage and does not show network exfiltration, credential theft, or persistence within this snippet. The main risks are supply-chain/execution boundary concerns from dynamic worker code and potential CPU/DoS impact if the mining parameters are attacker-influenced. Overall: likely intended for compute work, but should be reviewed and guarded with strict input controls and hardened worker creation.

Confidence: 1.00

Severity: 0.60

From: ?npm/@myx-trade/sdk@0.1.265npm/ox@0.14.20

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ox@0.14.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm ox is 100.0% likely to have a medium risk anomaly

Notes: This dependency is a cross-platform worker harness that executes embedded WebAssembly to perform a “salt mining” computation and returns progress/results to the caller via message passing. In this file, there is no clear evidence of classic malware behaviors such as network exfiltration, credential theft, or filesystem/system sabotage. The most notable supply-chain/security concerns are dynamic code execution patterns (Node Worker with eval:true and browser Blob URL worker scripts) and the potential for CPU-intensive abuse (computational mining-like workload) if invoked in an unauthorized context or with adversarial parameters. Overall: moderate security risk driven by execution surface and availability impact rather than direct data-stealing.

Confidence: 1.00

Severity: 0.60

From: ?npm/@myx-trade/sdk@0.1.265npm/ox@0.14.20

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ox@0.14.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm ox is 100.0% likely to have a medium risk anomaly

Notes: This fragment is primarily a CPU-intensive proof-of-work/salt-mining implementation using worker-thread parallelism plus an async fallback. It includes input validation, structured error propagation, and abort handling, and it does not show classic malware behaviors (no network/file/process/persistence or dynamic execution in the snippet). The dominant security concern is potential resource-exhaustion/DoS if untrusted callers can control workerCount/count/chunkSize, and secondary concern is leakage of progress/rate metrics into application callbacks/logging. Overall: likely intended PoW functionality but potentially abuse-prone in the wrong threat model.

Confidence: 1.00

Severity: 0.60

From: ?npm/@myx-trade/sdk@0.1.265npm/ox@0.14.20

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ox@0.14.20. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm viem is 100.0% likely to have a medium risk anomaly

Notes: The code implements a cross-chain deposit flow with proper validations, artifact reads, and on-chain interactions. There is no evidence of hidden backdoors, data exfiltration, or malware. The main security considerations relate to token approval logic and correct configuration of flags to avoid granting excessive allowances. Overall, the module appears legitimate for a bridge deposit flow, with moderate risk primarily around configuration of approvals and correct handling of gas/fees.

Confidence: 1.00

Severity: 0.60

From: ?npm/@myx-trade/sdk@0.1.265npm/viem@2.48.4

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/viem@2.48.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

const MAX_UINT256 =
'115792089237316195423570985008687907853269984665640564039457584007913129639935';

// Sourced from https://github.com/MetaMask/snap-cash-account-poc/blob/70709e15ddc56288dd9eefa45b425a756f25d2fb/packages/snap/src/api/config.ts#L39-L40

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this the correct address here - I sourced this from the POC - but it might be that this value should also come from the chomp service details endpoint

@Jwhiles Jwhiles force-pushed the musd-445 branch 3 times, most recently from 33e853a to 16087d2 Compare May 5, 2026 11:05
to: delegateAddress,
caveats: [
{ type: 'redeemer', redeemers: [vedaVaultAdapterAddress] },
{ type: 'valueLte', maxValue: 0n },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you are using scope then valueLte will automatically be added to the delegation. No need to specify it here.

But maybe a better way would be to not use @metamask/smart-accounts-kit which is a bit bigger package but use @metamask/delegation-core to construct the delegation. Its should still be simple enough but will have much less dependencies then SAK.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here is an example of using delegation core: https://github.com/MetaMask/metamask-extension/pull/41809/changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/money-account-upgrade-controller/src/steps/step.ts
);
}

return 'completed';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to also store the delegation then into user authenticated storate + send it to chomp API and intent (delegation hash and some metadata). Not sure if that is means as part of another step.

@Jwhiles Jwhiles changed the title feat: add build delegations step to money upgrade feat: [MUSD-445] add build delegations step to money upgrade May 6, 2026
@Jwhiles Jwhiles force-pushed the musd-445 branch 3 times, most recently from 55a57a7 to c4c6220 Compare May 8, 2026 16:08
@Jwhiles

Jwhiles commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@Jwhiles

Jwhiles commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.3.0-preview-2fdaa18
@metamask-previews/accounts-controller@38.0.0-preview-2fdaa18
@metamask-previews/address-book-controller@7.1.1-preview-2fdaa18
@metamask-previews/ai-controllers@0.6.3-preview-2fdaa18
@metamask-previews/analytics-controller@1.0.1-preview-2fdaa18
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-2fdaa18
@metamask-previews/announcement-controller@8.1.0-preview-2fdaa18
@metamask-previews/app-metadata-controller@2.0.1-preview-2fdaa18
@metamask-previews/approval-controller@9.0.1-preview-2fdaa18
@metamask-previews/assets-controller@7.0.0-preview-2fdaa18
@metamask-previews/assets-controllers@106.0.0-preview-2fdaa18
@metamask-previews/authenticated-user-storage@1.0.0-preview-2fdaa18
@metamask-previews/base-controller@9.1.0-preview-2fdaa18
@metamask-previews/base-data-service@0.1.1-preview-2fdaa18
@metamask-previews/bridge-controller@72.0.1-preview-2fdaa18
@metamask-previews/bridge-status-controller@71.1.1-preview-2fdaa18
@metamask-previews/build-utils@3.0.4-preview-2fdaa18
@metamask-previews/chain-agnostic-permission@1.6.0-preview-2fdaa18
@metamask-previews/chomp-api-service@3.0.0-preview-2fdaa18
@metamask-previews/claims-controller@0.5.0-preview-2fdaa18
@metamask-previews/client-controller@1.0.1-preview-2fdaa18
@metamask-previews/compliance-controller@2.0.0-preview-2fdaa18
@metamask-previews/composable-controller@12.0.1-preview-2fdaa18
@metamask-previews/config-registry-controller@0.3.0-preview-2fdaa18
@metamask-previews/connectivity-controller@0.2.0-preview-2fdaa18
@metamask-previews/controller-utils@11.20.0-preview-2fdaa18
@metamask-previews/core-backend@6.2.1-preview-2fdaa18
@metamask-previews/delegation-controller@3.0.0-preview-2fdaa18
@metamask-previews/earn-controller@12.1.0-preview-2fdaa18
@metamask-previews/eip-5792-middleware@3.0.3-preview-2fdaa18
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-2fdaa18
@metamask-previews/eip1193-permission-middleware@2.0.0-preview-2fdaa18
@metamask-previews/ens-controller@19.1.1-preview-2fdaa18
@metamask-previews/eth-block-tracker@15.0.1-preview-2fdaa18
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-2fdaa18
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-2fdaa18
@metamask-previews/foundryup@1.0.1-preview-2fdaa18
@metamask-previews/gas-fee-controller@26.2.0-preview-2fdaa18
@metamask-previews/gator-permissions-controller@4.1.0-preview-2fdaa18
@metamask-previews/geolocation-controller@0.1.2-preview-2fdaa18
@metamask-previews/json-rpc-engine@10.5.0-preview-2fdaa18
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-2fdaa18
@metamask-previews/keyring-controller@25.5.0-preview-2fdaa18
@metamask-previews/logging-controller@8.0.1-preview-2fdaa18
@metamask-previews/message-manager@14.1.1-preview-2fdaa18
@metamask-previews/messenger@1.2.0-preview-2fdaa18
@metamask-previews/messenger-cli@0.2.0-preview-2fdaa18
@metamask-previews/money-account-balance-service@1.0.0-preview-2fdaa18
@metamask-previews/money-account-controller@0.3.0-preview-2fdaa18
@metamask-previews/money-account-upgrade-controller@1.3.1-preview-2fdaa18
@metamask-previews/multichain-account-service@9.0.0-preview-2fdaa18
@metamask-previews/multichain-api-middleware@3.1.0-preview-2fdaa18
@metamask-previews/multichain-network-controller@3.1.0-preview-2fdaa18
@metamask-previews/multichain-transactions-controller@7.1.0-preview-2fdaa18
@metamask-previews/name-controller@9.1.1-preview-2fdaa18
@metamask-previews/network-controller@30.1.0-preview-2fdaa18
@metamask-previews/network-enablement-controller@5.1.0-preview-2fdaa18
@metamask-previews/notification-services-controller@23.1.0-preview-2fdaa18
@metamask-previews/passkey-controller@2.0.1-preview-2fdaa18
@metamask-previews/permission-controller@13.1.0-preview-2fdaa18
@metamask-previews/permission-log-controller@5.1.0-preview-2fdaa18
@metamask-previews/perps-controller@6.0.0-preview-2fdaa18
@metamask-previews/phishing-controller@17.1.1-preview-2fdaa18
@metamask-previews/polling-controller@16.0.4-preview-2fdaa18
@metamask-previews/preferences-controller@23.1.0-preview-2fdaa18
@metamask-previews/profile-metrics-controller@3.1.3-preview-2fdaa18
@metamask-previews/profile-sync-controller@28.0.2-preview-2fdaa18
@metamask-previews/ramps-controller@13.3.0-preview-2fdaa18
@metamask-previews/rate-limit-controller@7.0.1-preview-2fdaa18
@metamask-previews/react-data-query@0.2.0-preview-2fdaa18
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-2fdaa18
@metamask-previews/sample-controllers@4.0.4-preview-2fdaa18
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-2fdaa18
@metamask-previews/selected-network-controller@26.1.1-preview-2fdaa18
@metamask-previews/shield-controller@5.1.1-preview-2fdaa18
@metamask-previews/signature-controller@39.2.0-preview-2fdaa18
@metamask-previews/snap-account-service@0.0.0-preview-2fdaa18
@metamask-previews/social-controllers@2.2.0-preview-2fdaa18
@metamask-previews/storage-service@1.0.1-preview-2fdaa18
@metamask-previews/subscription-controller@6.1.2-preview-2fdaa18
@metamask-previews/transaction-controller@65.2.0-preview-2fdaa18
@metamask-previews/transaction-pay-controller@22.1.0-preview-2fdaa18
@metamask-previews/user-operation-controller@41.2.0-preview-2fdaa18

@Jwhiles

Jwhiles commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.3.0-preview-cce45fbde
@metamask-previews/accounts-controller@38.0.0-preview-cce45fbde
@metamask-previews/address-book-controller@7.1.1-preview-cce45fbde
@metamask-previews/ai-controllers@0.6.3-preview-cce45fbde
@metamask-previews/analytics-controller@1.0.1-preview-cce45fbde
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-cce45fbde
@metamask-previews/announcement-controller@8.1.0-preview-cce45fbde
@metamask-previews/app-metadata-controller@2.0.1-preview-cce45fbde
@metamask-previews/approval-controller@9.0.1-preview-cce45fbde
@metamask-previews/assets-controller@7.0.0-preview-cce45fbde
@metamask-previews/assets-controllers@106.0.0-preview-cce45fbde
@metamask-previews/authenticated-user-storage@1.0.0-preview-cce45fbde
@metamask-previews/base-controller@9.1.0-preview-cce45fbde
@metamask-previews/base-data-service@0.1.1-preview-cce45fbde
@metamask-previews/bridge-controller@72.0.1-preview-cce45fbde
@metamask-previews/bridge-status-controller@71.1.1-preview-cce45fbde
@metamask-previews/build-utils@3.0.4-preview-cce45fbde
@metamask-previews/chain-agnostic-permission@1.6.0-preview-cce45fbde
@metamask-previews/chomp-api-service@3.0.0-preview-cce45fbde
@metamask-previews/claims-controller@0.5.0-preview-cce45fbde
@metamask-previews/client-controller@1.0.1-preview-cce45fbde
@metamask-previews/compliance-controller@2.0.0-preview-cce45fbde
@metamask-previews/composable-controller@12.0.1-preview-cce45fbde
@metamask-previews/config-registry-controller@0.3.0-preview-cce45fbde
@metamask-previews/connectivity-controller@0.2.0-preview-cce45fbde
@metamask-previews/controller-utils@11.20.0-preview-cce45fbde
@metamask-previews/core-backend@6.2.1-preview-cce45fbde
@metamask-previews/delegation-controller@3.0.0-preview-cce45fbde
@metamask-previews/earn-controller@12.1.0-preview-cce45fbde
@metamask-previews/eip-5792-middleware@3.0.3-preview-cce45fbde
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-cce45fbde
@metamask-previews/eip1193-permission-middleware@2.0.0-preview-cce45fbde
@metamask-previews/ens-controller@19.1.1-preview-cce45fbde
@metamask-previews/eth-block-tracker@15.0.1-preview-cce45fbde
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-cce45fbde
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-cce45fbde
@metamask-previews/foundryup@1.0.1-preview-cce45fbde
@metamask-previews/gas-fee-controller@26.2.0-preview-cce45fbde
@metamask-previews/gator-permissions-controller@4.1.0-preview-cce45fbde
@metamask-previews/geolocation-controller@0.1.2-preview-cce45fbde
@metamask-previews/json-rpc-engine@10.5.0-preview-cce45fbde
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-cce45fbde
@metamask-previews/keyring-controller@25.5.0-preview-cce45fbde
@metamask-previews/logging-controller@8.0.1-preview-cce45fbde
@metamask-previews/message-manager@14.1.1-preview-cce45fbde
@metamask-previews/messenger@1.2.0-preview-cce45fbde
@metamask-previews/messenger-cli@0.2.0-preview-cce45fbde
@metamask-previews/money-account-balance-service@1.0.0-preview-cce45fbde
@metamask-previews/money-account-controller@0.3.0-preview-cce45fbde
@metamask-previews/money-account-upgrade-controller@1.3.1-preview-cce45fbde
@metamask-previews/multichain-account-service@9.0.0-preview-cce45fbde
@metamask-previews/multichain-api-middleware@3.1.0-preview-cce45fbde
@metamask-previews/multichain-network-controller@3.1.0-preview-cce45fbde
@metamask-previews/multichain-transactions-controller@7.1.0-preview-cce45fbde
@metamask-previews/name-controller@9.1.1-preview-cce45fbde
@metamask-previews/network-controller@30.1.0-preview-cce45fbde
@metamask-previews/network-enablement-controller@5.1.0-preview-cce45fbde
@metamask-previews/notification-services-controller@23.1.0-preview-cce45fbde
@metamask-previews/passkey-controller@2.0.1-preview-cce45fbde
@metamask-previews/permission-controller@13.1.0-preview-cce45fbde
@metamask-previews/permission-log-controller@5.1.0-preview-cce45fbde
@metamask-previews/perps-controller@6.0.0-preview-cce45fbde
@metamask-previews/phishing-controller@17.1.1-preview-cce45fbde
@metamask-previews/polling-controller@16.0.4-preview-cce45fbde
@metamask-previews/preferences-controller@23.1.0-preview-cce45fbde
@metamask-previews/profile-metrics-controller@3.1.3-preview-cce45fbde
@metamask-previews/profile-sync-controller@28.0.2-preview-cce45fbde
@metamask-previews/ramps-controller@13.3.0-preview-cce45fbde
@metamask-previews/rate-limit-controller@7.0.1-preview-cce45fbde
@metamask-previews/react-data-query@0.2.0-preview-cce45fbde
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-cce45fbde
@metamask-previews/sample-controllers@4.0.4-preview-cce45fbde
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-cce45fbde
@metamask-previews/selected-network-controller@26.1.1-preview-cce45fbde
@metamask-previews/shield-controller@5.1.1-preview-cce45fbde
@metamask-previews/signature-controller@39.2.0-preview-cce45fbde
@metamask-previews/snap-account-service@0.0.0-preview-cce45fbde
@metamask-previews/social-controllers@2.2.0-preview-cce45fbde
@metamask-previews/storage-service@1.0.1-preview-cce45fbde
@metamask-previews/subscription-controller@6.1.2-preview-cce45fbde
@metamask-previews/transaction-controller@65.2.0-preview-cce45fbde
@metamask-previews/transaction-pay-controller@22.1.0-preview-cce45fbde
@metamask-previews/user-operation-controller@41.2.0-preview-cce45fbde

@Jwhiles Jwhiles marked this pull request as ready for review May 11, 2026 19:38
@Jwhiles Jwhiles requested review from a team as code owners May 11, 2026 19:38
@Jwhiles Jwhiles temporarily deployed to default-branch May 11, 2026 19:38 — with GitHub Actions Inactive

- **BREAKING:** The controller messenger now requires access to six additional allowed actions: `AuthenticatedUserStorageService:listDelegations`, `AuthenticatedUserStorageService:createDelegation`, `ChompApiService:verifyDelegation`, `ChompApiService:getIntentsByAddress`, `ChompApiService:createIntents`, and `DelegationController:signDelegation`. Delegation signing is now delegated to `@metamask/delegation-controller` rather than calling `KeyringController:signTypedMessage` directly; consumers must instantiate `DelegationController` and update their messenger configuration accordingly. ([#8621](https://github.com/MetaMask/core/pull/8621))
- **BREAKING:** `init()` now takes a `{ chainId, boringVaultAddress }` object instead of an `InitConfig`. The EIP-7702 delegator implementation and caveat enforcer addresses are resolved from `@metamask/delegation-deployments` for the target chain; `init()` throws if the chain is not supported by Delegation Framework 1.3.0. The `InitConfig` type is no longer exported. ([#8621](https://github.com/MetaMask/core/pull/8621))
- **BREAKING:** `UpgradeConfig` no longer includes `musdTokenAddress` (now derived internally from the Veda protocol service details). ([#8621](https://github.com/MetaMask/core/pull/8621))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UpgradeConfig still has mUSD?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was leftover from an earlier iteration - will clear up the changelog.

@Jwhiles

Jwhiles commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

Comment thread packages/money-account-upgrade-controller/src/steps/register-intents.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.3.0-preview-7fbc8b83e
@metamask-previews/accounts-controller@38.1.0-preview-7fbc8b83e
@metamask-previews/address-book-controller@7.1.2-preview-7fbc8b83e
@metamask-previews/ai-controllers@0.6.3-preview-7fbc8b83e
@metamask-previews/analytics-controller@1.0.1-preview-7fbc8b83e
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-7fbc8b83e
@metamask-previews/announcement-controller@8.1.0-preview-7fbc8b83e
@metamask-previews/app-metadata-controller@2.0.1-preview-7fbc8b83e
@metamask-previews/approval-controller@9.0.1-preview-7fbc8b83e
@metamask-previews/assets-controller@7.0.1-preview-7fbc8b83e
@metamask-previews/assets-controllers@106.0.1-preview-7fbc8b83e
@metamask-previews/authenticated-user-storage@1.0.1-preview-7fbc8b83e
@metamask-previews/base-controller@9.1.0-preview-7fbc8b83e
@metamask-previews/base-data-service@0.1.2-preview-7fbc8b83e
@metamask-previews/bridge-controller@72.0.2-preview-7fbc8b83e
@metamask-previews/bridge-status-controller@71.1.2-preview-7fbc8b83e
@metamask-previews/build-utils@3.0.4-preview-7fbc8b83e
@metamask-previews/chain-agnostic-permission@1.6.1-preview-7fbc8b83e
@metamask-previews/chomp-api-service@3.0.1-preview-7fbc8b83e
@metamask-previews/claims-controller@0.5.1-preview-7fbc8b83e
@metamask-previews/client-controller@1.0.1-preview-7fbc8b83e
@metamask-previews/compliance-controller@2.0.1-preview-7fbc8b83e
@metamask-previews/composable-controller@12.0.1-preview-7fbc8b83e
@metamask-previews/config-registry-controller@0.3.1-preview-7fbc8b83e
@metamask-previews/connectivity-controller@0.2.0-preview-7fbc8b83e
@metamask-previews/controller-utils@12.0.0-preview-7fbc8b83e
@metamask-previews/core-backend@6.2.2-preview-7fbc8b83e
@metamask-previews/delegation-controller@3.0.0-preview-7fbc8b83e
@metamask-previews/earn-controller@12.1.1-preview-7fbc8b83e
@metamask-previews/eip-5792-middleware@3.0.3-preview-7fbc8b83e
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-7fbc8b83e
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-7fbc8b83e
@metamask-previews/ens-controller@19.1.2-preview-7fbc8b83e
@metamask-previews/eth-block-tracker@15.0.1-preview-7fbc8b83e
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-7fbc8b83e
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-7fbc8b83e
@metamask-previews/foundryup@1.0.1-preview-7fbc8b83e
@metamask-previews/gas-fee-controller@26.2.1-preview-7fbc8b83e
@metamask-previews/gator-permissions-controller@4.1.1-preview-7fbc8b83e
@metamask-previews/geolocation-controller@0.1.3-preview-7fbc8b83e
@metamask-previews/json-rpc-engine@10.5.0-preview-7fbc8b83e
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-7fbc8b83e
@metamask-previews/keyring-controller@25.5.0-preview-7fbc8b83e
@metamask-previews/logging-controller@8.0.2-preview-7fbc8b83e
@metamask-previews/message-manager@14.1.2-preview-7fbc8b83e
@metamask-previews/messenger@1.2.0-preview-7fbc8b83e
@metamask-previews/messenger-cli@0.2.0-preview-7fbc8b83e
@metamask-previews/money-account-balance-service@1.0.1-preview-7fbc8b83e
@metamask-previews/money-account-controller@0.3.0-preview-7fbc8b83e
@metamask-previews/money-account-upgrade-controller@1.3.2-preview-7fbc8b83e
@metamask-previews/multichain-account-service@9.0.0-preview-7fbc8b83e
@metamask-previews/multichain-api-middleware@3.1.1-preview-7fbc8b83e
@metamask-previews/multichain-network-controller@3.1.1-preview-7fbc8b83e
@metamask-previews/multichain-transactions-controller@7.1.0-preview-7fbc8b83e
@metamask-previews/name-controller@9.1.2-preview-7fbc8b83e
@metamask-previews/network-controller@31.1.0-preview-7fbc8b83e
@metamask-previews/network-enablement-controller@5.1.1-preview-7fbc8b83e
@metamask-previews/notification-services-controller@23.1.1-preview-7fbc8b83e
@metamask-previews/passkey-controller@2.0.1-preview-7fbc8b83e
@metamask-previews/permission-controller@13.1.1-preview-7fbc8b83e
@metamask-previews/permission-log-controller@5.1.0-preview-7fbc8b83e
@metamask-previews/perps-controller@6.0.1-preview-7fbc8b83e
@metamask-previews/phishing-controller@17.1.2-preview-7fbc8b83e
@metamask-previews/polling-controller@16.0.5-preview-7fbc8b83e
@metamask-previews/preferences-controller@23.1.0-preview-7fbc8b83e
@metamask-previews/profile-metrics-controller@3.1.4-preview-7fbc8b83e
@metamask-previews/profile-sync-controller@28.0.2-preview-7fbc8b83e
@metamask-previews/ramps-controller@13.3.1-preview-7fbc8b83e
@metamask-previews/rate-limit-controller@7.0.1-preview-7fbc8b83e
@metamask-previews/react-data-query@0.2.0-preview-7fbc8b83e
@metamask-previews/remote-feature-flag-controller@4.2.1-preview-7fbc8b83e
@metamask-previews/sample-controllers@5.0.0-preview-7fbc8b83e
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-7fbc8b83e
@metamask-previews/selected-network-controller@26.1.2-preview-7fbc8b83e
@metamask-previews/shield-controller@5.1.2-preview-7fbc8b83e
@metamask-previews/signature-controller@39.2.1-preview-7fbc8b83e
@metamask-previews/snap-account-service@0.0.0-preview-7fbc8b83e
@metamask-previews/social-controllers@2.2.1-preview-7fbc8b83e
@metamask-previews/storage-service@1.0.1-preview-7fbc8b83e
@metamask-previews/subscription-controller@6.1.3-preview-7fbc8b83e
@metamask-previews/transaction-controller@65.3.0-preview-7fbc8b83e
@metamask-previews/transaction-pay-controller@22.2.0-preview-7fbc8b83e
@metamask-previews/user-operation-controller@41.2.1-preview-7fbc8b83e

@Jwhiles

Jwhiles commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.3.0-preview-ede62c6c7
@metamask-previews/accounts-controller@38.1.0-preview-ede62c6c7
@metamask-previews/address-book-controller@7.1.2-preview-ede62c6c7
@metamask-previews/ai-controllers@0.6.3-preview-ede62c6c7
@metamask-previews/analytics-controller@1.0.1-preview-ede62c6c7
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-ede62c6c7
@metamask-previews/announcement-controller@8.1.0-preview-ede62c6c7
@metamask-previews/app-metadata-controller@2.0.1-preview-ede62c6c7
@metamask-previews/approval-controller@9.0.1-preview-ede62c6c7
@metamask-previews/assets-controller@7.0.1-preview-ede62c6c7
@metamask-previews/assets-controllers@106.0.1-preview-ede62c6c7
@metamask-previews/authenticated-user-storage@1.0.1-preview-ede62c6c7
@metamask-previews/base-controller@9.1.0-preview-ede62c6c7
@metamask-previews/base-data-service@0.1.2-preview-ede62c6c7
@metamask-previews/bridge-controller@72.0.2-preview-ede62c6c7
@metamask-previews/bridge-status-controller@71.1.2-preview-ede62c6c7
@metamask-previews/build-utils@3.0.4-preview-ede62c6c7
@metamask-previews/chain-agnostic-permission@1.6.1-preview-ede62c6c7
@metamask-previews/chomp-api-service@3.0.1-preview-ede62c6c7
@metamask-previews/claims-controller@0.5.1-preview-ede62c6c7
@metamask-previews/client-controller@1.0.1-preview-ede62c6c7
@metamask-previews/compliance-controller@2.0.1-preview-ede62c6c7
@metamask-previews/composable-controller@12.0.1-preview-ede62c6c7
@metamask-previews/config-registry-controller@0.3.1-preview-ede62c6c7
@metamask-previews/connectivity-controller@0.2.0-preview-ede62c6c7
@metamask-previews/controller-utils@12.0.0-preview-ede62c6c7
@metamask-previews/core-backend@6.2.2-preview-ede62c6c7
@metamask-previews/delegation-controller@3.0.0-preview-ede62c6c7
@metamask-previews/earn-controller@12.1.1-preview-ede62c6c7
@metamask-previews/eip-5792-middleware@3.0.3-preview-ede62c6c7
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-ede62c6c7
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-ede62c6c7
@metamask-previews/ens-controller@19.1.2-preview-ede62c6c7
@metamask-previews/eth-block-tracker@15.0.1-preview-ede62c6c7
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-ede62c6c7
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-ede62c6c7
@metamask-previews/foundryup@1.0.1-preview-ede62c6c7
@metamask-previews/gas-fee-controller@26.2.1-preview-ede62c6c7
@metamask-previews/gator-permissions-controller@4.1.1-preview-ede62c6c7
@metamask-previews/geolocation-controller@0.1.3-preview-ede62c6c7
@metamask-previews/json-rpc-engine@10.5.0-preview-ede62c6c7
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-ede62c6c7
@metamask-previews/keyring-controller@25.5.0-preview-ede62c6c7
@metamask-previews/logging-controller@8.0.2-preview-ede62c6c7
@metamask-previews/message-manager@14.1.2-preview-ede62c6c7
@metamask-previews/messenger@1.2.0-preview-ede62c6c7
@metamask-previews/messenger-cli@0.2.0-preview-ede62c6c7
@metamask-previews/money-account-balance-service@1.0.1-preview-ede62c6c7
@metamask-previews/money-account-controller@0.3.0-preview-ede62c6c7
@metamask-previews/money-account-upgrade-controller@1.3.2-preview-ede62c6c7
@metamask-previews/multichain-account-service@9.0.0-preview-ede62c6c7
@metamask-previews/multichain-api-middleware@3.1.1-preview-ede62c6c7
@metamask-previews/multichain-network-controller@3.1.1-preview-ede62c6c7
@metamask-previews/multichain-transactions-controller@7.1.0-preview-ede62c6c7
@metamask-previews/name-controller@9.1.2-preview-ede62c6c7
@metamask-previews/network-controller@31.1.0-preview-ede62c6c7
@metamask-previews/network-enablement-controller@5.1.1-preview-ede62c6c7
@metamask-previews/notification-services-controller@23.1.1-preview-ede62c6c7
@metamask-previews/passkey-controller@2.0.1-preview-ede62c6c7
@metamask-previews/permission-controller@13.1.1-preview-ede62c6c7
@metamask-previews/permission-log-controller@5.1.0-preview-ede62c6c7
@metamask-previews/perps-controller@6.0.1-preview-ede62c6c7
@metamask-previews/phishing-controller@17.1.2-preview-ede62c6c7
@metamask-previews/polling-controller@16.0.5-preview-ede62c6c7
@metamask-previews/preferences-controller@23.1.0-preview-ede62c6c7
@metamask-previews/profile-metrics-controller@3.1.4-preview-ede62c6c7
@metamask-previews/profile-sync-controller@28.0.2-preview-ede62c6c7
@metamask-previews/ramps-controller@13.3.1-preview-ede62c6c7
@metamask-previews/rate-limit-controller@7.0.1-preview-ede62c6c7
@metamask-previews/react-data-query@0.2.0-preview-ede62c6c7
@metamask-previews/remote-feature-flag-controller@4.2.1-preview-ede62c6c7
@metamask-previews/sample-controllers@5.0.0-preview-ede62c6c7
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-ede62c6c7
@metamask-previews/selected-network-controller@26.1.2-preview-ede62c6c7
@metamask-previews/shield-controller@5.1.2-preview-ede62c6c7
@metamask-previews/signature-controller@39.2.1-preview-ede62c6c7
@metamask-previews/snap-account-service@0.0.0-preview-ede62c6c7
@metamask-previews/social-controllers@2.2.1-preview-ede62c6c7
@metamask-previews/storage-service@1.0.1-preview-ede62c6c7
@metamask-previews/subscription-controller@6.1.3-preview-ede62c6c7
@metamask-previews/transaction-controller@65.3.0-preview-ede62c6c7
@metamask-previews/transaction-pay-controller@22.2.0-preview-ede62c6c7
@metamask-previews/user-operation-controller@41.2.1-preview-ede62c6c7

Jwhiles and others added 18 commits May 12, 2026 10:37
Adds a third step to the upgrade sequence that builds, signs, and
submits the auto-deposit delegation that authorises CHOMP's delegate to
move mUSD into the Veda vault on the user's behalf. The step:

- Looks up existing delegations via
  AuthenticatedUserStorageService:listDelegations and skips when one
  matches the configured (delegator, delegate, chain, token).
- Builds a per-call 32-byte salt and constructs the delegation with
  redeemer + valueLte + erc20TransferAmount caveats.
- Signs as EIP-712 V4 typed data via KeyringController:signTypedMessage.
- Submits to ChompApiService:verifyDelegation; throws on rejection.

The `InitConfig` passed to `init()` carries the delegator-impl and
caveat-enforcer addresses; the messenger gains the three new allowed
actions.
…yments

Replaces the @metamask/smart-accounts-kit dependency with the lower-level
@metamask/delegation-core (caveat-term encoders) and
@metamask/delegation-deployments (Delegation Framework contract registry).

- `init()` now takes only a chainId; the EIP-7702 delegator-impl and
  caveat-enforcer addresses are resolved from
  `DELEGATOR_CONTRACTS['1.3.0'][chainId]` rather than being passed in.
  `InitConfig` is no longer exported.
- The build-delegation step builds the three caveats directly with
  delegation-core's `createERC20TransferAmountTerms` /
  `createValueLteTerms` / `createRedeemerTerms`, and constructs the
  EIP-712 typed-data message inline (13 lines).
- Drops a duplicate `valueLteEnforcer` caveat that the smart-accounts-kit
  `erc20TransferAmount` scope helper was inadvertently appending on top
  of the explicit one we passed in.

Net dependency size: ~3 MB → ~650 kB. No behaviour change beyond the
duplicate-caveat fix.
Hands off delegation signing (and DelegationManager address resolution)
to @metamask/delegation-controller, which the wallet client already
wires up globally with a `getDelegationEnvironment` callback.

- Adds `@metamask/delegation-controller` as a dependency.
- Swaps `KeyringController:signTypedMessage` for
  `DelegationController:signDelegation` in the messenger allowlist.
- Drops `delegationManager` from `UpgradeConfig` / `StepContext`; this
  controller no longer needs to know the DelegationManager address —
  DelegationController resolves it.
- Removes the inlined `SIGNABLE_DELEGATION_TYPED_DATA` and salt
  hex→bigint conversion from build-delegations (~25 lines).

The build-delegation step still resolves enforcer + EIP-7702 impl
addresses from `@metamask/delegation-deployments` directly, since those
are statically typed and DelegationController only exposes them via a
string-keyed bag.
The build-delegation step now signs two delegations per upgrade — one
authorising transfers of mUSD (deposit-side) and one authorising
transfers of the Veda boring vault share token vmUSD (withdrawal-side).
Both delegations share delegator, delegate, and redeemer (the Veda
vault adapter); only the ERC20TransferAmount caveat's token differs.

The "already-done" check runs per-token, so re-running the upgrade
after a partial failure only re-signs the missing delegation. Signing
is sequential, deposit before withdrawal, so the user sees one prompt
at a time.

The withdrawal-side token is the Veda boring vault contract address.
This is hardcoded per chain in the controller (mainnet only) until the
CHOMP service-details API exposes it; misconfigured chains throw at
init() time.
After CHOMP verifies a delegation, the build-delegation step now also
calls AuthenticatedUserStorageService:createDelegation so the signed
delegation is stored against the user's profile. Without this the
listDelegations matcher on the next run would never find a stored
record and we'd re-sign on every upgrade attempt.

Order is verify-then-store: if storage fails after CHOMP verification,
nothing is persisted and the next run rebuilds from scratch with a
fresh salt. The inverse (store-then-verify) would risk persisting a
delegation CHOMP later rejects.

Metadata records the per-token symbol (mUSD / vmUSD), the cash-deposit
/ cash-withdrawal intent type, MAX_UINT256 as the allowance, and a
delegationHash derived from @metamask/delegation-core's hashDelegation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jwhiles Jwhiles added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit d82c50d May 12, 2026
366 checks passed
@Jwhiles Jwhiles deleted the musd-445 branch May 12, 2026 10:00
pull Bot pushed a commit to Dustin4444/metamask-mobile that referenced this pull request May 14, 2026
…Mask#30002)

<!--
Please submit this PR as a draft initially.

Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.

In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->

## **Description**
This PR upgrades to the final version of the money account upgrade
controller - which can in theory run through the entire chomp upgrade
flow.

Things that we've changed in this PR in addition to bumping the package
1. Updated the config that is passed into the upgrade controller
2. Added a check which ensures the monad network is enabled before we
start the upgrade process. This is necessary, because monad is enabled
by default

# TODO
1. ~~This PR builds on @MoMannn's PR MetaMask#29897 - and it should be merged
first.~~
2. This PR requires us to change the [vault config feature
flag](https://app.launchdarkly.com/projects/metamask-client-config-api-mobile/flags/money-account-vault-config/targeting?env=test&selected-env=test)
before it will function correctly.
3. Chomp returns a 500 on the final step of the upgrade process. We need
to figure out why this is happening and fix it
4. ~~We need to merge and publish [this core
pr](MetaMask/core#8621) and update the preview
packages that are currently used in this branch to the real published
updates.~~


<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Update to final version of money account upgrade
controller

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.




<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches money account upgrade bootstrap logic and programmatically
adds missing networks via `NetworkController.addNetwork`, which can
affect upgrade flow behavior and user network state if misconfigured.
Also bumps to `@metamask/money-account-upgrade-controller@^2.0.0` with
related dependency updates.
> 
> **Overview**
> Updates `moneyAccountUpgradeControllerInit` to initialize
`MoneyAccountUpgradeController` using the Money Account *vault config*
(chainId + boring vault address) instead of deriving addresses from
CHOMP service details / delegator environment.
> 
> Adds a bootstrap guard (`ensureChainConfigured`) that checks whether
the vault chain is present in the user’s `NetworkController` config and,
if missing, auto-adds it from `PopularList` (or logs an error and aborts
if unsupported). Tests are updated to cover the new init parameters,
missing vault config handling, and the chain auto-add behavior.
> 
> Expands the controller messenger permissions for the full upgrade flow
(delegation + additional CHOMP actions) and bumps
`@metamask/money-account-upgrade-controller` to `^2.0.0` plus related
dependency versions in `package.json`/`yarn.lock`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
74a760e. 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants