I have tried adjusting the Gas Limit and GWEI and I get this error. I am using infura and Ropsten. Has anyone any ideas about this?
Code -
var rawTransaction = {"from":myAddress,
"gasPrice":web3js.toHex(2*1e9),
"gasLimit":web3js.toHex(7920027),
"to":contractAddress,
"value":"0x0",
"data":contract.addBonus.getData(bonusType, target, year, month, day, token, bonus, bonusName, ineq),
"nonce":nounce}
console.log("raw txn " + rawTransaction);
//creating tranaction via ethereumjs-tx
var transaction = new Tx(rawTransaction);
//signing transaction with private key
transaction.sign(privateKey);
//sending transacton via web3js module
// web3js.eth.sendRawTransaction('0x'+transaction.serialize().toString('hex'))
// .on('transactionHash',console.log);
var serializedTx = transaction.serialize();
web3js.eth.sendRawTransaction('0x'+serializedTx.toString('hex'), function(err, hash) {
if (!err)
console.log("hash = " + hash);
else console.log("err = " + err);
});
I get this error -
err = Error: insufficient funds for gas * price + value