Skip to content

Instantly share code, notes, and snippets.

Created July 28, 2016 14:30
Show Gist options
  • Save anonymous/29fcacfaa7404b2866e2870a14a288c7 to your computer and use it in GitHub Desktop.
Save anonymous/29fcacfaa7404b2866e2870a14a288c7 to your computer and use it in GitHub Desktop.
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-latest.js&optimize=undefined&gist=
/**
* collection of code (its functions) and data (its state)
* that resides at a specific address on the Ethereum blockchain.
* think of it as a single slot in a database that can be
* queried and altered by calling functions of the code that
* manages the database
* **/
contract SimpleStorage {
//declares a state variable called storedData of type
//uint (unsigned integer of 256 bits)
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment