-
-
Save frankhillard/a37905470bbb789dbe7eb514a6b3091c to your computer and use it in GitHub Desktop.
tezos ecosystem snippet 5
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
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