From 951b2292c6a0fc30fa89c427a31990c85c671383 Mon Sep 17 00:00:00 2001 From: Roberto Bayardo Date: Mon, 10 Jul 2023 11:30:25 -0700 Subject: [PATCH] add base mainnet as a supported superchain --- src/chains.ts | 17 +++++++++++++++++ src/schemas.ts | 2 ++ src/types.ts | 1 + 3 files changed, 20 insertions(+) diff --git a/src/chains.ts b/src/chains.ts index 1ab1950ae..06ea0fc01 100644 --- a/src/chains.ts +++ b/src/chains.ts @@ -17,6 +17,15 @@ export const NETWORK_DATA: Record = { ), layer: 2, }, + base: { + id: 8543, + name: 'Base', + provider: new ethers.providers.StaticJsonRpcProvider( + // Update to 'https://mainnet.base.org' once live + 'https://developer-access-mainnet.base.org', + ), + layer: 2, + }, goerli: { id: 5, name: 'Goerli', @@ -58,6 +67,9 @@ export const L2_STANDARD_BRIDGE_INFORMATION: Record< optimism: { l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010', }, + base: { + l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010', + }, 'optimism-goerli': { l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010', }, @@ -68,6 +80,7 @@ export const L2_STANDARD_BRIDGE_INFORMATION: Record< export const L2_TO_L1_PAIR: Partial> = { optimism: 'ethereum', + base: 'ethereum', 'optimism-goerli': 'goerli', 'base-goerli': 'goerli', } @@ -81,6 +94,10 @@ export const L1_STANDARD_BRIDGE_INFORMATION: Record< l2Chain: 'optimism', l1StandardBridgeAddress: '0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1', }, + { + l2Chain: 'base', + l1StandardBridgeAddress: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35', + }, ], goerli: [ { diff --git a/src/schemas.ts b/src/schemas.ts index 2a76bbb73..9f8591abf 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -60,6 +60,7 @@ export const TOKEN_DATA_SCHEMA = { properties: { ethereum: TOKEN_SCHEMA, optimism: TOKEN_SCHEMA, + base: TOKEN_SCHEMA, 'base-goerli': TOKEN_SCHEMA, goerli: TOKEN_SCHEMA, 'optimism-goerli': TOKEN_SCHEMA, @@ -68,6 +69,7 @@ export const TOKEN_DATA_SCHEMA = { anyOf: [ { required: ['ethereum'] }, { required: ['optimism'] }, + { required: ['base'] }, { required: ['base-goerli'] }, { required: ['goerli'] }, { required: ['optimism-goerli'] }, diff --git a/src/types.ts b/src/types.ts index 7e669c9ec..e79988000 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,6 +22,7 @@ export interface Token { export type Chain = | 'ethereum' | 'optimism' + | 'base' | 'goerli' | 'optimism-goerli' | 'base-goerli'