diff --git a/.changeset/khaki-days-float.md b/.changeset/khaki-days-float.md new file mode 100644 index 0000000000..0c98ce9582 --- /dev/null +++ b/.changeset/khaki-days-float.md @@ -0,0 +1,5 @@ +--- +"@hyperlane-xyz/sdk": patch +--- + +Allow gasLimit overrides in the SDK/CLI for deploy txs diff --git a/typescript/sdk/src/providers/MultiProvider.ts b/typescript/sdk/src/providers/MultiProvider.ts index 572cf929a2..219a73f5c9 100644 --- a/typescript/sdk/src/providers/MultiProvider.ts +++ b/typescript/sdk/src/providers/MultiProvider.ts @@ -302,15 +302,17 @@ export class MultiProvider extends ChainMetadataManager { const contractFactory = await factory.connect(signer); // estimate gas - const deployTx = contractFactory.getDeployTransaction(...params, overrides); + const deployTx = contractFactory.getDeployTransaction(...params); const gasEstimated = await signer.estimateGas(deployTx); // deploy with 10% buffer on gas limit const contract = await contractFactory.deploy(...params, { - ...overrides, gasLimit: gasEstimated.add(gasEstimated.div(10)), // 10% buffer + ...overrides, }); + this.logger.trace({ transaction: deployTx }, `Deploying contract`); + // wait for deploy tx to be confirmed await this.handleTx(chainNameOrId, contract.deployTransaction);