IInfraredVault

Git Source

Inherits: IMultiRewards

Functions

getAllRewardTokens

Returns all reward tokens

function getAllRewardTokens() external view returns (address[] memory);

Returns

NameTypeDescription
<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

NameTypeDescription
_useraddressThe address of the user

Returns

NameTypeDescription
<none>UserReward[]An array of UserReward structs

infrared

Returns the Infrared protocol coordinator

function infrared() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the Infrared contract

rewardsVault

Returns the associated Berachain rewards vault

function rewardsVault() external view returns (IBerachainRewardsVault);

Returns

NameTypeDescription
<none>IBerachainRewardsVaultThe 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

NameTypeDescription
_rewardsTokenaddressThe address of the reward token
_rewardsDurationuint256The 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

NameTypeDescription
_rewardsTokenaddressThe reward token to add
_rewardsDurationuint256The reward period duration

notifyRewardAmount

Notifies the vault of newly added rewards

Updates internal reward rate calculations

function notifyRewardAmount(address _rewardToken, uint256 _reward) external;

Parameters

NameTypeDescription
_rewardTokenaddressThe reward token address
_rewarduint256The 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

NameTypeDescription
_toaddressThe address to receive the recovered tokens
_tokenaddressThe token to recover
_amountuint256The amount to recover

Structs

UserReward

A struct to hold a user's reward information

struct UserReward {
    address token;
    uint256 amount;
}

Properties

NameTypeDescription
tokenaddressThe address of the reward token
amountuint256The amount of reward tokens