Skip to content

Commit 871d309

Browse files
authored
feat: add ARC mainnet to bridge controller (MetaMask#9007)
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Additive chain constant and token map updates with no breaking API or controller logic changes. > > **Overview** > Adds **Arc mainnet** (chain `5042` / `0x13b2`, CAIP `eip155:5042`) as a supported bridge network in `@metamask/bridge-controller`. > > The change wires Arc through the same registration points as other EVM chains: `ALLOWED_BRIDGE_CHAIN_IDS`, `DEFAULT_CHAIN_RANKING`, `CHAIN_IDS`, `NETWORK_TO_NAME_MAP`, and the `ChainId` enum. Default swap/bridge token metadata uses **USDC-native** at the zero address (with a `SYMBOL_TO_SLIP44_MAP` entry noted as hidden on the UI client), rather than ETH-like natives used on most other EVM chains. > > Changelog documents the new network under **Unreleased**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ede443e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent fb079df commit 871d309

5 files changed

Lines changed: 21 additions & 0 deletions

File tree

packages/bridge-controller/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add `QUICK_BUY_FOLLOW_TRADING`, `QUICK_BUY_TOKEN_DETAILS`, `BATCH_SELL` and `UNIFIED_SWAP_BRIDGE` to FeatureId enum ([#8964](https://github.com/MetaMask/core/pull/8964))
1313
- Update metrics schema with `batch_id` property ([#8964](https://github.com/MetaMask/core/pull/8964))
14+
- Add `ARC` network support ([#9007](https://github.com/MetaMask/core/pull/9007))
15+
- Add `ARC` into constants `ALLOWED_BRIDGE_CHAIN_IDS`, `SWAPS_TOKEN_OBJECT` and `NETWORK_TO_NAME_MAP`
1416

1517
### Changed
1618

packages/bridge-controller/src/constants/bridge.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const ALLOWED_BRIDGE_CHAIN_IDS = [
2222
CHAIN_IDS.MONAD,
2323
CHAIN_IDS.HYPEREVM,
2424
CHAIN_IDS.MEGAETH,
25+
CHAIN_IDS.ARC,
2526
SolScope.Mainnet,
2627
BtcScope.Mainnet,
2728
TrxScope.Mainnet,
@@ -66,6 +67,7 @@ export const DEFAULT_CHAIN_RANKING = [
6667
{ chainId: 'eip155:1329', name: 'Sei' },
6768
{ chainId: 'eip155:999', name: 'HyperEVM' },
6869
{ chainId: 'eip155:4326', name: 'MegaETH' },
70+
{ chainId: 'eip155:5042', name: 'Arc' },
6971
{ chainId: 'eip155:324', name: 'zkSync' },
7072
] as const;
7173

packages/bridge-controller/src/constants/chains.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const CHAIN_IDS = {
7777
MONAD: '0x8f',
7878
HYPEREVM: '0x3e7',
7979
MEGAETH: '0x10e6',
80+
ARC: '0x13b2',
8081
} as const;
8182

8283
export const NETWORK_TYPES = {
@@ -130,6 +131,7 @@ export const SEI_DISPLAY_NAME = 'Sei Network';
130131
export const MONAD_DISPLAY_NAME = 'Monad';
131132
export const HYPEREVM_DISPLAY_NAME = 'HyperEVM';
132133
export const MEGAETH_DISPLAY_NAME = 'MegaETH';
134+
export const ARC_DISPLAY_NAME = 'Arc';
133135

134136
export const NETWORK_TO_NAME_MAP = {
135137
[NETWORK_TYPES.GOERLI]: GOERLI_DISPLAY_NAME,
@@ -165,4 +167,5 @@ export const NETWORK_TO_NAME_MAP = {
165167
[CHAIN_IDS.MONAD]: MONAD_DISPLAY_NAME,
166168
[CHAIN_IDS.HYPEREVM]: HYPEREVM_DISPLAY_NAME,
167169
[CHAIN_IDS.MEGAETH]: MEGAETH_DISPLAY_NAME,
170+
[CHAIN_IDS.ARC]: ARC_DISPLAY_NAME,
168171
} as const;

packages/bridge-controller/src/constants/tokens.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const CURRENCY_SYMBOLS = {
5959
MON: 'MON',
6060
HYPE: 'HYPE',
6161
MEGAETH: 'ETH',
62+
ARC: 'USDC',
6263
} as const;
6364

6465
const ETH_SWAPS_TOKEN_OBJECT = {
@@ -189,6 +190,15 @@ const MEGAETH_SWAPS_TOKEN_OBJECT = {
189190
...ETH_SWAPS_TOKEN_OBJECT,
190191
} as const;
191192

193+
// Leaving for code consistency but we won't display it in the asset picker
194+
const ARC_SWAPS_TOKEN_OBJECT = {
195+
symbol: 'USDC-native',
196+
name: 'USDC-native',
197+
address: '0x0000000000000000000000000000000000000000',
198+
decimals: 18,
199+
iconUrl: '',
200+
} as const;
201+
192202
export const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {
193203
[CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT,
194204
[CHAIN_IDS.LOCALHOST]: TEST_ETH_SWAPS_TOKEN_OBJECT,
@@ -206,6 +216,7 @@ export const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {
206216
[CHAIN_IDS.MONAD]: MONAD_SWAPS_TOKEN_OBJECT,
207217
[CHAIN_IDS.HYPEREVM]: HYPEREVM_SWAPS_TOKEN_OBJECT,
208218
[CHAIN_IDS.MEGAETH]: MEGAETH_SWAPS_TOKEN_OBJECT,
219+
[CHAIN_IDS.ARC]: ARC_SWAPS_TOKEN_OBJECT,
209220
[SolScope.Mainnet]: SOLANA_SWAPS_TOKEN_OBJECT,
210221
[SolScope.Devnet]: SOLANA_SWAPS_TOKEN_OBJECT,
211222
[BtcScope.Mainnet]: BTC_SWAPS_TOKEN_OBJECT,
@@ -236,4 +247,6 @@ export const SYMBOL_TO_SLIP44_MAP: Record<
236247
TRX: 'slip44:195',
237248
MON: 'slip44:268435779',
238249
HYPE: 'slip44:2457',
250+
// It won't be displayed - hidden on UI client side
251+
'USDC-native': 'erc20:0x0000000000000000000000000000000000000000',
239252
};

packages/bridge-controller/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ export enum ChainId {
356356
MONAD = 143,
357357
HYPEREVM = 999,
358358
MEGAETH = 4326,
359+
ARC = 5042,
359360
}
360361

361362
export type FeatureFlagsPlatformConfig = Infer<typeof PlatformConfigSchema>;

0 commit comments

Comments
 (0)