In order to deploy a smart contract to the network we need three the following informat:
From web3 spec:
// deploy new contract
var contractInstance = MyContract.new([constructorParam1] [, constructorParam2], {data: '0x12345...', from: myAccount, gas: 1000000});
Correct me if I am wrong:
constructorParams
- all the data that is passed to the smart contract constructor,
from
- determines the address this contract is deployed from
gas
- gas limit on how much this transaction can consume
What is data
, is it sort of a compiled solidity code of the contract, if so why then do we need it if we have already specified ABI of this contract?
How do I get this data
parameter? I also get an error in my console when I try to deploy the contract to the network without specifying data
parameter:
Error: "invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go struct field SendTxArgs.data of type hexutil.Bytes"