I am trying to deploy a contract with web3 1.0.0 like:
myContract.deploy({})
.send({
from: '0x1234567890123456789012345678901234567891',
gas: 1500000,z
gasPrice: '20000000000000'
}, function(error, transactionHash){ ... })
.on('error', function(error){ ... })
.on('transactionHash', function(transactionHash){ ... })
.on('receipt', function(receipt){
console.log(receipt.contractAddress)
})
and I get the following error:
Script failed: Error: Returned error: invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go struct field SendTxArgs.data of type hexutil.Bytes
Previously I am using the same address to get the contract, and it is in hex format(0x...).
let contract = new web3.eth.Contract(abi, {from: '0x1234567890123456789012345678901234567891', gas: 47000, data: bytecode});
and it is correct. So I do not know what can be the problem.