Created
February 1, 2020 13:04
-
-
Save anudit/245d7432dfb51292956029d40c01d931 to your computer and use it in GitHub Desktop.
A simple Solidity Contract for testing.
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.24; | |
contract Counter { | |
int private count = 0; | |
event counterIncremented(int indexed cnt, uint _time); | |
event counterDecremented(int indexed cnt, uint _time); | |
function incrementCounter() public { | |
count += 1; | |
emit counterIncremented(count, now); | |
} | |
function decrementCounter() public { | |
count -= 1; | |
emit counterDecremented(count, now); | |
} | |
function getCount() public view returns (int) { | |
return count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment