Last active
August 1, 2022 17:55
-
-
Save casweeney/37558764c1bedcbf7e03fe8c51436eb1 to your computer and use it in GitHub Desktop.
Class Test
This file contains hidden or 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
// 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