Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add redstone/garnet chains #2713

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/soft-boxes-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"viem": patch
---

Added Garnet chain.
Updated Redstone chain.
49 changes: 49 additions & 0 deletions src/chains/definitions/garnet.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs export

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, will add

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

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 = 17000 // Holesky testnet

export const garnet = defineChain({
...chainConfig,
name: 'Garnet Testnet',
testnet: true,
id: 17069,
sourceId,
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://rpc.garnetchain.com'],
webSocket: ['wss://rpc.garnetchain.com'],
},
},
blockExplorers: {
default: {
name: 'Blockscout',
url: 'https://explorer.garnetchain.com',
},
},
contracts: {
...chainConfig.contracts,
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
},
portal: {
[sourceId]: {
address: '0x57ee40586fbE286AfC75E67cb69511A6D9aF5909',
blockCreated: 1274684,
},
},
l2OutputOracle: {
[sourceId]: {
address: '0xCb8E7AC561b8EF04F2a15865e9fbc0766FEF569B',
blockCreated: 1274684,
},
},
l1StandardBridge: {
[sourceId]: {
address: '0x09bcDd311FE398F80a78BE37E489f5D440DB95DE',
blockCreated: 1274684,
},
},
},
})
42 changes: 35 additions & 7 deletions src/chains/definitions/redstone.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

const sourceId = 1 // Ethereum mainnet

export const redstone = defineChain({
id: 690,
...chainConfig,
name: 'Redstone',
nativeCurrency: {
decimals: 18,
name: 'Ether',
symbol: 'ETH',
},
id: 690,
sourceId,
nativeCurrency: { decimals: 18, name: 'Ether', symbol: 'ETH' },
rpcUrls: {
default: {
http: ['https://rpc.redstonechain.com'],
webSocket: ['wss://rpc.redstonechain.com'],
},
},
blockExplorers: {
default: { name: 'Explorer', url: ' https://explorer.redstone.xyz' },
default: {
name: 'Blockscout',
url: 'https://explorer.redstone.xyz',
},
},
contracts: {
...chainConfig.contracts,
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
},
portal: {
[sourceId]: {
address: '0xC7bCb0e8839a28A1cFadd1CF716de9016CdA51ae',
blockCreated: 19578329,
},
},
l2OutputOracle: {
[sourceId]: {
address: '0xa426A052f657AEEefc298b3B5c35a470e4739d69',
blockCreated: 19578337,
},
},
l1StandardBridge: {
[sourceId]: {
address: '0xc473ca7E02af24c129c2eEf51F2aDf0411c1Df69',
blockCreated: 19578331,
},
},
},
})
1 change: 1 addition & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export { iotexTestnet } from './definitions/iotexTestnet.js'
export { jbc } from './definitions/jbc.js'
export { jbcTestnet } from './definitions/jbcTestnet.js'
export { karura } from './definitions/karura.js'
export { garnet } from './definitions/garnet.js'
export { gobi } from './definitions/gobi.js'
export { goerli } from './definitions/goerli.js'
export { gnosis } from './definitions/gnosis.js'
Expand Down
Loading