Last active
March 19, 2018 04:37
-
-
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/
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
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