Files
openzeppelin-contracts/contracts/token/ERC20/RBACMintableToken.sol
Vittorio Minacori ca9e317259 Update Truffle and Solium (#1105)
* fixed visibility warnings

* solved visibility and line length warning

* change a test assertion that fails due to chai dependence update

* linter, constructor style and solved visibility warnings

* Changed Windows line endings to Unix.
2018-08-01 10:11:37 -03:00

42 lines
932 B
Solidity

pragma solidity ^0.4.24;
import "./MintableToken.sol";
import "../../access/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) public onlyOwner {
addRole(_minter, ROLE_MINTER);
}
/**
* @dev remove a minter role from an address
* @param _minter address
*/
function removeMinter(address _minter) public onlyOwner {
removeRole(_minter, ROLE_MINTER);
}
}