Stoppable.sol 476 B

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