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);
Name | Type | Description |
---|---|---|
epochs | uint256[] | The epochs to claim rewards for |
Name | Type | Description |
---|---|---|
amount | uint256 | The 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);
Name | Type | Description |
---|---|---|
epochs | uint256[] | The epochs to claim rewards for |
recipient | address | The address to receive the minted rewards |
Name | Type | Description |
---|---|---|
<none> | uint256 | amount 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);
Name | Type | Description |
---|---|---|
user | address | The user address |
epochs | uint256[] | The epochs to calculate rewards for |
Name | Type | Description |
---|---|---|
<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);
Name | Type | Description |
---|---|---|
user | address | The user address |
epochs | uint256[] | The epochs to calculate unclaimed rewards for |
Name | Type | Description |
---|---|---|
<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);
Name | Type | Description |
---|---|---|
user | address | The user address |
epoch | uint256 | The epoch to check |
Name | Type | Description |
---|---|---|
claimed | bool | Whether rewards have been claimed |
getCurrentEpoch
Get the current epoch from the ZKC contract
function getCurrentEpoch() external view returns (uint256 currentEpoch);
Name | Type | Description |
---|---|---|
currentEpoch | uint256 | The current epoch number |