PausableMockUpgradeable.sol 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../security/PausableUpgradeable.sol";
  4. import "../proxy/utils/Initializable.sol";
  5. contract PausableMockUpgradeable is Initializable, PausableUpgradeable {
  6. bool public drasticMeasureTaken;
  7. uint256 public count;
  8. function __PausableMock_init() internal onlyInitializing {
  9. __Pausable_init_unchained();
  10. __PausableMock_init_unchained();
  11. }
  12. function __PausableMock_init_unchained() internal onlyInitializing {
  13. drasticMeasureTaken = false;
  14. count = 0;
  15. }
  16. function normalProcess() external whenNotPaused {
  17. count++;
  18. }
  19. function drasticMeasure() external whenPaused {
  20. drasticMeasureTaken = true;
  21. }
  22. function pause() external {
  23. _pause();
  24. }
  25. function unpause() external {
  26. _unpause();
  27. }
  28. /**
  29. * @dev This empty reserved space is put in place to allow future versions to add new
  30. * variables without shifting down storage in the inheritance chain.
  31. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  32. */
  33. uint256[48] private __gap;
  34. }