From df4781ac28840abe5594b1e4a398e8f2ddfe2cf0 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Fri, 26 Apr 2024 15:41:11 +0100 Subject: [PATCH] feat(common): add garnet chain (#2738) --- .changeset/tall-steaks-give.md | 9 ++++ packages/common/src/chains/garnet.ts | 52 ++++++++++++++++++++ packages/common/src/chains/index.ts | 3 +- packages/common/src/chains/latticeTestnet.ts | 1 + 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .changeset/tall-steaks-give.md create mode 100644 packages/common/src/chains/garnet.ts diff --git a/.changeset/tall-steaks-give.md b/.changeset/tall-steaks-give.md new file mode 100644 index 0000000000..f284429ea3 --- /dev/null +++ b/.changeset/tall-steaks-give.md @@ -0,0 +1,9 @@ +--- +"@latticexyz/common": patch +--- + +Added Garnet chain config and deprecated Lattice Testnet. + +```ts +import { garnet } from "@latticexyz/common/chains"; +``` diff --git a/packages/common/src/chains/garnet.ts b/packages/common/src/chains/garnet.ts new file mode 100644 index 0000000000..3c9471480d --- /dev/null +++ b/packages/common/src/chains/garnet.ts @@ -0,0 +1,52 @@ +import { chainConfig } from "viem/op-stack"; +import type { MUDChain } from "./types"; + +const sourceId = 17000; // Holesky + +export const garnet = { + ...chainConfig, + id: 17069, + sourceId, + name: "Garnet Holesky", + testnet: true, + 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", + }, + blockscout: { + name: "Blockscout", + url: "https://garnet.blockscout.com", + }, + }, + contracts: { + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + }, + portal: { + [sourceId]: { + address: "0x57ee40586fbE286AfC75E67cb69511A6D9aF5909", + blockCreated: 1274684, + }, + }, + l2OutputOracle: { + [sourceId]: { + address: "0xCb8E7AC561b8EF04F2a15865e9fbc0766FEF569B", + blockCreated: 1274684, + }, + }, + l1StandardBridge: { + [sourceId]: { + address: "0x09bcDd311FE398F80a78BE37E489f5D440DB95DE", + blockCreated: 1274684, + }, + }, + }, +} as const satisfies MUDChain; diff --git a/packages/common/src/chains/index.ts b/packages/common/src/chains/index.ts index e968c6fad0..7e8b02824c 100644 --- a/packages/common/src/chains/index.ts +++ b/packages/common/src/chains/index.ts @@ -1,3 +1,4 @@ export type { MUDChain } from "./types"; -export { latticeTestnet } from "./latticeTestnet"; export { mudFoundry } from "./mudFoundry"; +export { latticeTestnet } from "./latticeTestnet"; +export { garnet } from "./garnet"; diff --git a/packages/common/src/chains/latticeTestnet.ts b/packages/common/src/chains/latticeTestnet.ts index ff30540a33..16a95934be 100644 --- a/packages/common/src/chains/latticeTestnet.ts +++ b/packages/common/src/chains/latticeTestnet.ts @@ -1,5 +1,6 @@ import type { MUDChain } from "./types"; +/** @deprecated This chain is deprecated and will be going offline soon. Please switch to Garnet! */ export const latticeTestnet = { name: "Lattice Testnet", id: 4242,