Skip to content

Instantly share code, notes, and snippets.

@llSourcell
Created March 21, 2018 15:55
Show Gist options
  • Select an option

  • Save llSourcell/7581b4c4cc408b98be27e99018bffae7 to your computer and use it in GitHub Desktop.

Select an option

Save llSourcell/7581b4c4cc408b98be27e99018bffae7 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.16;
contract HelloWorld {
uint256 counter = 5; //state variable we assigned earlier
function add() public { //increases counter by 1
counter++;
}
function subtract() public { //decreases counter by 1
counter--;
}
function getCounter() public constant returns (uint256) {
return counter;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment