Stoppable.sol 504 B

123456789101112131415161718192021222324252627
  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) {
  13. throw;
  14. }
  15. curator = _curator;
  16. }
  17. function emergencyStop() external {
  18. if (msg.sender != curator) {
  19. throw;
  20. }
  21. stopped = true;
  22. }
  23. }