diff --git a/genesis-smart-contracts/Pausable.sol b/genesis-smart-contracts/Pausable.sol new file mode 100644 index 000000000..2dca2343c --- /dev/null +++ b/genesis-smart-contracts/Pausable.sol @@ -0,0 +1,29 @@ +// genesis-smart-contracts/Pausable.sol +pragma solidity ^0.8.0; + +contract Pausable { + bool public paused; + + modifier whenNotPaused() { + require(!paused, "Contract is paused"); + _; + } + + modifier whenPaused() { + require(paused, "Contract is not paused"); + _; + } + + function pause() public onlyOwner { + paused = true; + emit Pause(); + } + + function unpause() public onlyOwner { + paused = false; + emit Unpause(); + } + + event Pause(); + event Unpause(); +}