Skip to content

Instantly share code, notes, and snippets.

@dicethedev
Last active August 1, 2022 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dicethedev/d8a759b360e5ce938d79a36798858938 to your computer and use it in GitHub Desktop.
Save dicethedev/d8a759b360e5ce938d79a36798858938 to your computer and use it in GitHub Desktop.
classwork
//SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
contract Counter {
uint public count;
uint timestop = block.timestamp + 30;
function inc() public {
count ++;
}
function dec() public {
count --;
}
function get() public view returns (uint) {
return count;
}
modifier timer() {
require(block.timestamp <= timestop, "your time is up");
_;
}
function Time() public view returns (uint e) {
e = timestop - block.timestamp;
return e;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment