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.
39 lines
780 B
39 lines
780 B
pragma solidity ^0.4.24;
|
|
|
|
import "../Roles.sol";
|
|
|
|
contract CapperRole {
|
|
using Roles for Roles.Role;
|
|
|
|
event CapperAdded(address indexed account);
|
|
event CapperRemoved(address indexed account);
|
|
|
|
Roles.Role private cappers;
|
|
|
|
constructor() public {
|
|
cappers.add(msg.sender);
|
|
}
|
|
|
|
modifier onlyCapper() {
|
|
require(isCapper(msg.sender));
|
|
_;
|
|
}
|
|
|
|
function isCapper(address account) public view returns (bool) {
|
|
return cappers.has(account);
|
|
}
|
|
|
|
function addCapper(address account) public onlyCapper {
|
|
cappers.add(account);
|
|
emit CapperAdded(account);
|
|
}
|
|
|
|
function renounceCapper() public {
|
|
cappers.remove(msg.sender);
|
|
}
|
|
|
|
function _removeCapper(address account) internal {
|
|
cappers.remove(account);
|
|
emit CapperRemoved(account);
|
|
}
|
|
}
|
|
|