Skip to content

Commit

Permalink
Create Pausable.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 20, 2024
1 parent e2772c0 commit c178442
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions genesis-smart-contracts/Pausable.sol
Original file line number Diff line number Diff line change
@@ -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();
}

0 comments on commit c178442

Please sign in to comment.