TimersBlockNumberImplUpgradeable.sol 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../utils/TimersUpgradeable.sol";
  4. import "../proxy/utils/Initializable.sol";
  5. contract TimersBlockNumberImplUpgradeable is Initializable {
  6. function __TimersBlockNumberImpl_init() internal onlyInitializing {
  7. }
  8. function __TimersBlockNumberImpl_init_unchained() internal onlyInitializing {
  9. }
  10. using TimersUpgradeable for TimersUpgradeable.BlockNumber;
  11. TimersUpgradeable.BlockNumber private _timer;
  12. function getDeadline() public view returns (uint64) {
  13. return _timer.getDeadline();
  14. }
  15. function setDeadline(uint64 timestamp) public {
  16. _timer.setDeadline(timestamp);
  17. }
  18. function reset() public {
  19. _timer.reset();
  20. }
  21. function isUnset() public view returns (bool) {
  22. return _timer.isUnset();
  23. }
  24. function isStarted() public view returns (bool) {
  25. return _timer.isStarted();
  26. }
  27. function isPending() public view returns (bool) {
  28. return _timer.isPending();
  29. }
  30. function isExpired() public view returns (bool) {
  31. return _timer.isExpired();
  32. }
  33. /**
  34. * This empty reserved space is put in place to allow future versions to add new
  35. * variables without shifting down storage in the inheritance chain.
  36. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  37. */
  38. uint256[49] private __gap;
  39. }