Skip to main content

Distributor

Methods

MINTR

function MINTR() external view returns (contract MINTRv1)

Returns

NameTypeDescription
_0contract MINTRv1undefined

ROLES

function ROLES() external view returns (contract ROLESv1)

Returns

NameTypeDescription
_0contract ROLESv1undefined

TRSRY

function TRSRY() external view returns (contract TRSRYv1)

Modules

Returns

NameTypeDescription
_0contract TRSRYv1undefined

addPool

function addPool(uint256 index_, address pool_) external nonpayable

Adds a liquidity pool to the list of pools to be minted into

Parameters

NameTypeDescription
index_uint256The index in the pools array to add the liquidity pool to.
pool_addressThe address of the liquidity pool to add.

bounty

function bounty() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

changeKernel

function changeKernel(contract Kernel newKernel_) external nonpayable

Function used by kernel when migrating to a new kernel.

Parameters

NameTypeDescription
newKernel_contract Kernelundefined

configureDependencies

function configureDependencies() external nonpayable returns (Keycode[] dependencies)

Define module dependencies for this policy.

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

distribute

function distribute() external nonpayable

Send the epoch's reward to the staking contract, and mint rewards to Uniswap V2 pools. This removes opportunity cost for liquidity providers by sending rebase rewards directly into the liquidity pool. NOTE: This does not add additional emissions (user could be staked instead and get the same tokens).

isActive

function isActive() external view returns (bool)

Easily accessible indicator for if a policy is activated or not.

Returns

NameTypeDescription
_0boolundefined

kernel

function kernel() external view returns (contract Kernel)

Returns

NameTypeDescription
_0contract Kernelundefined

nextRewardFor

function nextRewardFor(address who_) external view returns (uint256)

Returns the next reward for the given address based on their OHM balance.

Parameters

NameTypeDescription
who_addressThe address to get the next reward for.

Returns

NameTypeDescription
_0uint256uint256 The next reward for the given address.

pools

function pools(uint256) external view returns (address)

Policy state

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
_0addressundefined

removePool

function removePool(uint256 index_, address pool_) external nonpayable

Removes a liquidity pool from the list of pools to be minted into

This function is only available to an authorized user.

Parameters

NameTypeDescription
index_uint256The index in the pools array of the liquidity pool to remove.
pool_addressThe address of the liquidity pool to remove.

requestPermissions

function requestPermissions() external view returns (struct Permissions[] permissions)

Function called by kernel to set module function permissions.

Returns

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

retrieveBounty

function retrieveBounty() external nonpayable returns (uint256)

Mints the bounty (if > 0) to the staking contract for distribution.

Returns

NameTypeDescription
_0uint256uint256 The amount of OHM minted as a bounty.

rewardRate

function rewardRate() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

setBounty

function setBounty(uint256 bounty_) external nonpayable

Adjusts the bounty

This function is only available to an authorized user.

Parameters

NameTypeDescription
bounty_uint256The new bounty amount in OHM (9 decimals).

setPools

function setPools(address[] pools_) external nonpayable

Sets the Uniswap V2 pools to be minted into

This function is only available to an authorized user.

Parameters

NameTypeDescription
pools_address[]The array of Uniswap V2 pools.

setRewardRate

function setRewardRate(uint256 newRewardRate_) external nonpayable

Sets the new OHM reward rate to mint and distribute per epoch

Parameters

NameTypeDescription
newRewardRate_uint256The new rate to set (9 decimals, i.e. 10_000_000 / 1_000_000_000 = 1%)

triggerRebase

function triggerRebase() external nonpayable

Trigger rebases via distributor. There is an error in Staking's stake function which pulls forward part of the rebase for the next epoch. This path triggers a rebase by calling unstake (which does not have the issue). The patch also restricts distribute to only be able to be called from a tx originating in this function.

Errors

Distributor_AdjustmentLimit

error Distributor_AdjustmentLimit()

Distributor_AdjustmentUnderflow

error Distributor_AdjustmentUnderflow()

Distributor_InvalidConstruction

error Distributor_InvalidConstruction()

Distributor_NoRebaseOccurred

error Distributor_NoRebaseOccurred()

Distributor_NotPermissioned

error Distributor_NotPermissioned()

Distributor_NotUnlocked

error Distributor_NotUnlocked()

Distributor_OnlyStaking

error Distributor_OnlyStaking()

Distributor_SanityCheck

error Distributor_SanityCheck()

KernelAdapter_OnlyKernel

error KernelAdapter_OnlyKernel(address caller_)

Parameters

NameTypeDescription
caller_addressundefined

Policy_ModuleDoesNotExist

error Policy_ModuleDoesNotExist(Keycode keycode_)

Parameters

NameTypeDescription
keycode_Keycodeundefined