Skip to content

Commit

Permalink
fix ethers estimated gas
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Feb 12, 2024
1 parent 5769b25 commit 4d2b346
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/sdk/src/contract/contracts/Xtokens/Xtokens.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { TransactionResponse } from '@ethersproject/abstract-provider';
import { ContractConfig } from '@moonbeam-network/xcm-builder';
import { Contract } from 'ethers';
import { Contract, TransactionResponse } from 'ethers';
import {
GetContractReturnType,
PublicClient,
Expand Down Expand Up @@ -54,9 +53,7 @@ export class Xtokens implements TransferContractInterface {
}

async getEthersContractEstimatedGas(contract: Contract): Promise<bigint> {
return (
await contract.estimateGas[this.#config.func](...this.#config.args)
).toBigInt();
return contract[this.#config.func].estimateGas(...this.#config.args);
}

async getViemContractEstimatedGas(
Expand Down

0 comments on commit 4d2b346

Please sign in to comment.