Skip to content

Instantly share code, notes, and snippets.

@linagee
Created August 7, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linagee/f3c07e97fe3357c633b0 to your computer and use it in GitHub Desktop.
Save linagee/f3c07e97fe3357c633b0 to your computer and use it in GitHub Desktop.
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