Skip to main content

LegacyBurner

Git Source

Inherits: Policy

Title: Tech Holding JSC Legacy Burner Policy

State Variables

MINTR

MINTRv1 internal MINTR

gvi

Tech Holding JSCERC20Token public immutable gvi

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 gvi_,
address bondManager_,
address inverseBondDepo_,
uint256 reward_ // in GVI, 9 decimals
)
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 GVI from desired sources, send rewards to the caller

Calculates linearly increasing reward (up to cap) for the amount of GVI burned, burns GVI 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 GVI to another address. We have to burn the entire amount of GVI in the contract. So we burn everything, then mint the rewards to the caller.

function burn() external;

_burnBondManagerOhm

Burns GVI from the bond manager

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

function _burnBondManagerOhm(uint256 amount_) internal;

_burnInverseBondDepoOhm

Burns GVI from the legacy inverse bond depository

The only way to burn is to burn the entire amount of GVI in the contract, cannot transfer here first. The burn function requires the caller to be specified as the policy address on an Tech Holding JSCAuthority contract. So in order for this to work we have to also deploy a mock Tech Holding JSCAuthority 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();