forked from ethereum-optimism/ethereum-optimism.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchains.ts
161 lines (153 loc) · 3.81 KB
/
chains.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import { ethers } from 'ethers'
import { Chain, L1Chain, L2Chain, Network } from './types'
const DEFAULT_INFURA_KEY = '84842078b09946638c03157f83405213'
export const NETWORK_DATA: Record<Chain, Network> = {
ethereum: {
id: 1,
name: 'Mainnet',
provider: new ethers.providers.InfuraProvider('homestead'),
layer: 1,
},
optimism: {
id: 10,
name: 'Optimism',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://mainnet.optimism.io'
),
layer: 2,
},
base: {
id: 8453,
name: 'Base',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://mainnet.base.org',
),
layer: 2,
},
pgn: {
id: 424,
name: 'PGN - Public Goods Network',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://rpc.publicgoods.network'
),
layer: 2,
},
mode: {
id: 34443,
name: 'Mode',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://mainnet.mode.network',
),
layer: 2,
},
sepolia: {
id: 11155111,
name: 'Sepolia',
provider: new ethers.providers.StaticJsonRpcProvider(`https://sepolia.infura.io/v3/${DEFAULT_INFURA_KEY}`, 11155111),
layer: 1,
},
'optimism-sepolia': {
id: 11155420,
name: 'Optimism Sepolia',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://sepolia.optimism.io'
),
layer: 2,
},
'base-sepolia': {
id: 84532,
name: 'Base Sepolia',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://sepolia.base.org',
84532
),
layer: 2,
},
'pgn-sepolia': {
id: 58008,
name: 'PGN Sepolia',
provider: new ethers.providers.StaticJsonRpcProvider(
'https://rpc.sepolia.publicgoods.network'
),
layer: 2,
},
}
interface L2BridgeInformation {
l2StandardBridgeAddress: string
}
interface L1BridgeInformation {
l2Chain: L2Chain
l1StandardBridgeAddress: string
}
export const L2_STANDARD_BRIDGE_INFORMATION: Record<
L2Chain,
L2BridgeInformation
> = {
optimism: {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
base: {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
pgn: {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
mode: {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
'optimism-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
'base-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
'pgn-sepolia': {
l2StandardBridgeAddress: '0x4200000000000000000000000000000000000010',
},
}
export const L2_TO_L1_PAIR: Partial<Record<L2Chain, L1Chain>> = {
optimism: 'ethereum',
base: 'ethereum',
pgn: 'ethereum',
mode: 'ethereum',
'optimism-sepolia': 'sepolia',
'base-sepolia': 'sepolia',
'pgn-sepolia': 'sepolia'
}
export const L1_STANDARD_BRIDGE_INFORMATION: Record<
L1Chain,
L1BridgeInformation[]
> = {
ethereum: [
{
l2Chain: 'optimism',
l1StandardBridgeAddress: '0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1',
},
{
l2Chain: 'base',
l1StandardBridgeAddress: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35',
},
{
l2Chain: 'pgn',
l1StandardBridgeAddress: '0xD0204B9527C1bA7bD765Fa5CCD9355d38338272b',
},
{
l2Chain: 'mode',
l1StandardBridgeAddress: '0x735aDBbE72226BD52e818E7181953f42E3b0FF21',
},
],
sepolia: [
{
l2Chain: 'optimism-sepolia',
l1StandardBridgeAddress: '0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1',
},
{
l2Chain: 'pgn-sepolia',
l1StandardBridgeAddress: '0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3',
},
{
l2Chain: 'base-sepolia',
l1StandardBridgeAddress: '0xfd0Bf71F60660E2f608ed56e1659C450eB113120',
},
]
}