Skip to content

Instantly share code, notes, and snippets.

@tempofeng
Last active March 4, 2018 13:54
Show Gist options
  • Save tempofeng/126e62ae26401af7e06022896c5247cc to your computer and use it in GitHub Desktop.
Save tempofeng/126e62ae26401af7e06022896c5247cc to your computer and use it in GitHub Desktop.
greeter Smart Contract
contract greeter {
/* Define variable greeting of the type string */
string greeting;
/* This runs when the contract is executed */
function greeter(string _greeting) public {
greeting = _greeting;
}
/* Main function */
function greet() constant returns (string) {
return greeting;
}
/* Update greeting */
function newGreeting(string _greeting) public returns (string) {
greeting = _greeting;
return greeting;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment