Skip to content

Instantly share code, notes, and snippets.

@TOMOAKI12345
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save TOMOAKI12345/def0a7af57dc9fab1336 to your computer and use it in GitHub Desktop.

Select an option

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!'
// 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