Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
f0ed649d
Commit
f0ed649d
authored
Oct 25, 2016
by
Arseniy Klempner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add release method to Stoppable. Create StoppableMock
parent
5eea131f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletions
+23
-1
Stoppable.sol
contracts/Stoppable.sol
+6
-1
StoppableMock.sol
contracts/test-helpers/StoppableMock.sol
+17
-0
No files found.
contracts/Stoppable.sol
View file @
f0ed649d
...
...
@@ -2,7 +2,7 @@ pragma solidity ^0.4.0;
/*
* Stoppable
* Abstract contract that allows children to implement an
* emergency stop mechanism.
* emergency stop mechanism.
*/
contract Stoppable {
address public curator;
...
...
@@ -21,4 +21,9 @@ contract Stoppable {
stopped = true;
}
function release() external onlyInEmergency {
if (msg.sender != curator) throw;
stopped = false;
}
}
contracts/test-helpers/StoppableMock.sol
0 → 100644
View file @
f0ed649d
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;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment