Skip to content

Instantly share code, notes, and snippets.

@Realkayzee
Last active August 1, 2022 16:16
Show Gist options
  • Select an option

  • Save Realkayzee/9927f8c3038b8ab906d5f6af9b867387 to your computer and use it in GitHub Desktop.

Select an option

Save Realkayzee/9927f8c3038b8ab906d5f6af9b867387 to your computer and use it in GitHub Desktop.
//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