enter image description here I am using web3 version 1.3.3 and tried to call the contract method using send() but it is showing an error above( Error: Returned error: insufficient funds for gas * price + value at Object.ErrorResponse )

const ERC20ListInst = await this.contract;
const res = await ERC20ListInst.methods.tokenToWei(addr, this.web3.utils.toHex(amount)).send({
   from: this.web3.eth.defaultAccount,
   gas: 100000

I have enough eth on the account and can't sure why this is happening. Is there anyone has faced this one before?

  • Are you testing against a public testnet or a private testnet? How do you connect to it? Is the node fully synchronized? – Ismael Feb 13 at 2:06
  • I am testing it with Goerli testnet. Thanks – RemoteDev Feb 13 at 5:22
  • Are you using infura or your own node? Are you sure this.web3.eth.defaultAccount has enough balance to pay for the transaction? – Ismael Feb 13 at 22:27
  • I am using infura and also account has enough balance I think (0.6eth). – RemoteDev Feb 14 at 6:51

There was issue on truffle wallet provider url. I was going to use Goerli and there was enough fund but I wrote with mainnet url. So it was checking mainnet account and showing me insufficient balance. After I indicate wallet provider to goerli then it worked. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.