Stoppable.sol 502 B

123456789101112131415161718192021222324
  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. }