Last active
August 1, 2022 16:27
-
-
Save dicethedev/d8a759b360e5ce938d79a36798858938 to your computer and use it in GitHub Desktop.
classwork
This file contains 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 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