Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IYieldDistributor

Git Source

Inherits: EInvalidAddress, EInvalidAmount, EInsufficientBalance

Title: IYieldDistributor

Interface for the YieldDistributor contract that receives yield from MinterV0 and deposits it to Vesting

Defines functions, events, and errors for yield distribution functionality

Functions

asset

Returns the asset token address (apxUSD)

function asset() external view returns (IERC20);

Returns

NameTypeDescription
<none>IERC20Address of the asset token

vesting

Returns the vesting contract address

function vesting() external view returns (IVesting);

Returns

NameTypeDescription
<none>IVestingAddress of the vesting contract

availableBalance

Returns the available balance of apxUSD tokens

function availableBalance() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Amount of apxUSD tokens available for deposit

setVesting

Sets the vesting contract address

Only callable through AccessManager with ADMIN_ROLE

function setVesting(address newVesting) external;

Parameters

NameTypeDescription
newVestingaddressNew vesting contract address

setSigningDelegate

Sets the signature delegate

Only callable through AccessManager with ADMIN_ROLE

function setSigningDelegate(address newSigningDelegate) external;

Parameters

NameTypeDescription
newSigningDelegateaddressNew signature delegate address

depositYield

Deposits yield to the vesting contract

Only callable through AccessManager with ROLE_YIELD_OPERATOR

function depositYield(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256Amount of yield to deposit

withdraw

Withdraws yield from the vesting contract

Only callable through AccessManager with ADMIN_ROLE

function withdraw(uint256 amount, address receiver) external;

Parameters

NameTypeDescription
amountuint256Amount of yield to withdraw
receiveraddressAddress to receive the yield

withdrawTokens

Withdraws tokens from the YieldDistributor

Only callable through AccessManager with ADMIN_ROLE

This function is used to support withdrawing tokens that are erroneously sent to the YieldDistributor (e.g. not apxUSD, any other ERC20).

function withdrawTokens(address withdrawAsset, uint256 amount, address receiver) external;

Parameters

NameTypeDescription
withdrawAssetaddressAddress of the asset to withdraw
amountuint256Amount of the asset to withdraw
receiveraddressAddress to receive the asset

Events

VestingContractUpdated

Emitted when the vesting contract address is updated

event VestingContractUpdated(address indexed oldVesting, address indexed newVesting);

Parameters

NameTypeDescription
oldVestingaddressPrevious vesting contract address
newVestingaddressNew vesting contract address

SigningDelegateUpdated

Emitted when the signature delegate is updated

event SigningDelegateUpdated(address indexed oldSigningDelegate, address indexed newSigningDelegate);

Parameters

NameTypeDescription
oldSigningDelegateaddressPrevious signature delegate address
newSigningDelegateaddressNew signature delegate address

YieldDeposited

Emitted when yield is deposited to the vesting contract

event YieldDeposited(address indexed operator, uint256 amount);

Parameters

NameTypeDescription
operatoraddressAddress of the operator that triggered the yield to be deposited
amountuint256Amount of yield deposited

Withdraw

Emitted when tokens are withdrawn via withdrawTokens

event Withdraw(address indexed caller, address indexed withdrawAsset, uint256 amount, address indexed receiver);

Parameters

NameTypeDescription
calleraddressAddress that initiated the withdrawal (admin)
withdrawAssetaddressAddress of the token withdrawn
amountuint256Amount withdrawn
receiveraddressAddress that received the tokens

Errors

VestingNotSet

Error thrown when vesting contract is not set

error VestingNotSet();