Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

490
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda