@@ -5,172 +5,19 @@ pragma solidity ^0.8.0;
55 * @title IAaveIncentivesController
66 * @author Aave
77 * @notice Defines the basic interface for an Aave Incentives Controller.
8+ * @dev It only contains one single function, needed as a hook on aToken and debtToken transfers.
89 **/
910interface IAaveIncentivesController {
1011 /**
11- * @dev Emitted during `handleAction`, `claimRewards` and `claimRewardsOnBehalf`
12- * @param user The user that accrued rewards
13- * @param amount The amount of accrued rewards
14- */
15- event RewardsAccrued (address indexed user , uint256 amount );
16-
17- event RewardsClaimed (address indexed user , address indexed to , uint256 amount );
18-
19- /**
20- * @dev Emitted during `claimRewards` and `claimRewardsOnBehalf`
21- * @param user The address that accrued rewards
22- * @param to The address that will be receiving the rewards
23- * @param claimer The address that performed the claim
24- * @param amount The amount of rewards
25- */
26- event RewardsClaimed (
27- address indexed user ,
28- address indexed to ,
29- address indexed claimer ,
30- uint256 amount
31- );
32-
33- /**
34- * @dev Emitted during `setClaimer`
35- * @param user The address of the user
36- * @param claimer The address of the claimer
37- */
38- event ClaimerSet (address indexed user , address indexed claimer );
39-
40- /**
41- * @notice Returns the configuration of the distribution for a certain asset
42- * @param asset The address of the reference asset of the distribution
43- * @return The asset index
44- * @return The emission per second
45- * @return The last updated timestamp
46- **/
47- function getAssetData (address asset )
48- external
49- view
50- returns (
51- uint256 ,
52- uint256 ,
53- uint256
54- );
55-
56- /**
57- * LEGACY **************************
58- * @dev Returns the configuration of the distribution for a certain asset
59- * @param asset The address of the reference asset of the distribution
60- * @return The asset index, the emission per second and the last updated timestamp
61- **/
62- function assets (address asset )
63- external
64- view
65- returns (
66- uint128 ,
67- uint128 ,
68- uint256
69- );
70-
71- /**
72- * @notice Whitelists an address to claim the rewards on behalf of another address
73- * @param user The address of the user
74- * @param claimer The address of the claimer
75- */
76- function setClaimer (address user , address claimer ) external ;
77-
78- /**
79- * @notice Returns the whitelisted claimer for a certain address (0x0 if not set)
80- * @param user The address of the user
81- * @return The claimer address
82- */
83- function getClaimer (address user ) external view returns (address );
84-
85- /**
86- * @notice Configure assets for a certain rewards emission
87- * @param assets The assets to incentivize
88- * @param emissionsPerSecond The emission for each asset
89- */
90- function configureAssets (address [] calldata assets , uint256 [] calldata emissionsPerSecond )
91- external ;
92-
93- /**
94- * @notice Called by the corresponding asset on any update that affects the rewards distribution
95- * @param asset The address of the user
96- * @param userBalance The balance of the user of the asset in the pool
97- * @param totalSupply The total supply of the asset in the pool
12+ * @dev Called by the corresponding asset on transfer hook in order to update the rewards distribution.
13+ * @dev The units of `totalSupply` and `userBalance` should be the same.
14+ * @param user The address of the user whose asset balance has changed
15+ * @param totalSupply The total supply of the asset prior to user balance change
16+ * @param userBalance The previous user balance prior to balance change
9817 **/
9918 function handleAction (
100- address asset ,
101- uint256 userBalance ,
102- uint256 totalSupply
103- ) external ;
104-
105- /**
106- * @notice Returns the total of rewards of a user, already accrued + not yet accrued
107- * @param assets The assets to accumulate rewards for
108- * @param user The address of the user
109- * @return The rewards
110- **/
111- function getRewardsBalance (address [] calldata assets , address user )
112- external
113- view
114- returns (uint256 );
115-
116- /**
117- * @notice Claims reward for a user, on the assets of the pool, accumulating the pending rewards
118- * @param assets The assets to accumulate rewards for
119- * @param amount Amount of rewards to claim
120- * @param to Address that will be receiving the rewards
121- * @return Rewards claimed
122- **/
123- function claimRewards (
124- address [] calldata assets ,
125- uint256 amount ,
126- address to
127- ) external returns (uint256 );
128-
129- /**
130- * @notice Claims reward for a user on its behalf, on the assets of the pool, accumulating the pending rewards.
131- * @dev The caller must be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager
132- * @param assets The assets to accumulate rewards for
133- * @param amount The amount of rewards to claim
134- * @param user The address to check and claim rewards
135- * @param to The address that will be receiving the rewards
136- * @return The amount of rewards claimed
137- **/
138- function claimRewardsOnBehalf (
139- address [] calldata assets ,
140- uint256 amount ,
14119 address user ,
142- address to
143- ) external returns (uint256 );
144-
145- /**
146- * @notice Returns the unclaimed rewards of the user
147- * @param user The address of the user
148- * @return The unclaimed user rewards
149- */
150- function getUserUnclaimedRewards (address user ) external view returns (uint256 );
151-
152- /**
153- * @notice Returns the user index for a specific asset
154- * @param user The address of the user
155- * @param asset The asset to incentivize
156- * @return The user index for the asset
157- */
158- function getUserAssetData (address user , address asset ) external view returns (uint256 );
159-
160- /**
161- * @notice for backward compatibility with previous implementation of the Incentives controller
162- * @return The address of the reward token
163- */
164- function REWARD_TOKEN () external view returns (address );
165-
166- /**
167- * @notice for backward compatibility with previous implementation of the Incentives controller
168- * @return The precision used in the incentives controller
169- */
170- function PRECISION () external view returns (uint8 );
171-
172- /**
173- * @dev Gets the distribution end timestamp of the emissions
174- */
175- function DISTRIBUTION_END () external view returns (uint256 );
20+ uint256 totalSupply ,
21+ uint256 userBalance
22+ ) external ;
17623}
0 commit comments