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.
40 lines
781 B
40 lines
781 B
pragma solidity ^0.4.24;
|
|
|
|
import "../Roles.sol";
|
|
|
|
|
|
contract PauserRole {
|
|
using Roles for Roles.Role;
|
|
|
|
event PauserAdded(address indexed account);
|
|
event PauserRemoved(address indexed account);
|
|
|
|
Roles.Role private pausers;
|
|
|
|
constructor() public {
|
|
pausers.add(msg.sender);
|
|
}
|
|
|
|
modifier onlyPauser() {
|
|
require(isPauser(msg.sender));
|
|
_;
|
|
}
|
|
|
|
function isPauser(address account) public view returns (bool) {
|
|
return pausers.has(account);
|
|
}
|
|
|
|
function addPauser(address account) public onlyPauser {
|
|
pausers.add(account);
|
|
emit PauserAdded(account);
|
|
}
|
|
|
|
function renouncePauser() public {
|
|
pausers.remove(msg.sender);
|
|
}
|
|
|
|
function _removePauser(address account) internal {
|
|
pausers.remove(account);
|
|
emit PauserRemoved(account);
|
|
}
|
|
}
|
|
|