Created
July 25, 2017 16:59
-
-
Save naterush/79b585a5cdd9537fc0af95b75458b87d to your computer and use it in GitHub Desktop.
A simple storage contract as an introduction to Solidity.
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
//Tell the Solidity compiler what version to use | |
pragma solidity ^0.4.8; | |
//Declares a new contract | |
contract SimpleStorage { | |
//Storage. Persists in between transactions | |
uint x; | |
//Allows the unsigned integer stored to be changed | |
function set(uint newValue) { | |
x = newValue; | |
} | |
//Returns the currently stored unsigned integer | |
function get() returns (uint) { | |
return x; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment