Stoppable.sol 613 B

1234567891011121314151617181920212223242526272829
  1. pragma solidity ^0.4.0;
  2. /*
  3. * Stoppable
  4. * Abstract contract that allows children to implement an
  5. * emergency stop mechanism.
  6. */
  7. contract Stoppable {
  8. address public curator;
  9. bool public stopped;
  10. modifier stopInEmergency { if (!stopped) _; }
  11. modifier onlyInEmergency { if (stopped) _; }
  12. function Stoppable(address _curator) {
  13. if (_curator == 0) throw;
  14. curator = _curator;
  15. }
  16. function emergencyStop() external {
  17. if (msg.sender != curator) throw;
  18. stopped = true;
  19. }
  20. function release() external onlyInEmergency {
  21. if (msg.sender != curator) throw;
  22. stopped = false;
  23. }
  24. }