Skip to content

Commit

Permalink
feat(common): add garnet chain (#2738)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Apr 26, 2024
1 parent 4b6ce81 commit df4781a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/tall-steaks-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@latticexyz/common": patch
---

Added Garnet chain config and deprecated Lattice Testnet.

```ts
import { garnet } from "@latticexyz/common/chains";
```
52 changes: 52 additions & 0 deletions packages/common/src/chains/garnet.ts
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion packages/common/src/chains/index.ts
Original file line number Diff line number Diff line change
@@ -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";
1 change: 1 addition & 0 deletions packages/common/src/chains/latticeTestnet.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit df4781a

Please sign in to comment.