feat(arc): add USDC by default and treat native as USDC on Arc#43455
feat(arc): add USDC by default and treat native as USDC on Arc#43455salimtb wants to merge 11 commits into
Conversation
- Auto-import USDC for all EVM accounts on Arc when the network is present, and for newly created EVM accounts thereafter. - Hide the Arc native zero-address token everywhere it would otherwise appear as a duplicate USDC entry (token list, send asset picker, aggregated balance). - Skip rendering the pay-with row on Arc since the transaction always pays with the native token; this prevents the "no payment route" error.
|
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (8 files, +400 -21)
👨🔧 @MetaMask/core-extension-ux (1 files, +2 -0)
💎 @MetaMask/metamask-assets (2 files, +73 -3)
|
…accounts Subscribe to the NetworkController:networkAdded event at the controller layer so USDC is added the moment Arc is added — independent of whether any UI provider (AssetPollingProvider) happens to be mounted. The UI-side hook still handles backfill for accounts added later. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| * Adds USDC on Arc for all EVM accounts that don't already have it, whenever | ||
| * the Arc network is present. Also handles new accounts added after Arc. | ||
| */ | ||
| export function useArcDefaultTokens() { |
There was a problem hiding this comment.
Nice, I don't think we need both metamask-controller changes if we have this effect :)
Builds ready [7e4b9f0]
⚡ Performance Benchmarks (Total: 🟢 19 pass · 🟡 6 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [e015356]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| useTokenListPolling(); | ||
| useDeFiPolling(); | ||
| useStaticTokensPollingHook(); | ||
| useArcDefaultTokens(); |
There was a problem hiding this comment.
This is genius as a quick fix.
Builds ready [451bce1]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [928d8db]
⚡ Performance Benchmarks (Total: 🟢 19 pass · 🟡 6 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
928d8db to
8368bb0
Compare
|
Closing this one as the other one is: #43509 |
Description
Changelog
CHANGELOG entry: add USDC by default and treat native as USDC on Arc
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes span send max-amount math, aggregated balances, and MetaMask Pay token selection—user-visible fund and gas behavior on Arc, though scoped to one chain and covered by new tests.
Overview
Adds Arc-specific USDC treatment so users see one balance (the mirrored USDC ERC20) instead of duplicate native/USDC entries, with gas and pay flows aligned to the shared on-chain balance.
Default USDC on Arc: When Arc is added, the background subscribes to
NetworkController:networkAddedand callsaddCustomAssetfor Arc USDC on every EVM account;useArcDefaultTokensdoes the same from the UI polling path for accounts that do not already have the asset.ARC_USDC_TOKEN_ADDRESSis documented in shared network constants.Display and balances: Arc native assets (zero address /
isNative) are stripped in asset selectors and token balances; the token list always surfaces Arc USDC (including zero balance on Arc) outside the low-value bucket; the send asset picker omits the separate native row on Arc. Token management disables hide/import toggles for the Arc USDC identifier (bare address or full CAIP id).Send max on Arc:
sharesBalanceWithNativeGasTokenroutes Arc USDC throughgetArcMaxAmountFn, reserving ERC20-transfer gas with 18→6 decimal scaling and optionalfetchSuggestedMaxFeePerGaswhen controller estimates are missing.Pay / confirmations: Arc USDC is excluded from MetaMask Pay selectable tokens; required-tokens UI uses native vs ERC20 asset pills when the required token is the native address.
Reviewed by Cursor Bugbot for commit 928d8db. Bugbot is set up for automated code reviews on this repo. Configure here.