Skip to content

Commit

Permalink
feat: update World Chain (#2917)
Browse files Browse the repository at this point in the history
* update world chain

* changeset
  • Loading branch information
0xPenryn authored Oct 23, 2024
1 parent 3061176 commit b3f8199
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-snakes-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Updated World Chain (Mainnet and Sepolia)
39 changes: 38 additions & 1 deletion src/chains/definitions/worldchain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 1 // mainnet

export const worldchain = /*#__PURE__*/ defineChain({
id: 480,
name: 'World Chain',
Expand All @@ -10,9 +13,43 @@ export const worldchain = /*#__PURE__*/ defineChain({
},
blockExplorers: {
default: {
name: 'World Chain Explorer',
name: 'Worldscan',
url: 'https://worldscan.org',
apiUrl: 'https://api.worldscan.org/api',
},
blockscout: {
name: 'Blockscout',
url: 'https://worldchain-mainnet.explorer.alchemy.com',
apiUrl: 'https://worldchain-mainnet.explorer.alchemy.com/api',
},
},
contracts: {
...chainConfig.contracts,
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 0,
},
disputeGameFactory: {
[sourceId]: {
address: '0x0E90dCAFBC242D2C861A20Bb20EC8E7182965a52',
},
},
l2OutputOracle: {
[sourceId]: {
address: '0x19A6d1E9034596196295CF148509796978343c5D',
},
},
portal: {
[sourceId]: {
address: '0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C',
},
},
l1StandardBridge: {
[sourceId]: {
address: '0x470458C91978D2d929704489Ad730DC3E3001113',
},
},
},
testnet: false,
sourceId,
})
38 changes: 37 additions & 1 deletion src/chains/definitions/worldchainSepolia.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 11_155_111 // sepolia

export const worldchainSepolia = /*#__PURE__*/ defineChain({
id: 4801,
name: 'World Chain Sepolia',
Expand All @@ -11,9 +14,42 @@ export const worldchainSepolia = /*#__PURE__*/ defineChain({
},
blockExplorers: {
default: {
name: 'World Chain Sepolia Explorer',
name: 'Worldscan Sepolia',
url: 'https://sepolia.worldscan.org',
},
blockscout: {
name: 'Blockscout',
url: 'https://worldchain-sepolia.explorer.alchemy.com',
apiUrl: 'https://worldchain-sepolia.explorer.alchemy.com/api',
},
},
contracts: {
...chainConfig.contracts,
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 0,
},
disputeGameFactory: {
[sourceId]: {
address: '0x8cF97Ee616C986a070F5020d973b456D0120C253',
},
},
l2OutputOracle: {
[sourceId]: {
address: '0xc8886f8BAb6Eaeb215aDB5f1c686BF699248300e',
},
},
portal: {
[sourceId]: {
address: '0xFf6EBa109271fe6d4237EeeD4bAb1dD9A77dD1A4',
},
},
l1StandardBridge: {
[sourceId]: {
address: '0xd7DF54b3989855eb66497301a4aAEc33Dbb3F8DE',
},
},
},
testnet: true,
sourceId,
})
2 changes: 2 additions & 0 deletions src/op-stack/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export { shape } from '../chains/definitions/shape.js'
export { snax } from '../chains/definitions/snax.js'
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js'
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js'
export { worldchain } from '../chains/definitions/worldchain.js'
export { worldchainSepolia } from '../chains/definitions/worldchainSepolia.js'
export { zora } from '../chains/definitions/zora.js'
export { zoraSepolia } from '../chains/definitions/zoraSepolia.js'
export { zoraTestnet } from '../chains/definitions/zoraTestnet.js'

0 comments on commit b3f8199

Please sign in to comment.