From b0a2e67cc11b5f8573f386e199964161a60b8229 Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Sun, 8 Dec 2024 23:23:00 +0000 Subject: [PATCH] Deploy estimations by default always --- src/cli/config/options.ts | 2 +- src/cli/deploySimulationsContract.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cli/config/options.ts b/src/cli/config/options.ts index 6e1e5e86..6c3079f4 100644 --- a/src/cli/config/options.ts +++ b/src/cli/config/options.ts @@ -469,7 +469,7 @@ export const debugOptions: CliCommandOptions = { "Should the bundler deploy the simulations contract on startup", type: "boolean", require: true, - default: false + default: true }, tenderly: { description: "RPC url follows the tenderly format", diff --git a/src/cli/deploySimulationsContract.ts b/src/cli/deploySimulationsContract.ts index da950b4f..9b9be004 100644 --- a/src/cli/deploySimulationsContract.ts +++ b/src/cli/deploySimulationsContract.ts @@ -24,6 +24,16 @@ export const deploySimulationsContract = async ({ ) } + if (args.entrypointSimulationContract) { + const simulations = args.entrypointSimulationContract + const simulationsCode = await publicClient.getCode({ + address: simulations + }) + if (simulationsCode !== undefined && simulationsCode !== "0x") { + return args.entrypointSimulationContract + } + } + const walletClient = createWalletClient({ transport: http(args.rpcUrl), account: utilityPrivateKey