Last active
December 20, 2017 02:23
-
-
Save devonwesley/c80ba20502c778a94d472c8906a82fa6 to your computer and use it in GitHub Desktop.
Function for blog series
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deployContractEvent(name, contract) { | |
const comfirmMsg = ` | |
Contract: ${name.substring(1)} | |
Network: ${currentNetwork()} | |
Confirm to deploy with these settings. | |
` | |
if (!confirm(comfirmMsg)) return | |
const { bytecode, interface } = contract | |
const newContract = web3.eth.contract(JSON.parse(interface)) | |
const options = { from: web3.eth.accounts[0], data: bytecode, gas: 1000000 } | |
newContract.new(options, newContractCallback(name)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment