Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Kill switch: Proof of concept #516

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
contracts: binary kill switch implementation
facuspagnuolo committed Apr 28, 2019
commit c29a3c67c2654e04c1b41e935e56965a176efbf4
28 changes: 28 additions & 0 deletions contracts/kill_switch/base/BinaryKillSwitch.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pragma solidity 0.4.24;

import "./KillSwitch.sol";
import "./IssuesRegistry.sol";


contract BinaryKillSwitch is KillSwitch {
bytes32 constant public SET_IGNORED_CONTRACTS_ROLE = keccak256("SET_IGNORED_CONTRACTS_ROLE");

mapping (address => bool) internal ignoredContracts;

event ContractIgnored(address _contract, bool ignored);

function setContractIgnore(address _contract, bool _ignored) external;

function isContractIgnored(address _contract) public view returns (bool) {
return ignoredContracts[_contract];
}

function isSeverityIgnored(address /*_contract*/, IssuesRegistry.Severity _severity) public view returns (bool) {
return _severity == IssuesRegistry.Severity.None;
}

function _setContractIgnore(address _contract, bool _ignored) internal {
ignoredContracts[_contract] = _ignored;
emit ContractIgnored(_contract, _ignored);
}
}