IInfraredVault
Inherits: IMultiRewards
Functions
getAllRewardTokens
Returns all reward tokens
function getAllRewardTokens() external view returns (address[] memory);
Returns
Name | Type | Description |
---|---|---|
<none> | address[] | An array of reward token addresses |
getAllRewardsForUser
Returns all rewards for a user
Only up to date since the lastUpdateTime
function getAllRewardsForUser(address _user)
external
view
returns (UserReward[] memory);
Parameters
Name | Type | Description |
---|---|---|
_user | address | The address of the user |
Returns
Name | Type | Description |
---|---|---|
<none> | UserReward[] | An array of UserReward structs |
infrared
Returns the Infrared protocol coordinator
function infrared() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the Infrared contract |
rewardsVault
Returns the associated Berachain rewards vault
function rewardsVault() external view returns (IBerachainRewardsVault);
Returns
Name | Type | Description |
---|---|---|
<none> | IBerachainRewardsVault | The rewards vault contract instance |
updateRewardsDuration
Updates reward duration for a specific reward token
Only callable by Infrared contract
Note: access-control: Requires INFRARED_ROLE
function updateRewardsDuration(address _rewardsToken, uint256 _rewardsDuration)
external;
Parameters
Name | Type | Description |
---|---|---|
_rewardsToken | address | The address of the reward token |
_rewardsDuration | uint256 | The new duration in seconds |
togglePause
Toggles pause state of the vault
Affects all vault operations when paused
Note: access-control: Requires INFRARED_ROLE
function togglePause() external;
addReward
Adds a new reward token to the vault
Cannot exceed maximum number of reward tokens
Note: access-control: Requires INFRARED_ROLE
function addReward(address _rewardsToken, uint256 _rewardsDuration) external;
Parameters
Name | Type | Description |
---|---|---|
_rewardsToken | address | The reward token to add |
_rewardsDuration | uint256 | The reward period duration |
notifyRewardAmount
Notifies the vault of newly added rewards
Updates internal reward rate calculations
function notifyRewardAmount(address _rewardToken, uint256 _reward) external;
Parameters
Name | Type | Description |
---|---|---|
_rewardToken | address | The reward token address |
_reward | uint256 | The amount of new rewards |
recoverERC20
Recovers accidentally sent tokens
Cannot recover staking token or active reward tokens
function recoverERC20(address _to, address _token, uint256 _amount) external;
Parameters
Name | Type | Description |
---|---|---|
_to | address | The address to receive the recovered tokens |
_token | address | The token to recover |
_amount | uint256 | The amount to recover |
Structs
UserReward
A struct to hold a user's reward information
struct UserReward {
address token;
uint256 amount;
}
Properties
Name | Type | Description |
---|---|---|
token | address | The address of the reward token |
amount | uint256 | The amount of reward tokens |