* 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 SignerRole {
|
|
using Roles for Roles.Role;
|
|
|
|
event SignerAdded(address indexed account);
|
|
event SignerRemoved(address indexed account);
|
|
|
|
Roles.Role private _signers;
|
|
|
|
constructor () internal {
|
|
_addSigner(msg.sender);
|
|
}
|
|
|
|
modifier onlySigner() {
|
|
require(isSigner(msg.sender));
|
|
_;
|
|
}
|
|
|
|
function isSigner(address account) public view returns (bool) {
|
|
return _signers.has(account);
|
|
}
|
|
|
|
function addSigner(address account) public onlySigner {
|
|
_addSigner(account);
|
|
}
|
|
|
|
function renounceSigner() public {
|
|
_removeSigner(msg.sender);
|
|
}
|
|
|
|
function _addSigner(address account) internal {
|
|
_signers.add(account);
|
|
emit SignerAdded(account);
|
|
}
|
|
|
|
function _removeSigner(address account) internal {
|
|
_signers.remove(account);
|
|
emit SignerRemoved(account);
|
|
}
|
|
}
|