Skip to content

Commit 99421a6

Browse files
authored
feat: add codex chain (mainnet and testnet) (#4185)
1 parent 2e68a06 commit 99421a6

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed

.changeset/lemon-eyes-rhyme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Added Codex chain.

src/chains/definitions/codex.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { chainConfig } from '../../op-stack/chainConfig.js'
2+
import { defineChain } from '../../utils/chain/defineChain.js'
3+
4+
const sourceId = 1 // mainnet
5+
6+
export const codex = /*#__PURE__*/ defineChain({
7+
...chainConfig,
8+
id: 81224,
9+
name: 'Codex',
10+
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
11+
rpcUrls: {
12+
default: {
13+
http: ['https://rpc.codex.xyz'],
14+
},
15+
},
16+
blockExplorers: {
17+
default: {
18+
name: 'Codex Explorer',
19+
url: 'https://explorer.codex.xyz',
20+
apiUrl: 'https://explorer.codex.xyz/api',
21+
},
22+
},
23+
contracts: {
24+
...chainConfig.contracts,
25+
disputeGameFactory: {
26+
[sourceId]: {
27+
address: '0x6A3855dc26e2beA8Ac73f82Cda79f3808B6C6F6C',
28+
},
29+
},
30+
portal: {
31+
[sourceId]: {
32+
address: '0x52759C07A759c81BAab28AE1BE5A19e6450959bD',
33+
},
34+
},
35+
l1StandardBridge: {
36+
[sourceId]: {
37+
address: '0xa6b1A05a592719B0C8a70c69eac114C48410aDE4',
38+
},
39+
},
40+
multicall3: {
41+
address: '0xca11bde05977b3631167028862be2a173976ca11',
42+
},
43+
},
44+
sourceId,
45+
})
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { chainConfig } from '../../op-stack/chainConfig.js'
2+
import { defineChain } from '../../utils/chain/defineChain.js'
3+
4+
const sourceId = 11_155_111 // sepolia
5+
6+
export const codexTestnet = /*#__PURE__*/ defineChain({
7+
...chainConfig,
8+
id: 812242,
9+
name: 'Codex Testnet',
10+
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
11+
rpcUrls: {
12+
default: {
13+
http: ['https://rpc.codex-stg.xyz'],
14+
},
15+
},
16+
blockExplorers: {
17+
default: {
18+
name: 'Codex Testnet Explorer',
19+
url: 'https://explorer.codex-stg.xyz',
20+
apiUrl: 'https://explorer.codex-stg.xyz/api',
21+
},
22+
},
23+
contracts: {
24+
...chainConfig.contracts,
25+
disputeGameFactory: {
26+
[sourceId]: {
27+
address: '0x390e24E8324E56f13A8d48eB938b6f9De24CD205',
28+
},
29+
},
30+
portal: {
31+
[sourceId]: {
32+
address: '0x037F161D12c829A9ca4742eEd9371830CA54fcB2',
33+
},
34+
},
35+
l1StandardBridge: {
36+
[sourceId]: {
37+
address: '0xCf4df2bDB14C8FDB25FdacCEC10Ce5C4bAEDB3De',
38+
},
39+
},
40+
multicall3: {
41+
address: '0xca11bde05977b3631167028862be2a173976ca11',
42+
},
43+
},
44+
sourceId,
45+
})

src/chains/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export { chiliz } from './definitions/chiliz.js'
112112
export { chips } from './definitions/chips.js'
113113
export { citreaTestnet } from './definitions/citreaTestnet.js'
114114
export { classic } from './definitions/classic.js'
115+
export { codex } from './definitions/codex.js'
116+
export { codexTestnet } from './definitions/codexTestnet.js'
115117
export { coinbit } from './definitions/coinbit.js'
116118
export { coinex } from './definitions/coinex.js'
117119
export { confluxESpace } from './definitions/confluxESpace.js'

0 commit comments

Comments
 (0)