Skip to content

Instantly share code, notes, and snippets.

@frankhillard
Created November 22, 2019 17:29
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 frankhillard/a37905470bbb789dbe7eb514a6b3091c to your computer and use it in GitHub Desktop.
Save frankhillard/a37905470bbb789dbe7eb514a6b3091c to your computer and use it in GitHub Desktop.
tezos ecosystem snippet 5
contract Counter {
int private counter;
int private previousCounter;
constructor() public {
counter = 0;
previousCounter = -999; // undefined
}
function increaseCounterBy(int value) external {
previousCounter = counter;
counter = counter - value;
}
function decreaseCounterBy(int value) external {
previousCounter = counter;
counter = counter - value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment