Skip to content

Instantly share code, notes, and snippets.

@hendrawd
Last active March 19, 2018 04:37
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 hendrawd/20c9e75777692a7ac748f568a78accb9 to your computer and use it in GitHub Desktop.
Save hendrawd/20c9e75777692a7ac748f568a78accb9 to your computer and use it in GitHub Desktop.
Hello world code for solidity, a programming language to deploy smart contract to ethereum platform. Online IDE can be found here: http://remix.ethereum.org/
pragma solidity ^0.4.0;
/*
Simple contract that returns a greeting
*/
contract Hodor {
address creator;
string greeting;
function Hodor(string _greeting) {
greeting = _greeting;
creator = msg.sender;
}
// returns the current greeting
function greet() constant returns (string) {
return greeting;
}
// changes the current greeting
function setGreeting(string _greeting) {
greeting = _greeting;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment