I try to create a smart contract (Simple TokenERC20) with sendRawTransaction().
var firstMainadress = '0x3c7B83E0Fa6f19B1B61e80A73630cB5Db48b700C';
var secondAdress = '0x38ebbB608fbb40fca07e0EcBAc89e20520BD33f1';
var privateKey = new Buffer('xxxprivateKeyThatIcantShowHere...','hex')
var data = this.byteCode;
var nonce = this.web3.toHex(this.web3.eth.getTransactionCount(firstMainadress));
var gasPrice = this.web3.toHex(1000000000);
var gasLimitHex = this.web3.toHex(1253608);
var rawTx = { 'data': data, 'nonce': nonce, 'gasPrice': gasPrice, 'gasLimit': gasLimitHex, 'from': firstMainadress};
var tx = new Tx(rawTx);
tx.sign(privateKey);
var serializedTx = '0x'+tx.serialize().toString('hex')
this.web3.eth.sendRawTransaction(serializedTx, function(err, txHash){
console.log(err, txHash);
this.deployedContract = txHash;
})
the txHash is not null, and when i put it on etherscan, i see the bellow error :
Can someone help me to found why i have this error message : Warning! Error encountered during contract execution [Out of gas]
Thnaks a lot for your help :)
0x36303630..
and most contracts created with solidity is0x6060..
.