* Bump required compiler version to 0.5.2. * Fix shadowed variable warning in ERC20Migrator. * Rename Counter to Counters. * Add dummy state variable to SafeERC20Helper. * Update changelog entry. * Fix CountersImpl name. * Improve changelog entry.
44 lines
940 B
Solidity
44 lines
940 B
Solidity
pragma solidity ^0.5.2;
|
|
|
|
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 () internal {
|
|
_addPauser(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 {
|
|
_addPauser(account);
|
|
}
|
|
|
|
function renouncePauser() public {
|
|
_removePauser(msg.sender);
|
|
}
|
|
|
|
function _addPauser(address account) internal {
|
|
_pausers.add(account);
|
|
emit PauserAdded(account);
|
|
}
|
|
|
|
function _removePauser(address account) internal {
|
|
_pausers.remove(account);
|
|
emit PauserRemoved(account);
|
|
}
|
|
}
|