Last active
August 1, 2022 16:16
-
-
Save Realkayzee/9927f8c3038b8ab906d5f6af9b867387 to your computer and use it in GitHub Desktop.
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.7; | |
| contract CountAfterSeconds{ | |
| uint public count; | |
| uint today; | |
| constructor(){ | |
| today = block.timestamp; | |
| } | |
| function add() public{ | |
| require(block.timestamp <= today + 30 seconds); | |
| count++; | |
| } | |
| function dec() public{ | |
| require(block.timestamp <= today + 30 seconds); | |
| count--; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment