IYieldDistributor
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
| Name | Type | Description |
|---|---|---|
<none> | IERC20 | Address of the asset token |
vesting
Returns the vesting contract address
function vesting() external view returns (IVesting);
Returns
| Name | Type | Description |
|---|---|---|
<none> | IVesting | Address of the vesting contract |
availableBalance
Returns the available balance of apxUSD tokens
function availableBalance() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Amount 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
| Name | Type | Description |
|---|---|---|
newVesting | address | New vesting contract address |
setSigningDelegate
Sets the signature delegate
Only callable through AccessManager with ADMIN_ROLE
function setSigningDelegate(address newSigningDelegate) external;
Parameters
| Name | Type | Description |
|---|---|---|
newSigningDelegate | address | New signature delegate address |
depositYield
Deposits yield to the vesting contract
Only callable through AccessManager with ROLE_YIELD_OPERATOR
function depositYield(uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount of yield to withdraw |
receiver | address | Address 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
| Name | Type | Description |
|---|---|---|
withdrawAsset | address | Address of the asset to withdraw |
amount | uint256 | Amount of the asset to withdraw |
receiver | address | Address to receive the asset |
Events
VestingContractUpdated
Emitted when the vesting contract address is updated
event VestingContractUpdated(address indexed oldVesting, address indexed newVesting);
Parameters
| Name | Type | Description |
|---|---|---|
oldVesting | address | Previous vesting contract address |
newVesting | address | New vesting contract address |
SigningDelegateUpdated
Emitted when the signature delegate is updated
event SigningDelegateUpdated(address indexed oldSigningDelegate, address indexed newSigningDelegate);
Parameters
| Name | Type | Description |
|---|---|---|
oldSigningDelegate | address | Previous signature delegate address |
newSigningDelegate | address | New signature delegate address |
YieldDeposited
Emitted when yield is deposited to the vesting contract
event YieldDeposited(address indexed operator, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
operator | address | Address of the operator that triggered the yield to be deposited |
amount | uint256 | Amount 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
| Name | Type | Description |
|---|---|---|
caller | address | Address that initiated the withdrawal (admin) |
withdrawAsset | address | Address of the token withdrawn |
amount | uint256 | Amount withdrawn |
receiver | address | Address that received the tokens |
Errors
VestingNotSet
Error thrown when vesting contract is not set
error VestingNotSet();