Commit f0ed649d by Arseniy Klempner

Add release method to Stoppable. Create StoppableMock

parent 5eea131f
...@@ -2,7 +2,7 @@ pragma solidity ^0.4.0; ...@@ -2,7 +2,7 @@ pragma solidity ^0.4.0;
/* /*
* Stoppable * Stoppable
* Abstract contract that allows children to implement an * Abstract contract that allows children to implement an
* emergency stop mechanism. * emergency stop mechanism.
*/ */
contract Stoppable { contract Stoppable {
address public curator; address public curator;
...@@ -21,4 +21,9 @@ contract Stoppable { ...@@ -21,4 +21,9 @@ contract Stoppable {
stopped = true; stopped = true;
} }
function release() external onlyInEmergency {
if (msg.sender != curator) throw;
stopped = false;
}
} }
pragma solidity ^0.4.0;
import '../Stoppable.sol';
// mock class using Stoppable
contract StoppableMock is Stoppable {
bool public drasticMeasureTaken;
uint public count = 0;
function normalProcess() external stopInEmergency {
count++;
}
function drasticMeasure() external onlyInEmergency {
drasticMeasureTaken = true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment