Skip to content

IStakingRewards

Contract for distributing staking rewards based on veZKC staking positions

Users can claim rewards for specific epochs based on their staking value

Functions

claimRewards

Claim rewards for the given epochs

function claimRewards(uint256[] calldata epochs) external returns (uint256 amount);
Parameters
NameTypeDescription
epochsuint256[]The epochs to claim rewards for
Returns
NameTypeDescription
amountuint256The amount of rewards claimed

claimRewardsToRecipient

Claim rewards for the given epochs and send to a recipient

function claimRewardsToRecipient(uint256[] calldata epochs, address recipient) external returns (uint256);
Parameters
NameTypeDescription
epochsuint256[]The epochs to claim rewards for
recipientaddressThe address to receive the minted rewards
Returns
NameTypeDescription
<none>uint256amount The amount of rewards claimed

calculateRewards

Calculate the rewards a user is owed for the given epochs. If the epoch has not ended yet, it will return zero rewards.

function calculateRewards(address user, uint256[] calldata epochs) external returns (uint256[] memory);
Parameters
NameTypeDescription
useraddressThe user address
epochsuint256[]The epochs to calculate rewards for
Returns
NameTypeDescription
<none>uint256[]rewards The rewards owed

calculateUnclaimedRewards

Calculate unclaimed rewards for a user - returns 0 for already claimed epochs

function calculateUnclaimedRewards(address user, uint256[] calldata epochs) external returns (uint256[] memory);
Parameters
NameTypeDescription
useraddressThe user address
epochsuint256[]The epochs to calculate unclaimed rewards for
Returns
NameTypeDescription
<none>uint256[]rewards The unclaimed rewards (0 if already claimed)

hasUserClaimedRewards

Check if a user has claimed rewards for a specific epoch

function hasUserClaimedRewards(address user, uint256 epoch) external view returns (bool claimed);
Parameters
NameTypeDescription
useraddressThe user address
epochuint256The epoch to check
Returns
NameTypeDescription
claimedboolWhether rewards have been claimed

getCurrentEpoch

Get the current epoch from the ZKC contract

function getCurrentEpoch() external view returns (uint256 currentEpoch);
Returns
NameTypeDescription
currentEpochuint256The current epoch number