IRewardFacet
Interface for the RewardFacet contract.
This contract allows for the management of rewards for the project and the withdrawal of rewards by certificate holders
Functions
Section titled “Functions”MAX_REWARD_SLOTS
Section titled “MAX_REWARD_SLOTS”Returns the maximum number of reward slots.
function MAX_REWARD_SLOTS() external view returns (uint256 maxRewardSlots);Returns
| Name | Type | Description |
|---|---|---|
maxRewardSlots | uint256 | The maximum number of reward slots. |
createRewardTokenSlot
Section titled “createRewardTokenSlot”Adds a new reward token to the project
The Manager or RewardDistributor roles are required to call this function.
function createRewardTokenSlot(address rewardTokenAddress) external payable;Parameters
| Name | Type | Description |
|---|---|---|
rewardTokenAddress | address | The address of the reward token to add |
depositReward
Section titled “depositReward”Register the deposit of token rewards into the pool
The Manager or RewardDistributor roles are required to call this function.
The reward tokens will be transferred from the caller to the contract
function depositReward(address rewardTokenAddress, uint256 amount) external payable;Parameters
| Name | Type | Description |
|---|---|---|
rewardTokenAddress | address | The address of the reward token to deposit |
amount | uint256 | The amount of reward tokens to deposit |
withdrawReward
Section titled “withdrawReward”Withdraws a single token rewards from a certificate
ignoreFreeze can only be set to true by the contract itself
and will revert if called by an external account
function withdrawReward( uint256 certificateId, address rewardTokenAddress, address overrideRecipient, bool ignoreFreeze, bool inETH, uint256 slippageTolerance) external returns (uint256 rewardAmount);Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | Certificate ID to withdraw rewards for |
rewardTokenAddress | address | Reward token address to withdraw rewards for |
overrideRecipient | address | Address to override the proceeds recipient |
ignoreFreeze | bool | Whether to ignore the freeze |
inETH | bool | Whether the reward should be withdrawn in ETH |
slippageTolerance | uint256 | Slippage tolerance for the reward withdrawal |
Returns
| Name | Type | Description |
|---|---|---|
rewardAmount | uint256 | Amount of rewards actually withdrawn after fees |
withdrawAllRewards
Section titled “withdrawAllRewards”Withdraws all tokens rewards from a certificate
function withdrawAllRewards( uint256 certificateId, address overrideRecipient, bool inETH, uint256 slippageTolerance) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | Certificate to withdraw rewards for |
overrideRecipient | address | Address to override the proceeds recipient |
inETH | bool | Whether the reward should be withdrawn in ETH |
slippageTolerance | uint256 | Slippage tolerance for the reward withdrawal |
compoundReward
Section titled “compoundReward”Compounds a single token rewards for a certificate by selling them for the underlying token
function compoundReward( uint256 certificateId, address rewardTokenAddress, uint256 slippageTolerance) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | Certificate ID to compound rewards for |
rewardTokenAddress | address | Address of the reward token to compound |
slippageTolerance | uint256 | Slippage tolerance for the reward swap |
compoundAllRewards
Section titled “compoundAllRewards”Compounds all rewards for a certificate by selling them for the underlying token
function compoundAllRewards(uint256 certificateId, uint256 slippageTolerance) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | Certificate ID to compound rewards for |
slippageTolerance | uint256 | Slippage tolerance for the reward swap |
withdrawUnredeemedRewards
Section titled “withdrawUnredeemedRewards”Allows the project owner to withdraw the rewards that have not been redeemed after the grace period has passed
This function is used by the project admin to recover rewards that have not yet been redeemed for a long time and are ‘stuck’ in the contract
function withdrawUnredeemedRewards(address rewardTokenAddress) external;Parameters
| Name | Type | Description |
|---|---|---|
rewardTokenAddress | address | The reward token address to withdraw from |