diff --git a/packages/bridge-ui/src/erc20/bridge.spec.ts b/packages/bridge-ui/src/erc20/bridge.spec.ts index f9c94170a78..d6186612239 100644 --- a/packages/bridge-ui/src/erc20/bridge.spec.ts +++ b/packages/bridge-ui/src/erc20/bridge.spec.ts @@ -199,7 +199,7 @@ describe("bridge tests", () => { "0xfake", opts.tokenAddress, opts.amountInWei, - BigNumber.from(100000), + BigNumber.from(140000), opts.processingFeeInWei, "0xfake", opts.memo, diff --git a/packages/bridge-ui/src/erc20/bridge.ts b/packages/bridge-ui/src/erc20/bridge.ts index d8a79d18448..f060cc9964d 100644 --- a/packages/bridge-ui/src/erc20/bridge.ts +++ b/packages/bridge-ui/src/erc20/bridge.ts @@ -39,7 +39,7 @@ class ERC20Bridge implements Bridge { callValue: 0, processingFee: opts.processingFeeInWei ?? BigNumber.from(0), gasLimit: opts.processingFeeInWei - ? BigNumber.from(100000) + ? BigNumber.from(140000) : BigNumber.from(0), memo: opts.memo ?? "", }; @@ -103,7 +103,9 @@ class ERC20Bridge implements Bridge { throw Error("token vault does not have required allowance"); } - const { contract, owner, message } = await ERC20Bridge.prepareTransaction(opts); + const { contract, owner, message } = await ERC20Bridge.prepareTransaction( + opts + ); const tx = await contract.sendERC20( message.destChainId, @@ -123,8 +125,9 @@ class ERC20Bridge implements Bridge { } async EstimateGas(opts: BridgeOpts): Promise { - - const { contract, owner, message } = await ERC20Bridge.prepareTransaction(opts); + const { contract, owner, message } = await ERC20Bridge.prepareTransaction( + opts + ); const gasEstimate = await contract.estimateGas.sendERC20( message.destChainId, @@ -178,9 +181,7 @@ class ERC20Bridge implements Bridge { chains[opts.message.destChainId.toNumber()].headerSyncAddress, }); - return await contract.processMessage(opts.message, proof, { - gasLimit: BigNumber.from(1200000), - }); + return await contract.processMessage(opts.message, proof); } else { return await contract.retryMessage(opts.message, false); } diff --git a/packages/bridge-ui/src/eth/bridge.spec.ts b/packages/bridge-ui/src/eth/bridge.spec.ts index f398f5ef1ba..043b5286e62 100644 --- a/packages/bridge-ui/src/eth/bridge.spec.ts +++ b/packages/bridge-ui/src/eth/bridge.spec.ts @@ -88,7 +88,7 @@ describe("bridge tests", () => { expect(mockContract.sendEther).toHaveBeenCalledWith( opts.toChainId, wallet.getAddress(), - BigNumber.from(100000), + BigNumber.from(140000), opts.processingFeeInWei, wallet.getAddress(), "memo", diff --git a/packages/bridge-ui/src/eth/bridge.ts b/packages/bridge-ui/src/eth/bridge.ts index a0cccdef862..bc9c0937df4 100644 --- a/packages/bridge-ui/src/eth/bridge.ts +++ b/packages/bridge-ui/src/eth/bridge.ts @@ -19,7 +19,9 @@ class ETHBridge implements BridgeInterface { this.prover = prover; } - static async prepareTransaction(opts: BridgeOpts): Promise<{contract: Contract, message: any, owner: string}> { + static async prepareTransaction( + opts: BridgeOpts + ): Promise<{ contract: Contract; message: any; owner: string }> { const contract: Contract = new Contract( opts.tokenVaultAddress, TokenVault, @@ -38,7 +40,7 @@ class ETHBridge implements BridgeInterface { callValue: 0, processingFee: opts.processingFeeInWei ?? BigNumber.from(0), gasLimit: opts.processingFeeInWei - ? BigNumber.from(100000) + ? BigNumber.from(140000) : BigNumber.from(0), memo: opts.memo ?? "", }; @@ -56,7 +58,9 @@ class ETHBridge implements BridgeInterface { } async Bridge(opts: BridgeOpts): Promise { - const { contract, owner, message } = await ETHBridge.prepareTransaction(opts); + const { contract, owner, message } = await ETHBridge.prepareTransaction( + opts + ); const tx = await contract.sendEther( message.destChainId, @@ -76,7 +80,9 @@ class ETHBridge implements BridgeInterface { } async EstimateGas(opts: BridgeOpts): Promise { - const { contract, owner, message } = await ETHBridge.prepareTransaction(opts); + const { contract, owner, message } = await ETHBridge.prepareTransaction( + opts + ); const gasEstimate = await contract.estimateGas.sendEther( message.destChainId, @@ -129,9 +135,7 @@ class ETHBridge implements BridgeInterface { const proof = await this.prover.GenerateProof(proofOpts); - return await contract.processMessage(opts.message, proof, { - gasLimit: BigNumber.from(1000000), - }); + return await contract.processMessage(opts.message, proof); } else { return await contract.retryMessage(opts.message); }