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

491
Views
Web3: insufficient funds for gas * price + value

I'm trying to transfer an erc-721 token between to different wallets. They're both connected to the ropsten network, and should have sufficient funds (0.08 and 0.1 eth) to make a transaction. However, I still get an error saying that

Something went wrong when submitting your transaction: Error: Returned error: insufficient funds for gas * price + value

I've looked at the other questions regarding this, but I didn't find much useful.

Code:

async function transfer(token, tokenId) {
    const contract = new web3.eth.Contract(abi, token);

      
    try {

        const tx = {
            from: publicKey,
            to: token,
            gas: 30000,
            value: 0,
            chain: "rinkeby",
            baseChain: "rinkeby",
            hardfork: "berlin",
            data: contract.methods
                .transferFrom(publicKey, toAddress, tokenId)
                .encodeABI(),
        };

        const signed = await web3.eth.accounts.signTransaction(tx, privateKey);
        const hash = await sendTx(signed);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

try specify the gasPrice you want to use too,

like,

'gasPrice': web3.toWei('5','gwei')

your code:

async function transfer(token, tokenId) {
    const contract = new web3.eth.Contract(abi, token);

      
    try {

        const tx = {
            from: publicKey,
            to: token,
            gas: 30000,
            gasPrice: web3.toWei('5','gwei'),
            value: 0,
            chain: "rinkeby",
            baseChain: "rinkeby",
            hardfork: "berlin",
            data: contract.methods
                .transferFrom(publicKey, toAddress, tokenId)
                .encodeABI(),
        };

        const signed = await web3.eth.accounts.signTransaction(tx, privateKey);
        const hash = await sendTx(signed);

ofcourse you would need to adjust the gasPrice according to the network

about 4 years ago · Juan Pablo Isaza Report
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!