Skip to main content

MINTRv1

Git Source

Inherits: Module

Wrapper for minting and burning functions of OHM token.

State Variables

ohm

OHM public ohm;

active

Status of the minter. If false, minting and burning OHM is disabled.

bool public active;

mintApproval

Mapping of who is approved for minting.

minter -> amount. Infinite approval is max(uint256).

mapping(address => uint256) public mintApproval;

Functions

onlyWhileActive

modifier onlyWhileActive();

mintOhm

Mint OHM to an address.

function mintOhm(address to_, uint256 amount_) external virtual;

burnOhm

Burn OHM from an address. Must have approval.

function burnOhm(address from_, uint256 amount_) external virtual;

increaseMintApproval

Increase approval for specific withdrawer addresses

Policies must explicity request how much they want approved before withdrawing.

function increaseMintApproval(address policy_, uint256 amount_) external virtual;

decreaseMintApproval

Decrease approval for specific withdrawer addresses

function decreaseMintApproval(address policy_, uint256 amount_) external virtual;

deactivate

Emergency shutdown of minting and burning.

function deactivate() external virtual;

activate

Re-activate minting and burning after shutdown.

function activate() external virtual;

Events

IncreaseMintApproval

event IncreaseMintApproval(address indexed policy_, uint256 newAmount_);

DecreaseMintApproval

event DecreaseMintApproval(address indexed policy_, uint256 newAmount_);

Mint

event Mint(address indexed policy_, address indexed to_, uint256 amount_);

Burn

event Burn(address indexed policy_, address indexed from_, uint256 amount_);

Errors

MINTR_NotApproved

error MINTR_NotApproved();

MINTR_ZeroAmount

error MINTR_ZeroAmount();

MINTR_NotActive

error MINTR_NotActive();