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.
42 lines
929 B
42 lines
929 B
7 years ago
|
pragma solidity ^0.4.23;
|
||
|
|
||
|
import "./MintableToken.sol";
|
||
|
import "../../ownership/rbac/RBAC.sol";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @title RBACMintableToken
|
||
|
* @author Vittorio Minacori (@vittominacori)
|
||
|
* @dev Mintable Token, with RBAC minter permissions
|
||
|
*/
|
||
|
contract RBACMintableToken is MintableToken, RBAC {
|
||
|
/**
|
||
|
* A constant role name for indicating minters.
|
||
|
*/
|
||
|
string public constant ROLE_MINTER = "minter";
|
||
|
|
||
|
/**
|
||
|
* @dev override the Mintable token modifier to add role based logic
|
||
|
*/
|
||
|
modifier hasMintPermission() {
|
||
|
checkRole(msg.sender, ROLE_MINTER);
|
||
|
_;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @dev add a minter role to an address
|
||
|
* @param minter address
|
||
|
*/
|
||
|
function addMinter(address minter) onlyOwner public {
|
||
|
addRole(minter, ROLE_MINTER);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @dev remove a minter role from an address
|
||
|
* @param minter address
|
||
|
*/
|
||
|
function removeMinter(address minter) onlyOwner public {
|
||
|
removeRole(minter, ROLE_MINTER);
|
||
|
}
|
||
|
}
|