0

I'm trying to deploy a contract on rinkeby testnet and I receive this error message: "Returned error: intrinsic gas too low".

This is my code:

web3.eth.getTransactionCount(address1,(err,txCount)=> {
    let rawTx={
        nonce: web3.utils.toHex(txCount),
        gasLimit: web3.utils.toHex(21000),
        gasPrice: web3.utils.toHex(web3.utils.toWei('5','gwei')),
        from: address1,
        to: null,
        data: '0x' + bytecode
    }

    const tx = new Ethereumjs(rawTx, { chain: 'rinkeby' })
    tx.sign(address1Key);
    var serializedTx = tx.serialize();
    web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'))
        .on('receipt', console.log);
})

THANK YOU FOR YOUR HELP :)

I tried changing gasLimit and gasPrice but always same error message.

1 Answer 1

0

You may have a complex transaction that makes the gas fee unpredictable. Please see:

https://blog.logrocket.com/understanding-resolving-metamask-error-codes/#:~:text=Also%2C%20there's%20a%20fairly%20common,less%20than%20what%20is%20required.

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.