Error: Internal JSON-RPC error.
{
"code": -32000,
"message": "insufficient funds for gas * price + value: have 9764330700000000 want 10000000000000000",
"cause": null
}
I understand its informing me I do not have enough funds to pay for the transaction however this is on arbitrum and the transaction works at times and doesn’t at others. I have $36 in eth which is equal to the error above stating I have 97… and it wants 1000… on the arbitrum network and when the tx works it doesn’t cost more than a dollar. This is very confusing for me.
const gasPrice = await web3.eth.getGasPrice()
const initiatorNonce = await web3.eth.getTransactionCount(initiator)
const transferData = await contract.methods.deploy(bytecode, newSalt).encodeABI()
const estimateGas = await contract.methods.deploy(bytecode, newSalt).estimateGas({ from: initiator })
// console.log(estimateGas)
const transferTX = {
from: initiator,
to: arbc2,
nonce: web3.utils.toHex(initiatorNonce), // don't forget to increment initiator's nonce
gasLimit: web3.utils.toHex(Math.round(gasPrice)),
gasPrice: web3.utils.toHex(Math.round(gasPrice)),
data: transferData,
value: "0x"
}
const signedTransferTX = await web3.eth.accounts.signTransaction(transferTX, initiatorPK)
const complete = await web3.eth.sendSignedTransaction(signedTransferTX.rawTransaction)
Just an added note - I have tried increasing the gasPrice however this simply gives the same error and increases the want
figure.