feat(assets-controllers): seed mUSD as default tracked asset#8620
Merged
feat(assets-controllers): seed mUSD as default tracked asset#8620
Conversation
Adds mUSD (0xaca92e438df0b2401ff60da7e4337b687a2435da) as a default tracked token for all accounts on Ethereum mainnet (0x1), Linea (0xe708), Monad mainnet (0x8f), and Monad testnet (0x279f). TokensController changes: - Directly seeds mUSD into `allTokens` state for all known accounts at construction time, from persisted state, and on these events: - `KeyringController:unlock` — covers post-unlock account availability - `AccountsController:accountAdded` — covers async account loading - `AccountsController:selectedEvmAccountChange` — covers account switching - `NetworkController:networkAdded` — covers newly added supported chains - `NetworkController:stateChange` patches (op: add) — detects chain additions TokenDetectionController changes: - `start()` now calls `#seedDefaultTokens()` which uses the `TokensController:addTokens` action per supported chain, ensuring mUSD is seeded via the standard deduplication path on every detection run - Re-seeds when the selected EVM account changes or a supported chain is added - `#defaultTokensSeeded` flag prevents redundant seeding within a session Tests: - Added 13 tests for mUSD seeding triggers in TokensController - Updated messenger event delegation and helpers for new event types
99c1fd1 to
c8ac494
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 ccc42bd. Configure here.
Prithpal-Sooriya
previously approved these changes
Apr 30, 2026
Prithpal-Sooriya
approved these changes
Apr 30, 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.

Adds mUSD (0xaca92e438df0b2401ff60da7e4337b687a2435da) as a default tracked token for all accounts on Ethereum mainnet (0x1), Linea (0xe708), Monad mainnet (0x8f), and Monad testnet (0x279f).
TokensController changes:
allTokensstate for all known accounts at construction time, from persisted state, and on these events:KeyringController:unlock— covers post-unlock account availabilityAccountsController:accountAdded— covers async account loadingAccountsController:selectedEvmAccountChange— covers account switchingNetworkController:networkAdded— covers newly added supported chainsNetworkController:stateChangepatches (op: add) — detects chain additionsTokenDetectionController changes:
start()now calls#seedDefaultTokens()which uses theTokensController:addTokensaction per supported chain, ensuring mUSD is seeded via the standard deduplication path on every detection run#defaultTokensSeededflag prevents redundant seeding within a sessionTests:
Explanation
References
Checklist
Note
Medium Risk
Touches token state seeding and network/account event handling, which can affect users’ persisted
allTokensand default asset visibility across chains. Logic is largely additive and guarded/deduped, but incorrect triggers or chain lists could lead to unexpected token entries or missed seeding.Overview
Adds automatic seeding of MetaMask USD (mUSD) into
TokensControllerstate so it appears as a default tracked token on supported chains, including seeding for existing/persisted accounts and re-seeding on account selection, account creation, unlock, and supported network additions (bothnetworkAddedandstateChangeadd patches).Updates
TokenDetectionController.start()to seed mUSD viaTokensController:addTokensper configured supported chain, guarded by a per-session flag and re-triggered on selected-account changes and supportedNetworkController:networkAdded.Expands
TokensController/TokenDetectionControllermessenger allowed events accordingly, updates/extendsTokensControllertests heavily (mUSD seeding scenarios plus a few behavioral test additions likewatchAssetpassingpageMeta, updating existing tokens viaaddDetectedTokens, safer handling when network patches omitnetworkConfigurationsByChainId, and ERC721 detection whensupportsInterfacethrows), and removes an eslint suppression for explicit return types inTokensController.test.ts.Reviewed by Cursor Bugbot for commit 5ee1f4a. Bugbot is set up for automated code reviews on this repo. Configure here.