* Updated code style to 4 spaces and 120 max characters per line. * Update contracts/token/ERC721/ERC721Pausable.sol Co-Authored-By: nventuro <nicolas.venturo@gmail.com> * Update contracts/token/ERC721/IERC721.sol Co-Authored-By: nventuro <nicolas.venturo@gmail.com>
44 lines
941 B
Solidity
44 lines
941 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
import "../Roles.sol";
|
|
|
|
contract MinterRole {
|
|
using Roles for Roles.Role;
|
|
|
|
event MinterAdded(address indexed account);
|
|
event MinterRemoved(address indexed account);
|
|
|
|
Roles.Role private _minters;
|
|
|
|
constructor () internal {
|
|
_addMinter(msg.sender);
|
|
}
|
|
|
|
modifier onlyMinter() {
|
|
require(isMinter(msg.sender));
|
|
_;
|
|
}
|
|
|
|
function isMinter(address account) public view returns (bool) {
|
|
return _minters.has(account);
|
|
}
|
|
|
|
function addMinter(address account) public onlyMinter {
|
|
_addMinter(account);
|
|
}
|
|
|
|
function renounceMinter() public {
|
|
_removeMinter(msg.sender);
|
|
}
|
|
|
|
function _addMinter(address account) internal {
|
|
_minters.add(account);
|
|
emit MinterAdded(account);
|
|
}
|
|
|
|
function _removeMinter(address account) internal {
|
|
_minters.remove(account);
|
|
emit MinterRemoved(account);
|
|
}
|
|
}
|