Minter
Inherits: Policy, RolesConsumer
Olympus Minter Policy Contract
This policy is to enable minting of OHM by the DAO MS to support test runs of new products which have not been automated yet. This policy will be removed once the protocol completes feature development and the DAO no longer needs to test products. This policy requires categories to be created to designate the purpose for minted OHM, which can be tracked externally from automated systems.
State Variables
MINTR
MINTRv1 internal MINTR;
categories
List of approved categories for logging OHM mints
bytes32[] public categories;
categoryApproved
Whether a category is approved for logging
This is used to prevent logging of mint events that are not consistent with standardized names
mapping(bytes32 => bool) public categoryApproved;
Functions
constructor
constructor(Kernel kernel_) Policy(kernel_);
configureDependencies
Define module dependencies for this policy.
function configureDependencies() external override returns (Keycode[] memory dependencies);
Returns
Name | Type | Description |
---|---|---|
dependencies | Keycode[] | - Keycode array of module dependencies. |
requestPermissions
Function called by kernel to set module function permissions.
function requestPermissions() external view override returns (Permissions[] memory requests);
Returns
Name | Type | Description |
---|---|---|
requests | Permissions[] | - Array of keycodes and function selectors for requested permissions. |
onlyApproved
modifier onlyApproved(bytes32 category_);
mint
Mint OHM to an address
function mint(address to_, uint256 amount_, bytes32 category_)
external
onlyRole("minter_admin")
onlyApproved(category_);
Parameters
Name | Type | Description |
---|---|---|
to_ | address | Address to mint OHM to |
amount_ | uint256 | Amount of OHM to mint |
category_ | bytes32 |
addCategory
Add a category to the list of approved mint categories
function addCategory(bytes32 category_) external onlyRole("minter_admin");
Parameters
Name | Type | Description |
---|---|---|
category_ | bytes32 | Category to add |
removeCategory
Remove a category from the list of approved mint categories
function removeCategory(bytes32 category_) external onlyRole("minter_admin");
Parameters
Name | Type | Description |
---|---|---|
category_ | bytes32 | Category to remove |
getCategories
Get the list of approved mint categories
function getCategories() external view returns (bytes32[] memory);
Events
Mint
event Mint(address indexed to, bytes32 indexed category, uint256 amount);
CategoryAdded
event CategoryAdded(bytes32 category);
CategoryRemoved
event CategoryRemoved(bytes32 category);
Errors
Minter_CategoryNotApproved
error Minter_CategoryNotApproved();
Minter_CategoryApproved
error Minter_CategoryApproved();