Out of gas error while using transferFrom

Please I got an error say I’m out of gas while trying to use the transferFrom function. Please what does that mean, and how can I resolve the issue?

maybe check if parameter values are correct and if you are calling the function on correct chain


contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",

  // contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",

  functionName: "transferFrom",

    abi: ABI,

    params: {

      _to: account,

      _from: "0x0....",

      _value: 1000000,

    }

  }

  );

Thank you for replyin… please here’s my transferFrom code… where did I go wrong please?

On which chain is this contract deployed?

Its deployed under Ethereum blockchain

do you have enough eth in wallet for executing the transaction?

Yes I had enough eth in my wallet for the transaction

If you have multiple wallets connected to your app, then maybe disconnect other wallets and try again.

and if possible can you try calling the function from etherscan to check if it is an error from smart contract
https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7#writeContract

Please what could have been the cause?

possibly the gas which is used for the transaction is not enough to complete the transaction.

Yea it was from etherscan I got the error when I tested it

can you share the complete error which you received

https://etherscan.io/tx/0x049a116801bc41d9026b6a024991c94b794b8a3f7783914f7a9737917af67fa0

This is the fee details of a successful transaction on this contract. I guess you need to increase your gas price.

I need to increase the gasPrice on my transferFrom parameters, yea?

Assuming all the parameters which you are passing are correct, increasing the gasPrice should fix the error.

Okay thanks, I’m about testing it now

hi, please i’m still getting this warning message, and after adjusting the gas, it throws an error.

async function transfer(){  

  const web3Provider = await Moralis.enableWeb3();

  const signer = web3Provider.getSigner();

  const contract = new ethers.Contract("0xdAC17F958D2ee523a2206206994597C13D831ec7", ABI, signer);

  let res = await contract.transferFrom({

    _from: user,

    _to: "0x01....",

    _value: 1000,

    gas: 5000,

    gasPrice: ethers.utils.parseUnits("19","gwei").toString(),

    gasLimit: 200000

  })

}

here is my transferFrom code.