August 2018
Intermediate to advanced
404 pages
11h 19m
English
You can also deploy the contract using the contract instance. Consider the following example of deploying a contract in both v0.2x.x and v1.x.x to understand more:
var bytecode = output.contracts["HelloWorld"].bytecode;var abi = output.contracts["HelloWorld"].interface;// For v0.2x.xvar helloworldContract = web3.eth.contract(abi); var helloworld = helloworldContract.new({ from: "0xce5C2D181f6DD99091351f6E6056c333A969AEC9", data: byteCode, gas: 4700000 }, function (e, contract){ if (typeof contract.address !== "undefined") { console.log("address: " + contract.address); } });// For v1.x.xvar helloWorld = new web3.eth.Contract(abi);helloWorld.deploy({ data: byteCode, arguments: [] // Constructor arguments }) .send({ from ...