Created
August 7, 2015 05:19
-
-
Save linagee/f3c07e97fe3357c633b0 to your computer and use it in GitHub Desktop.
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
var helloEthereum = 'contract testContract { function go() constant returns (string) { return "ETHEREUM!"; }}' | |
var helloEthereumCompiled = web3.eth.compile.solidity(helloEthereum) | |
var ethereumContract = web3.eth.contract(helloEthereumCompiled.testContract.info.abiDefinition); | |
var ethereum = ethereumContract.new(null, {from:eth.coinbase, data: helloEthereumCompiled.testContract.code, gas: 34000}, function(e, contract){ | |
if(!e) { | |
if(!contract.address) { | |
console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined..."); | |
} else { | |
console.log("Contract mined! Address: " + contract.address); | |
console.log(contract); | |
} | |
} else { | |
console.log("error"); | |
console.log(e); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment