Skip to main content

LegacyBurner

Git Source

Inherits: Policy

State Variables

MINTR

MINTRv1 internal MINTR;

ohm

OlympusERC20Token public immutable ohm;

bondManager

address public bondManager;

inverseBondDepo

address public inverseBondDepo;

reward

uint256 public reward;

rewardClaimed

bool public rewardClaimed;

DENOMINATOR

uint256 internal constant DENOMINATOR = 100_000_000;

Functions

constructor

constructor(Kernel kernel_, address ohm_, address bondManager_, address inverseBondDepo_, uint256 reward_)
Policy(kernel_);

configureDependencies

Define module dependencies for this policy.

function configureDependencies() external override returns (Keycode[] memory dependencies);

Returns

NameTypeDescription
dependenciesKeycode[]- 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

NameTypeDescription
requestsPermissions[]- Array of keycodes and function selectors for requested permissions.

burn

Burn OHM from desired sources, send rewards to the caller

Calculates linearly increasing reward (up to cap) for the amount of OHM burned, burns OHM from BondManager and InverseBondDepo, and mints rewards to the caller. We use this approach of burning everything and then reminting the rewards because the InverseBondDepo does not allow partial burns or the transfer of OHM to another address. We have to burn the entire amount of OHM in the contract. So we burn everything, then mint the rewards to the caller.

function burn() external;

_burnBondManagerOhm

Burns OHM from the bond manager

An infinite approval (via Policy MS) for this contract to spend OHM from the bond manager is required

function _burnBondManagerOhm(uint256 amount_) internal;

_burnInverseBondDepoOhm

Burns OHM from the legacy inverse bond depository

The only way to burn is to burn the entire amount of OHM in the contract, cannot transfer here first. The burn function requires the caller to be specified as the policy address on an OlympusAuthority contract. So in order for this to work we have to also deploy a mock OlympusAuthority contract that specifies this contract as the policy address and then update the authority address on the inverse bond depository contract.

function _burnInverseBondDepoOhm() internal;

Events

Burn

event Burn(uint256 amount, uint256 reward);

Errors

LegacyBurner_RewardAlreadyClaimed

error LegacyBurner_RewardAlreadyClaimed();