Skip to content

Instantly share code, notes, and snippets.

@merlox
Created September 25, 2018 21:22
Show Gist options
  • Save merlox/4ff7f87077e4f51879a0129a878d2a1f to your computer and use it in GitHub Desktop.
Save merlox/4ff7f87077e4f51879a0129a878d2a1f to your computer and use it in GitHub Desktop.
Contract = web3.eth.contract(abi)
contractInstance = Contract.new({
value: web3.toWei(valueSelected),
data: bytecode.object,
gas: 7e6
}, (err, result) => {
// This callback will be called twice, the second time includes the contract address
if(!result.address) {
console.log('wait until the block is mined with the contract creation transaction')
} else {
console.log("here's the contract address just deployed", result.address)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment