Last active
March 10, 2023 10:33
-
-
Save aunyks/22be27444d6a9a91d2305c2ea2e2f7e8 to your computer and use it in GitHub Desktop.
A simple counter written in Solidity, for Ethereum.
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
pragma solidity ^0.4.0; | |
contract Counter { | |
int private count = 0; | |
function incrementCounter() public { | |
count += 1; | |
} | |
function decrementCounter() public { | |
count -= 1; | |
} | |
function getCount() public constant returns (int) { | |
return count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for the new version of solidity.