Skip to content

Commit

Permalink
feat: add Shape chain (#2764)
Browse files Browse the repository at this point in the history
* add Shape chain

* add explorer, update rpc

* remove explorer for now

* remove contracts

* add contracts and explorer

* add to op-stack, format

* add l2OutputOracle

* add portal and l1StandardBridge

* update explorer

* Update itchy-flowers-attack.md

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
j6i and jxom authored Sep 25, 2024
1 parent 5b09e99 commit e0a6316
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-flowers-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added Shape chain.
49 changes: 49 additions & 0 deletions src/chains/definitions/shape.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 1 // mainnet

export const shape = /*#__PURE__*/ defineChain({
...chainConfig,
id: 360,
name: 'Shape',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://mainnet.shape.network'],
},
},
blockExplorers: {
default: {
name: 'shapescan',
url: 'https://shapescan.xyz',
apiUrl: 'https://shapescan.xyz/api',
},
},
contracts: {
...chainConfig.contracts,
l2OutputOracle: {
[sourceId]: {
address: '0x6Ef8c69CfE4635d866e3E02732068022c06e724D',
blockCreated: 20369940,
},
},
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 1,
},
portal: {
[sourceId]: {
address: '0xEB06fFa16011B5628BaB98E29776361c83741dd3',
blockCreated: 20369933,
},
},
l1StandardBridge: {
[sourceId]: {
address: '0x62Edd5f4930Ea92dCa3fB81689bDD9b9d076b57B',
blockCreated: 20369935,
},
},
},
sourceId,
})
1 change: 1 addition & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export { sei } from './definitions/sei.js'
export { seiDevnet } from './definitions/seiDevnet.js'
export { seiTestnet } from './definitions/seiTestnet.js'
export { sepolia } from './definitions/sepolia.js'
export { shape } from './definitions/shape.js'
export { shapeSepolia } from './definitions/shapeSepolia.js'
export { shimmer } from './definitions/shimmer.js'
export { shimmerTestnet } from './definitions/shimmerTestnet.js'
Expand Down
1 change: 1 addition & 0 deletions src/op-stack/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { optimismGoerli } from '../chains/definitions/optimismGoerli.js'
export { optimismSepolia } from '../chains/definitions/optimismSepolia.js'
export { pgn } from '../chains/definitions/pgn.js'
export { pgnTestnet } from '../chains/definitions/pgnTestnet.js'
export { shape } from '../chains/definitions/shape.js'
export { snax } from '../chains/definitions/snax.js'
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js'
export { zora } from '../chains/definitions/zora.js'
Expand Down

0 comments on commit e0a6316

Please sign in to comment.