-
Notifications
You must be signed in to change notification settings - Fork 13
/
IRewardsManagerState.sol
81 lines (70 loc) · 3.31 KB
/
IRewardsManagerState.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
/**
* @title Rewards Manager State
*/
interface IRewardsManagerState {
/**
* @notice Track whether a depositor has claimed rewards for a given burn event epoch.
* @param tokenId_ ID of the staked `LP` `NFT`.
* @param epoch_ The burn epoch to track if rewards were claimed.
* @return `True` if rewards were claimed for the given epoch, else false.
*/
function isEpochClaimed(
uint256 tokenId_,
uint256 epoch_
) external view returns (bool);
/**
* @notice Track the total amount of rewards that have been claimed for a given epoch.
* @param epoch_ The burn epoch to track if rewards were claimed.
* @return The amount of rewards claimed in given epoch.
*/
function rewardsClaimed(
uint256 epoch_
) external view returns (uint256);
/**
* @notice Track the total amount of rewards that have been claimed for a given burn event's bucket updates.
* @param epoch_ The burn epoch to track if rewards were claimed.
* @return The amount of update rewards claimed in given epoch.
*/
function updateRewardsClaimed(
uint256 epoch_
) external view returns (uint256);
/**
* @notice Retrieve information about a given stake.
* @param tokenId_ `ID` of the `NFT` staked in the rewards contract to retrieve information about.
* @return owner_ The owner of a given `NFT` stake.
* @return pool_ The `Pool` the `NFT` represents positions in.
* @return lastClaimedEpoch_ The last burn epoch in which the owner of the `NFT` claimed rewards.
*/
function getStakeInfo(
uint256 tokenId_
) external view returns (address owner_, address pool_, uint256 lastClaimedEpoch_);
/**
* @notice Retrieve information about recorded `LP` and rate values for a given bucket and a given stake, at stake time.
* @param tokenId_ `ID` of the `NFT` staked in the rewards contract to retrieve information about.
* @param bucketId_ `ID` of the bucket to retrieve recorded information at stake time.
* @return `LP` amount (in `WAD`) the `NFT` owner is entitled in current bucket at the time of staking.
* @return Current bucket exchange rate (`WAD`) at the time of staking.
*/
function getBucketStateStakeInfo(
uint256 tokenId_,
uint256 bucketId_
) external view returns (uint256, uint256);
}
/*********************/
/*** State Structs ***/
/*********************/
/// @dev Struct holding stake info state.
struct StakeInfo {
address ajnaPool; // address of the Ajna pool the NFT corresponds to
uint96 lastClaimedEpoch; // last epoch the stake claimed rewards
address owner; // owner of the LP NFT
uint96 stakingEpoch; // epoch at staking time
mapping(uint256 => BucketState) snapshot; // the LP NFT's balances and exchange rates in each bucket at the time of staking
}
/// @dev Struct holding bucket state at stake time.
struct BucketState {
uint128 lpsAtStakeTime; // [WAD] LP amount the NFT owner is entitled in current bucket at the time of staking
uint128 rateAtStakeTime; // [WAD] current bucket exchange rate at the time of staking
}