Skip to content

Commit

Permalink
fix(cli): remove postdeploy gas setting in favor of script options (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Apr 28, 2024
1 parent 1beb016 commit 074ed66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .changeset/plenty-pianos-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@latticexyz/cli": patch
---

Removed manual gas setting in PostDeploy step of `mud deploy` in favor of `forge script` fetching it from the RPC.

If you still want to manually set gas, you can use `mud deploy --forgeScriptOptions="--with-gas-price 1000000"`.
9 changes: 0 additions & 9 deletions packages/cli/src/utils/postDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { existsSync } from "fs";
import path from "path";
import chalk from "chalk";
import { getScriptDirectory, forge } from "@latticexyz/common/foundry";
import { execSync } from "child_process";
import { formatGwei } from "viem";

export async function postDeploy(
postDeployScript: string,
Expand All @@ -20,11 +18,7 @@ export async function postDeploy(
return;
}

// TODO: replace this with a viem call
const gasPrice = BigInt(execSync(`cast gas-price --rpc-url ${rpc}`, { encoding: "utf-8" }).trim());

console.log(chalk.blue(`Executing post deploy script at ${postDeployPath}`));
console.log(chalk.blue(` using gas price of ${formatGwei(gasPrice)} gwei`));

await forge(
[
Expand All @@ -34,9 +28,6 @@ export async function postDeploy(
"--sig",
"run(address)",
worldAddress,
// TODO: also set priority fee?
"--with-gas-price",
gasPrice.toString(),
"--rpc-url",
rpc,
"-vvv",
Expand Down

0 comments on commit 074ed66

Please sign in to comment.