Skip to content

Commit 6897086

Browse files
authored
feat(common): add paymaster for testnet chains, remove rhodolite (#3770)
1 parent 7382971 commit 6897086

File tree

10 files changed

+28
-63
lines changed

10 files changed

+28
-63
lines changed

.changeset/warm-shoes-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/common": patch
3+
---
4+
5+
Added [Quarry paymaster](https://github.com/latticexyz/quarry-paymaster) address for Garnet and Pyrope chain configs. And removed defunct Rhodolite chain config.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { MUDChain, mudFoundry, redstone, garnet, rhodolite } from "@latticexyz/common/chains";
1+
import { MUDChain, mudFoundry, redstone, garnet } from "@latticexyz/common/chains";
22

3-
export const supportedChains: MUDChain[] = [mudFoundry, redstone, garnet, rhodolite];
3+
export const supportedChains: MUDChain[] = [mudFoundry, redstone, garnet];

packages/cli/src/defaultChains.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { redstone, garnet, rhodolite } from "@latticexyz/common/chains";
1+
import { redstone, garnet, pyrope } from "@latticexyz/common/chains";
22

3-
export const defaultChains = [redstone, garnet, rhodolite];
3+
export const defaultChains = [redstone, garnet, pyrope];

packages/common/src/chains/garnet.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ export const garnet = {
77
...garnetConfig.rpcUrls,
88
bundler: garnetConfig.rpcUrls.default,
99
},
10+
contracts: {
11+
...garnetConfig.contracts,
12+
quarryPaymaster: {
13+
address: "0x2d70F1eFFbFD865764CAF19BE2A01a72F3CE774f",
14+
},
15+
},
1016
iconUrls: ["https://redstone.xyz/chain-icons/garnet.png"],
1117
indexerUrl: "https://indexer.mud.garnetchain.com",
1218
} as const satisfies MUDChain;

packages/common/src/chains/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ export type { MUDChain } from "./types";
22
export { mudFoundry } from "./mudFoundry";
33
export { redstone } from "./redstone";
44
export { garnet } from "./garnet";
5-
export { rhodolite } from "./rhodolite";
65
export { pyrope } from "./pyrope";

packages/common/src/chains/pyrope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export const pyrope = {
2727
address: "0xC24932c31D9621aE9e792576152B7ef010cFC2F8",
2828
},
2929
},
30+
quarryPaymaster: {
31+
address: "0x2d70F1eFFbFD865764CAF19BE2A01a72F3CE774f",
32+
},
3033
},
3134
blockExplorers: {
3235
default: {

packages/common/src/chains/rhodolite.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

packages/entrykit/src/createBundlerClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ function createFeeEstimator(client: Client): undefined | (() => Promise<Estimate
5555
return async () => ({ maxFeePerGas: 100_000n, maxPriorityFeePerGas: 0n });
5656
}
5757

58-
// do our own fee calculation for redstone, garnet, rhodolite, pyrope chains
58+
// do our own fee calculation for redstone, garnet, pyrope chains
5959
// because viem sets fees way too high by default
6060
// https://github.com/wevm/viem/blob/253b1072ad9fe36a0e0491e173c85a6d69209ada/src/account-abstraction/actions/bundler/prepareUserOperation.ts#L436-L457
61-
if ([690, 17069, 17420, 695569].includes(client.chain.id)) {
61+
if ([690, 17069, 695569].includes(client.chain.id)) {
6262
// TODO: move to fee ref or similar approach
6363
return () => getAction(client, estimateFeesPerGas, "estimateFeesPerGas")({ chain: client.chain });
6464
}

templates/react-ecs/packages/client/src/wagmiConfig.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Chain, http, webSocket } from "viem";
22
import { anvil } from "viem/chains";
33
import { createWagmiConfig } from "@latticexyz/entrykit/internal";
4-
import { rhodolite, garnet, redstone } from "@latticexyz/common/chains";
4+
import { garnet, pyrope, redstone } from "@latticexyz/common/chains";
55
import { chainId } from "./common";
66

77
export const chains = [
88
redstone,
99
garnet,
10-
rhodolite,
10+
pyrope,
1111
{
1212
...anvil,
1313
contracts: {
@@ -29,7 +29,7 @@ export const chains = [
2929
export const transports = {
3030
[anvil.id]: webSocket(),
3131
[garnet.id]: http(),
32-
[rhodolite.id]: http(),
32+
[pyrope.id]: http(),
3333
[redstone.id]: http(),
3434
} as const;
3535

@@ -43,7 +43,7 @@ export const wagmiConfig = createWagmiConfig({
4343
pollingInterval: {
4444
[anvil.id]: 2000,
4545
[garnet.id]: 2000,
46-
[rhodolite.id]: 2000,
46+
[pyrope.id]: 2000,
4747
[redstone.id]: 2000,
4848
},
4949
});

templates/react/packages/client/src/wagmiConfig.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Chain, http, webSocket } from "viem";
22
import { anvil } from "viem/chains";
33
import { createWagmiConfig } from "@latticexyz/entrykit/internal";
4-
import { rhodolite, garnet, redstone } from "@latticexyz/common/chains";
4+
import { garnet, pyrope, redstone } from "@latticexyz/common/chains";
55
import { chainId } from "./common";
66

77
export const chains = [
88
redstone,
99
garnet,
10-
rhodolite,
10+
pyrope,
1111
{
1212
...anvil,
1313
contracts: {
@@ -29,7 +29,7 @@ export const chains = [
2929
export const transports = {
3030
[anvil.id]: webSocket(),
3131
[garnet.id]: http(),
32-
[rhodolite.id]: http(),
32+
[pyrope.id]: http(),
3333
[redstone.id]: http(),
3434
} as const;
3535

@@ -43,7 +43,7 @@ export const wagmiConfig = createWagmiConfig({
4343
pollingInterval: {
4444
[anvil.id]: 2000,
4545
[garnet.id]: 2000,
46-
[rhodolite.id]: 2000,
46+
[pyrope.id]: 2000,
4747
[redstone.id]: 2000,
4848
},
4949
});

0 commit comments

Comments
 (0)