Skip to content

Instantly share code, notes, and snippets.

@anudit
Created February 1, 2020 13:04
Show Gist options
  • Save anudit/245d7432dfb51292956029d40c01d931 to your computer and use it in GitHub Desktop.
Save anudit/245d7432dfb51292956029d40c01d931 to your computer and use it in GitHub Desktop.
A simple Solidity Contract for testing.
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