Last active
June 10, 2021 17:03
-
-
Save linagee/c011d1a2f7de0c359d07 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 helloEthereumContract = 'contract testContract { function go() constant returns (string) { return "Hello Ethereum!"; }}' | |
var helloEthereumCompiled = web3.eth.compile.solidity(helloEthereumContract) | |
var ethereumContract = web3.eth.contract(helloEthereumCompiled.testContract.info.abiDefinition); | |
var helloEthereum = ethereumContract.new({from:eth.coinbase, data: helloEthereumCompiled.testContract.code, gas: 199352}, function(e, contract){ | |
console.log("CALLBACK!"); | |
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); | |
} | |
}) | |
(Once it has been deployed, takes some time, check TX on etherchain.org) | |
helloEthereum.go() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment