Stoppable.sol 467 B

1234567891011121314151617181920212223
  1. pragma solidity ^0.4.4;
  2. import "./Ownable.sol";
  3. /*
  4. * Stoppable
  5. * Abstract contract that allows children to implement an
  6. * emergency stop mechanism.
  7. */
  8. contract Stoppable is Ownable {
  9. bool public stopped;
  10. modifier stopInEmergency { if (!stopped) _; }
  11. modifier onlyInEmergency { if (stopped) _; }
  12. function emergencyStop() external onlyOwner {
  13. stopped = true;
  14. }
  15. function release() external onlyOwner onlyInEmergency {
  16. stopped = false;
  17. }
  18. }