From 27cbd5f91e7d85de58fe01da5d37376e9886a715 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 10 Sep 2024 15:59:16 +0100 Subject: [PATCH 1/5] feat: redstone/garnet chains --- src/chains/definitions/garnet.ts | 49 ++++++++++++++++++++++++++++++ src/chains/definitions/redstone.ts | 42 ++++++++++++++++++++----- 2 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 src/chains/definitions/garnet.ts diff --git a/src/chains/definitions/garnet.ts b/src/chains/definitions/garnet.ts new file mode 100644 index 0000000000..4f11aa44f9 --- /dev/null +++ b/src/chains/definitions/garnet.ts @@ -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 Holesky', + 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, + }, + }, + }, +}) diff --git a/src/chains/definitions/redstone.ts b/src/chains/definitions/redstone.ts index 5744066bec..fa766eafd2 100644 --- a/src/chains/definitions/redstone.ts +++ b/src/chains/definitions/redstone.ts @@ -1,13 +1,14 @@ +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'], @@ -15,6 +16,33 @@ export const redstone = defineChain({ }, }, 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, + }, + }, }, }) From 93705f4ead25c59381bb7a03608d60cdbcedb801 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 10 Sep 2024 11:35:46 -0700 Subject: [PATCH 2/5] Update src/chains/definitions/garnet.ts --- src/chains/definitions/garnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/definitions/garnet.ts b/src/chains/definitions/garnet.ts index 4f11aa44f9..e5ddd75301 100644 --- a/src/chains/definitions/garnet.ts +++ b/src/chains/definitions/garnet.ts @@ -5,7 +5,7 @@ const sourceId = 17000 // Holesky testnet export const garnet = defineChain({ ...chainConfig, - name: 'Garnet Holesky', + name: 'Garnet Testnet', testnet: true, id: 17069, sourceId, From 1f691bca3154ab2ebf9c8f41e62c82d3f542d87f Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Wed, 11 Sep 2024 22:30:13 +0100 Subject: [PATCH 3/5] export garnet --- src/chains/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/index.ts b/src/chains/index.ts index 4bc0c0411e..33efd7e970 100644 --- a/src/chains/index.ts +++ b/src/chains/index.ts @@ -242,6 +242,7 @@ export { qTestnet } from './definitions/qTestnet.js' export { real } from './definitions/real.js' export { redbellyTestnet } from './definitions/redbellyTestnet.js' export { redstone } from './definitions/redstone.js' +export { garnet } from './definitions/garnet.js' export { reyaNetwork } from './definitions/reyaNetwork.js' export { rollux } from './definitions/rollux.js' export { rolluxTestnet } from './definitions/rolluxTestnet.js' From f12f35f45112ff2c6868268664859a932054599a Mon Sep 17 00:00:00 2001 From: jxom Date: Thu, 12 Sep 2024 07:31:32 +1000 Subject: [PATCH 4/5] chore: up --- src/chains/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/index.ts b/src/chains/index.ts index 33efd7e970..53a8065091 100644 --- a/src/chains/index.ts +++ b/src/chains/index.ts @@ -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' @@ -242,7 +243,6 @@ export { qTestnet } from './definitions/qTestnet.js' export { real } from './definitions/real.js' export { redbellyTestnet } from './definitions/redbellyTestnet.js' export { redstone } from './definitions/redstone.js' -export { garnet } from './definitions/garnet.js' export { reyaNetwork } from './definitions/reyaNetwork.js' export { rollux } from './definitions/rollux.js' export { rolluxTestnet } from './definitions/rolluxTestnet.js' From a322794323ca5771f3dcaa57993f8231ac9473e0 Mon Sep 17 00:00:00 2001 From: jxom Date: Thu, 12 Sep 2024 07:32:03 +1000 Subject: [PATCH 5/5] Create soft-boxes-reply.md --- .changeset/soft-boxes-reply.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/soft-boxes-reply.md diff --git a/.changeset/soft-boxes-reply.md b/.changeset/soft-boxes-reply.md new file mode 100644 index 0000000000..14fca24a6f --- /dev/null +++ b/.changeset/soft-boxes-reply.md @@ -0,0 +1,6 @@ +--- +"viem": patch +--- + +Added Garnet chain. +Updated Redstone chain.