Skip to content

Instantly share code, notes, and snippets.

@Ultra-Tech-code
Last active August 8, 2022 09:59
Show Gist options
  • Save Ultra-Tech-code/f2c723e31bb4e997b1e281216bc38bec to your computer and use it in GitHub Desktop.
Save Ultra-Tech-code/f2c723e31bb4e997b1e281216bc38bec to your computer and use it in GitHub Desktop.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract examole{
uint count;
uint timeframe = block.timestamp + 30 seconds;
// uint timeframe;
modifier timer{
require(block.timestamp <= timeframe, "time has elapsed");
_;
}
function add() public timer{
count++;
}
function decrement() public timer{
count--;
}
function getCount() public view returns(uint){
return count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment