feat: seed mUSD as default tracked asset on mainnet, Linea, and Monad#8616
Open
feat: seed mUSD as default tracked asset on mainnet, Linea, and Monad#8616
Conversation
…t, Linea, and Monad - Add `defaults.ts` with `DEFAULT_TRACKED_ASSETS_BY_CHAIN`, `DEFAULT_ASSET_METADATA`, `buildDefaultAssetsInfo`, `getDefaultTrackedAssetsForChain`, and `getDefaultAssetMetadata` - Pre-seed `assetsInfo` in default controller state so mUSD is immediately renderable before any on-chain balance fetch completes - Add `#ensureDefaultTrackedAssetsSeeded` to write zero-balance entries into `assetsBalance` for every EVM account on chains that have default tracked assets - Wire seeding into controller start, account-tree changes, group changes, and enabled-network changes (passing only newly added chains to avoid redundant work) - Subscribe to `NetworkController:networkAdded` and seed mUSD immediately when the user adds a chain that has default tracked assets (e.g. Monad testnet, eip155:143) - Export all new helpers from `index.ts` - Correct Monad chain id to `eip155:143` (not `eip155:10143`)`
2c131c4 to
8effc29
Compare
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 09bb2df. Configure here.
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.

defaults.tswithDEFAULT_TRACKED_ASSETS_BY_CHAIN,DEFAULT_ASSET_METADATA,buildDefaultAssetsInfo,getDefaultTrackedAssetsForChain, andgetDefaultAssetMetadataassetsInfoin default controller state so mUSD is immediately renderable before any on-chain balance fetch completes#ensureDefaultTrackedAssetsSeededto write zero-balance entries intoassetsBalancefor every EVM account on chains that have default tracked assetsNetworkController:networkAddedand seed mUSD immediately when the user adds a chain that has default tracked assets (e.g. Monad testnet, eip155:143)index.tseip155:143(noteip155:10143)`Explanation
References
Checklist
Note
Medium Risk
Introduces new default-asset seeding that mutates persisted controller state (
assetsInfo/assetsBalance) on startup and in response to network/account events, which could affect token visibility and state size across chains/accounts if mis-scoped.Overview
Adds controller-managed default tracked assets (mUSD) on
eip155:1,eip155:59144, andeip155:143. Default controller state now pre-seedsassetsInfowith mUSD metadata so it is renderable before any fetch completes.The controller now also seeds per-account zero balances for these defaults via
#ensureDefaultTrackedAssetsSeeded, wired into startup, account-tree/group changes, enabled-network changes (only newly enabled chains), and a newNetworkController:networkAddedsubscription to seed immediately when a supported network is added. A newdefaults.tsregistry and helpers are introduced and exported fromindex.ts, and tests/changelog are updated accordingly.Reviewed by Cursor Bugbot for commit 09bb2df. Bugbot is set up for automated code reviews on this repo. Configure here.