Last active
March 4, 2018 13:54
-
-
Save tempofeng/126e62ae26401af7e06022896c5247cc to your computer and use it in GitHub Desktop.
greeter Smart Contract
This file contains 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
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