* switch to using Context internally
* add context import
* Add smoke test to make sure enabling GSN support works
* Update test/GSN/ERC721GSNRecipientMock.test.js
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Upgrade truffle
* add missing awaits
* Revert "Upgrade truffle"
This reverts commit f9b0ba9019.
45 lines
1.0 KiB
Solidity
45 lines
1.0 KiB
Solidity
pragma solidity ^0.5.0;
|
|
|
|
import "../../GSN/Context.sol";
|
|
import "../Roles.sol";
|
|
|
|
contract PauserRole is Context {
|
|
using Roles for Roles.Role;
|
|
|
|
event PauserAdded(address indexed account);
|
|
event PauserRemoved(address indexed account);
|
|
|
|
Roles.Role private _pausers;
|
|
|
|
constructor () internal {
|
|
_addPauser(_msgSender());
|
|
}
|
|
|
|
modifier onlyPauser() {
|
|
require(isPauser(_msgSender()), "PauserRole: caller does not have the Pauser role");
|
|
_;
|
|
}
|
|
|
|
function isPauser(address account) public view returns (bool) {
|
|
return _pausers.has(account);
|
|
}
|
|
|
|
function addPauser(address account) public onlyPauser {
|
|
_addPauser(account);
|
|
}
|
|
|
|
function renouncePauser() public {
|
|
_removePauser(_msgSender());
|
|
}
|
|
|
|
function _addPauser(address account) internal {
|
|
_pausers.add(account);
|
|
emit PauserAdded(account);
|
|
}
|
|
|
|
function _removePauser(address account) internal {
|
|
_pausers.remove(account);
|
|
emit PauserRemoved(account);
|
|
}
|
|
}
|