@@ -11,11 +11,21 @@ interface IXStaking {
1111 event Withdraw (address indexed from , uint amount );
1212
1313 event NotifyReward (address indexed from , uint amount );
14-
1514 event ClaimRewards (address indexed from , uint amount );
1615
1716 event NewDuration (uint oldDuration , uint newDuration );
1817
18+ event RewardTokenAllowed (address indexed token , bool allowed );
19+ event NotifyRewardForToken (address indexed token , address indexed from , uint amount );
20+ event ClaimRewardsForToken (address indexed token , address indexed from , uint amount );
21+
22+ /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
23+ /* CUSTOM ERRORS */
24+ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
25+
26+ error DaoNotInitialized ();
27+ error TokenNotAllowed (address token );
28+
1929 /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
2030 /* WRITE FUNCTIONS */
2131 /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
@@ -48,12 +58,27 @@ interface IXStaking {
4858 /// Otherwise, the user receives 1 DAO-token for each 1 xToken staked.
4959 function syncDAOBalances (address [] calldata users ) external ;
5060
61+ /// @notice Allow or disallow reward token
62+ /// @param token Address of reward token
63+ /// @param allowed Allowed state
64+ /// @custom:restricted Only operator
65+ function allowRewardToken (address token , bool allowed ) external ;
66+
67+ /// @notice Used to notify pending xToken rebases and platform revenue share
68+ /// @custom:restricted Only RevenueRouter or xToken
69+ /// @param token Address of reward token
70+ /// @param amount The amount of main token to be notified
71+ function notifyRewardAmountToken (address token , uint amount ) external ;
72+
73+ /// @notice Claims pending rewards
74+ /// @param token Address of reward token
75+ function getRewardToken (address token ) external ;
76+
5177 /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
5278 /* VIEW FUNCTIONS */
5379 /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
5480
55- /// @notice Returns the last time the reward was modified or periodFinish if the reward has ended
56- function lastTimeRewardApplicable () external view returns (uint );
81+ // common data
5782
5883 /// @notice The address of the xToken token (staking/voting token)
5984 /// @return xToken address
@@ -62,6 +87,19 @@ interface IXStaking {
6287 /// @notice Returns the total voting power (equal to total supply in the XStaking)
6388 function totalSupply () external view returns (uint );
6489
90+ /// @notice The duration of notified rewards distribution
91+ function duration () external view returns (uint );
92+
93+ /// @notice Staked amount
94+ /// @param user the address to check
95+ /// @return The staked balance
96+ function balanceOf (address user ) external view returns (uint );
97+
98+ // legacy data
99+
100+ /// @notice Returns the last time the reward was modified or periodFinish if the reward has ended
101+ function lastTimeRewardApplicable () external view returns (uint );
102+
65103 /// @notice Last time the rewards system was updated
66104 function lastUpdateTime () external view returns (uint );
67105
@@ -74,9 +112,6 @@ interface IXStaking {
74112 /// @notice Calculates the rewards distributed per second
75113 function rewardRate () external view returns (uint );
76114
77- /// @notice The duration of notified rewards distribution
78- function duration () external view returns (uint );
79-
80115 /// @dev Current calculated reward per token
81116 /// @return The return value is scaled (multiplied) by PRECISION = 10 ** 18
82117 function rewardPerToken () external view returns (uint );
@@ -92,8 +127,13 @@ interface IXStaking {
92127 /// @notice User's earned reward
93128 function earned (address account ) external view returns (uint );
94129
95- /// @notice Voting power
96- /// @param user the address to check
97- /// @return The staked balance
98- function balanceOf (address user ) external view returns (uint );
130+ // reward tokens data
131+
132+ /// @notice Is token allowed for rewards
133+ function isTokenAllowed (address token ) external view returns (bool );
134+
135+ /// @notice User's earned reward of token
136+ /// @param token Address of reward token
137+ /// @param account Address of user
138+ function earnedToken (address token , address account ) external view returns (uint );
99139}
0 commit comments