Skip to content

Instantly share code, notes, and snippets.

@stamatim
Created February 6, 2020 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stamatim/2ad927b21e3d27b1c26abbc9431aeefe to your computer and use it in GitHub Desktop.
Save stamatim/2ad927b21e3d27b1c26abbc9431aeefe to your computer and use it in GitHub Desktop.
/*
* Basic smart contract layout using Ethereum's Solidity
*/
pragma solidity ^0.4.0; // instructions for compiler on how to treat source code
contract Storage {
uint data; // 256-bit unsigned int state variable
function set(uint x) public { // modify value of state variable
storedData = x;
}
function get() public view returns (uint) { // return value of state variable
return storedData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment