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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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 9dd3275. Configure here.
|
|
||
| const popularEntry = PopularList.find( | ||
| (network) => toHex(network.chainId as string) === chainId, | ||
| ); |
There was a problem hiding this comment.
Redundant toHex on already-hex PopularList chainId values
Low Severity
The PopularList entries already store chainId as hex strings (produced by toHex() at definition time, e.g. toHex('143') → '0x8f'). Calling toHex(network.chainId as string) applies the conversion a second time on an already-hex value. A direct comparison like network.chainId === chainId is clearer and avoids relying on toHex being idempotent for hex string inputs, which is an undocumented assumption about the @metamask/controller-utils implementation.
Reviewed by Cursor Bugbot for commit 9dd3275. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|





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
TODO
This PR builds on @MoMannn's PR chore: add monad mUSD #29897 - and it should be merged first.We need to merge and publish this core pr and update the preview packages that are currently used in this branch to the real published updates.Changelog
CHANGELOG entry: Update to final version of money account upgrade controller
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
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
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.0with related dependency updates.Overview
Updates
moneyAccountUpgradeControllerInitto initializeMoneyAccountUpgradeControllerusing 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’sNetworkControllerconfig and, if missing, auto-adds it fromPopularList(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-controllerto^2.0.0plus related dependency versions inpackage.json/yarn.lock.Reviewed by Cursor Bugbot for commit 74a760e. Bugbot is set up for automated code reviews on this repo. Configure here.