Skip to content

feat: seed mUSD as default tracked asset on mainnet, Linea, and Monad#8616

Open
salimtb wants to merge 6 commits intomainfrom
feat/musd-default-state
Open

feat: seed mUSD as default tracked asset on mainnet, Linea, and Monad#8616
salimtb wants to merge 6 commits intomainfrom
feat/musd-default-state

Conversation

@salimtb
Copy link
Copy Markdown
Contributor

@salimtb salimtb commented Apr 28, 2026

  • 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)`

Explanation

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 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, and eip155:143. Default controller state now pre-seeds assetsInfo with 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 new NetworkController:networkAdded subscription to seed immediately when a supported network is added. A new defaults.ts registry and helpers are introduced and exported from index.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.

…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`)`
@salimtb salimtb force-pushed the feat/musd-default-state branch from 2c131c4 to 8effc29 Compare April 28, 2026 12:15
@salimtb salimtb changed the title feat: seed mUSD as default tracked asset on mainne… feat: seed mUSD as default tracked asset on mainnet, Linea, and Monad Apr 28, 2026
@salimtb salimtb marked this pull request as ready for review April 28, 2026 15:30
@salimtb salimtb requested review from a team as code owners April 28, 2026 15:30
Comment thread packages/assets-controller/src/AssetsController.ts Outdated
Comment thread packages/assets-controller/src/defaults.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/assets-controller/src/AssetsController.ts
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.

1 participant