Skip to content

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

Returns the maximum number of reward slots.

function MAX_REWARD_SLOTS() external view returns (uint256 maxRewardSlots);

Returns

NameTypeDescription
maxRewardSlotsuint256The maximum number of reward slots.

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

NameTypeDescription
rewardTokenAddressaddressThe address of the reward token to add

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

NameTypeDescription
rewardTokenAddressaddressThe address of the reward token to deposit
amountuint256The amount of reward tokens to deposit

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

NameTypeDescription
certificateIduint256Certificate ID to withdraw rewards for
rewardTokenAddressaddressReward token address to withdraw rewards for
overrideRecipientaddressAddress to override the proceeds recipient
ignoreFreezeboolWhether to ignore the freeze
inETHboolWhether the reward should be withdrawn in ETH
slippageToleranceuint256Slippage tolerance for the reward withdrawal

Returns

NameTypeDescription
rewardAmountuint256Amount of rewards actually withdrawn after fees

Withdraws all tokens rewards from a certificate

function withdrawAllRewards(
uint256 certificateId,
address overrideRecipient,
bool inETH,
uint256 slippageTolerance
)
external;

Parameters

NameTypeDescription
certificateIduint256Certificate to withdraw rewards for
overrideRecipientaddressAddress to override the proceeds recipient
inETHboolWhether the reward should be withdrawn in ETH
slippageToleranceuint256Slippage tolerance for the reward withdrawal

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

NameTypeDescription
certificateIduint256Certificate ID to compound rewards for
rewardTokenAddressaddressAddress of the reward token to compound
slippageToleranceuint256Slippage tolerance for the reward swap

Compounds all rewards for a certificate by selling them for the underlying token

function compoundAllRewards(uint256 certificateId, uint256 slippageTolerance) external;

Parameters

NameTypeDescription
certificateIduint256Certificate ID to compound rewards for
slippageToleranceuint256Slippage tolerance for the reward swap

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

NameTypeDescription
rewardTokenAddressaddressThe reward token address to withdraw from