MaverickV2RewardFactory
Inherits: IMaverickV2RewardFactory
Reward contract factory that facilitates rewarding stakers in BoostedPositions.
State Variables
boostedPositionFactory
This function retrieves the address of the MaverickV2BoostedPositionFactory contract.
IMaverickV2BoostedPositionFactory public immutable boostedPositionFactory;
votingEscrowFactory
This function retrieves the address of the MaverickV2VotingEscrowFactory contract.
IMaverickV2VotingEscrowFactory public immutable votingEscrowFactory;
isFactoryContract
This function checks if a provided IMaverickV2Reward contract is a valid contract created by this factory.
mapping(IMaverickV2Reward => bool) public isFactoryContract;
_rewardsForStakeToken
mapping(IERC20 stakeToken => IMaverickV2Reward[]) private _rewardsForStakeToken;
_allRewards
IMaverickV2Reward[] private _allRewards;
_boostedPositionRewards
IMaverickV2Reward[] private _boostedPositionRewards;
_nonBoostedPositionRewards
IMaverickV2Reward[] private _nonBoostedPositionRewards;
Functions
constructor
constructor(
IMaverickV2BoostedPositionFactory boostedPositionFactory_,
IMaverickV2VotingEscrowFactory votingEscrowFactory_
);
createRewardsContract
This function creates a new MaverickV2Reward contract associated with a specific stake token contract and set of reward and voting escrow tokens.
function createRewardsContract(
IERC20 stakeToken,
IERC20[] memory rewardTokens,
IMaverickV2VotingEscrow[] memory veTokens
) public returns (IMaverickV2Reward rewardsContract);
Parameters
stakeToken
IERC20
Token to be staked in reward contract; e.g. a boosted position contract.
rewardTokens
IERC20[]
An array of IERC20 token addresses representing the available reward tokens.
veTokens
IMaverickV2VotingEscrow[]
An array of IMaverickV2VotingEscrow contract addresses representing the associated veTokens for boosting.
Returns
rewardsContract
IMaverickV2Reward
The newly created IMaverickV2Reward contract.
rewardsForStakeToken
This function retrieves a list of all MaverickV2Reward contracts associated with a specific staking token contract within a specified range.
function rewardsForStakeToken(IERC20 stakeToken, uint256 startIndex, uint256 endIndex)
external
view
returns (IMaverickV2Reward[] memory);
Parameters
stakeToken
IERC20
Lookup token.
startIndex
uint256
The starting index of the list to retrieve.
endIndex
uint256
The ending index of the list to retrieve.
Returns
<none>
IMaverickV2Reward[]
rewardsContract An array of IMaverickV2Reward contracts associated with the BoostedPosition within the specified range.
rewards
This function retrieves a list of all MaverickV2Reward contracts within a specified range.
function rewards(uint256 startIndex, uint256 endIndex) external view returns (IMaverickV2Reward[] memory);
Parameters
startIndex
uint256
The starting index of the list to retrieve.
endIndex
uint256
The ending index of the list to retrieve.
Returns
<none>
IMaverickV2Reward[]
rewardsContract An array of IMaverickV2Reward contracts within the specified range.
boostedPositionRewards
function boostedPositionRewards(uint256 startIndex, uint256 endIndex)
external
view
returns (IMaverickV2Reward[] memory);
nonBoostedPositionRewards
function nonBoostedPositionRewards(uint256 startIndex, uint256 endIndex)
external
view
returns (IMaverickV2Reward[] memory);
_checkRewards
function _checkRewards(IERC20 rewardToken, IMaverickV2VotingEscrow veToken) internal view;
_slice
function _slice(IMaverickV2Reward[] storage _rewards, uint256 startIndex, uint256 endIndex)
internal
view
returns (IMaverickV2Reward[] memory returnElements);
Last updated