From 074ed66eb64df377e37684c47d7ff15ced16885b Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Sun, 28 Apr 2024 23:41:07 +0100 Subject: [PATCH] fix(cli): remove postdeploy gas setting in favor of script options (#2756) --- .changeset/plenty-pianos-boil.md | 7 +++++++ packages/cli/src/utils/postDeploy.ts | 9 --------- 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 .changeset/plenty-pianos-boil.md diff --git a/.changeset/plenty-pianos-boil.md b/.changeset/plenty-pianos-boil.md new file mode 100644 index 0000000000..8f2902df78 --- /dev/null +++ b/.changeset/plenty-pianos-boil.md @@ -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"`. diff --git a/packages/cli/src/utils/postDeploy.ts b/packages/cli/src/utils/postDeploy.ts index de0c2e2390..5e4fc41553 100644 --- a/packages/cli/src/utils/postDeploy.ts +++ b/packages/cli/src/utils/postDeploy.ts @@ -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, @@ -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( [ @@ -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",