Last active
August 29, 2015 14:26
-
-
Save TOMOAKI12345/def0a7af57dc9fab1336 to your computer and use it in GitHub Desktop.
https://www.ethereum.org/greeter tutorial greeter contract created. By execusing the following code on ethereum console, you will see 'Hello world from 0804 Smart Contract Japan meeting!'
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
| // Greeter contract on main net | |
| > var address = '0x7717efe25b65c8c0fcb97a170b086c17b025a1e1' | |
| > var abi = [{ constant: false, inputs: [ ], name: 'kill', outputs: [ ], type: 'function' }, { constant: true, inputs: [ ], name: 'greet', outputs: [{ name: '', type: 'string' } ], type: 'function' }, { inputs: [{ name: '_greeting', type: 'string' } ], type: 'constructor' } ] | |
| // call the greeter contract | |
| > var greeterFactory = eth.contract(abi) | |
| // contract address | |
| > var greeterInstance = greeterFactory.at('0x7717efe25b65c8c0fcb97a170b086c17b025a1e1') | |
| > greeterInstance | |
| { | |
| address: '0x7717efe25b65c8c0fcb97a170b086c17b025a1e1', | |
| allEvents: function (), | |
| greet: function (), | |
| kill: function () | |
| } | |
| >greeterInstance.greet() | |
| 'Hello world from 0804 Smart Contract Japan meeting!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment