Skip to content

Instantly share code, notes, and snippets.

@casweeney
Last active August 1, 2022 17:55
Show Gist options
  • Save casweeney/37558764c1bedcbf7e03fe8c51436eb1 to your computer and use it in GitHub Desktop.
Save casweeney/37558764c1bedcbf7e03fe8c51436eb1 to your computer and use it in GitHub Desktop.
Class Test
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
contract Counter {
uint256 count;
uint256 restrictionTime = block.timestamp + 30;
function add() public {
require(block.timestamp < restrictionTime, "restriction time reached");
count++;
}
function decrement() public {
require(block.timestamp < restrictionTime, "restriction time reached");
count--;
}
function showCount() public view returns (uint256) {
return count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment