Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Insufficient gas funds for web3js transaction

I am doing an ERC20 transfer (contract name is quad_ek) on ropsten testnet using web3js and my metamask address (called first account and it's also signinfo). I have about 10Eth in my metamask address on testnet

I specified a gas limit of 460000

        const balance_first_account = await quad_ek.methods.balanceOf(first_account).call()
        console.log("token balance first account", balance_first_account.toString())
        console.log("eth in first account", await web3.eth.getBalance(first_account))
    
        const gas = new BigNumber('4600000')
        const gasData = await axios.get("https://api.etherscan.io/api?module=gastracker&action=gasoracle")
        const gasPriceFast = gasData.data.result.FastGasPrice
        const gasPrice = web3.utils.toWei(gas.times(gasPriceFast).toFixed(), 'gwei')
        console.log("gasPrice in wei from etherscan oracle", gasPrice)
        console.log(gasPrice)
     

        const txParams = {
            from: signInfo.address,
            nonce: '0x' + nonce.toString(16),
            gasPrice: gasPrice,
            gasLimit: '0x' + gas.toString(16),
            to: '0x70cf6330b93e465204d0aAc8976Fa2Fef47F6082',
            data: quad_ek.methods.transfer(seventh_account, web3.utils.toWei("14500000")).encodeABI(),
            value: gasPrice,
            chainId: 0x03
        }

        console.log('signinfo address', signInfo.address)

        
        const tx = await signInfo.signTransaction(txParams)
        const txHash = await web3.eth.sendSignedTransaction(tx.rawTransaction)
        
        const balance_first_account_after_tx = await quad_ek.methods.balanceOf(first_account).call()
        console.log("balance first account after tx", balance_first_account_after_tx.toString())
        console.log(txHash)

Output I get:

first_account 0x72707D86053cb767A710957a6b9D8b56Dd7Fd835
eth in first account 9897892440000000000
seventh_account 0xfeBb6F8A30a68226D791B7d0dC6d557709d837a0
nonce 10
token name Quadency Token
token symbol QUAD
totalSupply 400000000000000000000000000
token balance first account 308000000000000000000000000
eth in first account 9897892440000000000
gasPrice in wei from etherscan oracle 78200000000000000
78200000000000000
signinfo address 0x72707D86053cb767A710957a6b9D8b56Dd7Fd835
{ code: -32000, message: 'insufficient funds for gas * price + value' }

Do I need to change my transaction parameters?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!