Search code examples
solidityweb3js

Error: Returned error: insufficient funds for gas * price + value at Object.ErrorResponse


screenshot of faced issue 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?


Solution

  • 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.