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;

Parameters

NameTypeDescription
to_address
amount_uint256

burnOhm​

Burn OHM from an address. Must have approval.

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

Parameters

NameTypeDescription
from_address
amount_uint256

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;

Parameters

NameTypeDescription
policy_address
amount_uint256

decreaseMintApproval​

Decrease approval for specific withdrawer addresses

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

Parameters

NameTypeDescription
policy_address
amount_uint256

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_);

Parameters

NameTypeDescription
policy_address
newAmount_uint256

DecreaseMintApproval​

event DecreaseMintApproval(address indexed policy_, uint256 newAmount_);

Parameters

NameTypeDescription
policy_address
newAmount_uint256

Mint​

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

Parameters

NameTypeDescription
policy_address
to_address
amount_uint256

Burn​

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

Parameters

NameTypeDescription
policy_address
from_address
amount_uint256

Errors​

MINTR_NotApproved​

error MINTR_NotApproved();

MINTR_ZeroAmount​

error MINTR_ZeroAmount();

MINTR_NotActive​

error MINTR_NotActive();