You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
602 B
29 lines
602 B
8 years ago
|
pragma solidity ^0.4.4;
|
||
|
|
||
|
|
||
|
import "./Ownable.sol";
|
||
|
|
||
|
|
||
|
/*
|
||
|
* Stoppable
|
||
|
* Abstract contract that allows children to implement an
|
||
|
* emergency stop mechanism.
|
||
|
*/
|
||
|
contract Stoppable is Ownable {
|
||
|
bool public stopped;
|
||
|
|
||
|
modifier stopInEmergency { if (!stopped) _; }
|
||
|
modifier onlyInEmergency { if (stopped) _; }
|
||
|
|
||
|
// called by the owner on emergency, triggers stopped state
|
||
|
function emergencyStop() external onlyOwner {
|
||
|
stopped = true;
|
||
|
}
|
||
|
|
||
|
// called by the owner on end of emergency, returns to normal state
|
||
|
function release() external onlyOwner onlyInEmergency {
|
||
|
stopped = false;
|
||
|
}
|
||
|
|
||
|
}
|