IIRRewardDistributor
Title: IIRRewardDistributor
Interface for the IR Reward Distributor contract
Manages IR token distribution to Infrared vaults based on governance/keeper configured weights
Maintains list of eligible vaults for distribution
Mandatory minimum allocation to iBGT vault (siBGT stakers)
Functions
initialize
Initialize the contract
function initialize(
address _infrared,
address irToken,
address sirToken,
uint256 _minIBGTAllocation
) external;
Parameters
| Name | Type | Description |
|---|---|---|
_infrared | address | Infrared protocol address |
irToken | address | IR token address |
sirToken | address | sIR token address |
_minIBGTAllocation | uint256 | Minimum allocation to iBGT vault in basis points |
excludeVault
Exclude a vault from distribution
function excludeVault(address vault) external;
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address to exclude |
includeVault
Include a previously excluded vault
function includeVault(address vault) external;
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address to include |
addEligibleVault
Add an eligible vault for distribution
function addEligibleVault(address vault) external;
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address to add |
removeEligibleVault
Remove an eligible vault
function removeEligibleVault(address vault) external;
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address to remove |
setRewardsPerEpoch
Set total rewards per epoch
function setRewardsPerEpoch(uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | Total IR tokens to distribute per epoch |
setMinIBGTAllocation
Set minimum iBGT vault allocation
function setMinIBGTAllocation(uint256 allocation) external;
Parameters
| Name | Type | Description |
|---|---|---|
allocation | uint256 | Minimum allocation in basis points (max 50%) |
updateTokens
Update IR and sIR token addresses (for upgrades)
function updateTokens(address irToken, address sirToken) external;
Parameters
| Name | Type | Description |
|---|---|---|
irToken | address | New IR token address |
sirToken | address | New sIR token address |
updateDefaultWeights
Update vault weights (sum must be BASIS_POINTS)
Callable by governance or keeper for operational flexibility
function updateDefaultWeights(
address[] calldata vaults,
uint256[] calldata weights
) external;
Parameters
| Name | Type | Description |
|---|---|---|
vaults | address[] | Array of vault addresses |
weights | uint256[] | Array of weights in basis points |
distributeRewards
Distribute rewards to vaults based on configured weights
Can only be called after epoch ends
function distributeRewards() external;
IR_TOKEN
Get IR token address
function IR_TOKEN() external view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The IR token address |
SIR_TOKEN
Get sIR token address
function SIR_TOKEN() external view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The sIR token address |
getExcludedVaults
Get all excluded vaults
function getExcludedVaults() external view returns (address[] memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | Array of excluded vault addresses |
getEligibleVaults
Get all eligible vaults
function getEligibleVaults() external view returns (address[] memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | Array of eligible vault addresses |
isVaultExcluded
Check if vault is excluded
function isVaultExcluded(address vault) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if vault is excluded |
timeUntilNextEpoch
Get time until next epoch
function timeUntilNextEpoch() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Seconds until next epoch (0 if epoch has ended) |
currentEpoch
Get current epoch number
function currentEpoch() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The current epoch |
totalRewardsPerEpoch
Get total rewards per epoch
function totalRewardsPerEpoch() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The total rewards per epoch |
lastEpochTimestamp
Get last epoch timestamp
function lastEpochTimestamp() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The last epoch timestamp |
minIBGTAllocation
Get minimum iBGT vault allocation
function minIBGTAllocation() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The minimum iBGT allocation in basis points |
defaultVaultWeights
Get weight for a vault
function defaultVaultWeights(address vault) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The vault address |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The vault weight |
totalDefaultWeight
Get total weight
function totalDefaultWeight() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The total weight |
infrared
Get Infrared protocol address
function infrared() external view returns (address);
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The Infrared protocol address |
Events
RewardsDistributed
Emitted when rewards are distributed to a vault
event RewardsDistributed(address indexed vault, uint256 amount);
VaultExcluded
Emitted when a vault is excluded from distribution
event VaultExcluded(address indexed vault);
VaultIncluded
Emitted when a vault is included in distribution
event VaultIncluded(address indexed vault);
EligibleVaultAdded
Emitted when an eligible vault is added
event EligibleVaultAdded(address indexed vault);
EligibleVaultRemoved
Emitted when an eligible vault is removed
event EligibleVaultRemoved(address indexed vault);
EpochStarted
Emitted when a new epoch starts
event EpochStarted(
uint256 indexed epoch, uint256 timestamp, uint256 totalRewards
);
EpochFinalized
Emitted when an epoch is finalized
event EpochFinalized(uint256 indexed epoch);
WeightsUpdated
Emitted when vault weights are updated
event WeightsUpdated(address indexed vault, uint256 weight);
RewardsPerEpochUpdated
Emitted when rewards per epoch is updated
event RewardsPerEpochUpdated(uint256 oldAmount, uint256 newAmount);
MinIBGTAllocationUpdated
Emitted when minimum iBGT allocation is updated
event MinIBGTAllocationUpdated(
uint256 oldAllocation, uint256 newAllocation
);
TokensUpdated
Emitted when token addresses are updated
event TokensUpdated(address indexed irToken, address indexed sirToken);
Errors
InvalidVault
Thrown when vault address is invalid
error InvalidVault();
InvalidAmount
Thrown when amount is invalid
error InvalidAmount();
EpochNotEnded
Thrown when trying to distribute before epoch ends
error EpochNotEnded();
NoRewardsAvailable
Thrown when no rewards are available for distribution
error NoRewardsAvailable();
InvalidWeights
Thrown when weights are invalid
error InvalidWeights();
NoWeightsSet
Thrown when no weights are set
error NoWeightsSet();
InsufficientIRBalance
Thrown when contract has insufficient IR balance
error InsufficientIRBalance();
InvalidArrayLength
Thrown when array lengths don't match
error InvalidArrayLength();
ZeroAddress
Thrown when zero address is provided
error ZeroAddress();
InvalidAllocation
Thrown when allocation is invalid
error InvalidAllocation();