diff --git a/.changeset/dull-adults-sneeze.md b/.changeset/dull-adults-sneeze.md new file mode 100644 index 000000000..168f1f662 --- /dev/null +++ b/.changeset/dull-adults-sneeze.md @@ -0,0 +1,6 @@ +--- +'@chugsplash/core': patch +'@chugsplash/executor': patch +--- + +Execution gas cost estimation bug fixes diff --git a/packages/core/src/fund.ts b/packages/core/src/fund.ts index c62910155..413ea53be 100644 --- a/packages/core/src/fund.ts +++ b/packages/core/src/fund.ts @@ -82,19 +82,21 @@ export const estimateExecutionGas = async ( .map(async (action: DeployImplementationAction) => ethers.BigNumber.from(350_000).add( await provider.estimateGas({ - to: ethers.constants.AddressZero, data: action.code, }) ) ) - const resolvedDeploymentPromises = await Promise.all( + const resolvedContractDeploymentPromises = await Promise.all( deployedProxyPromises.concat(deployedImplementationPromises) ) - estimatedGas = estimatedGas.add( - resolvedDeploymentPromises.reduce((a, b) => a.add(b)) - ) + const estimatedContractDeploymentGas = + resolvedContractDeploymentPromises.length > 0 + ? resolvedContractDeploymentPromises.reduce((a, b) => a.add(b)) + : ethers.BigNumber.from(0) + + estimatedGas = estimatedGas.add(estimatedContractDeploymentGas) return estimatedGas } diff --git a/packages/executor/src/index.ts b/packages/executor/src/index.ts index d424903dc..89a2b4538 100644 --- a/packages/executor/src/index.ts +++ b/packages/executor/src/index.ts @@ -151,7 +151,7 @@ export class ChugSplashExecutor extends BaseServiceV2 { ) } else { this.logger.info( - `Etherscan config not detected for: ${this.options.network}. Skipped verifying ChugSplash contracts.` + `Skipped verifying ChugSplash contracts. Reason: Etherscan config not detected for: ${this.options.network}.` ) } } @@ -297,7 +297,7 @@ export class ChugSplashExecutor extends BaseServiceV2 { ) } else { this.logger.info( - `Etherscan config not detected for network: ${this.options.network}. Skipped verifying project: ${projectName}.` + `Skipped verifying project: ${projectName}. Reason: Etherscan config not detected for network: ${this.options.network}.` ) } } catch (e) {