Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit a33f931

Browse files
committed
fix: Minimize the IAaveIncentivesController with only the handleAction
1 parent 4449676 commit a33f931

File tree

4 files changed

+9
-239
lines changed

4 files changed

+9
-239
lines changed

contracts/interfaces/IAaveIncentivesController.sol

Lines changed: 9 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -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
**/
910
interface 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
}

contracts/mocks/helpers/MockIncentivesController.sol

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,9 @@ pragma solidity 0.8.10;
44
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
55

66
contract MockIncentivesController is IAaveIncentivesController {
7-
function getAssetData(address)
8-
external
9-
pure
10-
override
11-
returns (
12-
uint256,
13-
uint256,
14-
uint256
15-
)
16-
{
17-
return (0, 0, 0);
18-
}
19-
20-
function assets(address)
21-
external
22-
pure
23-
override
24-
returns (
25-
uint128,
26-
uint128,
27-
uint256
28-
)
29-
{
30-
return (0, 0, 0);
31-
}
32-
33-
function setClaimer(address, address) external override {}
34-
35-
function getClaimer(address) external pure override returns (address) {
36-
return address(1);
37-
}
38-
39-
function configureAssets(address[] calldata, uint256[] calldata) external override {}
40-
417
function handleAction(
428
address,
439
uint256,
4410
uint256
4511
) external override {}
46-
47-
function getRewardsBalance(address[] calldata, address) external pure override returns (uint256) {
48-
return 0;
49-
}
50-
51-
function claimRewards(
52-
address[] calldata,
53-
uint256,
54-
address
55-
) external pure override returns (uint256) {
56-
return 0;
57-
}
58-
59-
function claimRewardsOnBehalf(
60-
address[] calldata,
61-
uint256,
62-
address,
63-
address
64-
) external pure override returns (uint256) {
65-
return 0;
66-
}
67-
68-
function getUserUnclaimedRewards(address) external pure override returns (uint256) {
69-
return 0;
70-
}
71-
72-
function getUserAssetData(address, address) external pure override returns (uint256) {
73-
return 0;
74-
}
75-
76-
function REWARD_TOKEN() external pure override returns (address) {
77-
return address(0);
78-
}
79-
80-
function PRECISION() external pure override returns (uint8) {
81-
return 0;
82-
}
83-
84-
function DISTRIBUTION_END() external pure override returns (uint256) {
85-
return 0;
86-
}
8712
}

contracts/mocks/upgradeability/MockAToken.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity 0.8.10;
33

44
import {AToken} from '../../protocol/tokenization/AToken.sol';
55
import {IPool} from '../../interfaces/IPool.sol';
6-
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
76

87
contract MockAToken is AToken {
98
constructor(IPool pool) AToken(pool) {}

contracts/protocol/libraries/logic/ConfiguratorLogic.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity 0.8.10;
44
import {IPool} from '../../../interfaces/IPool.sol';
55
import {IInitializableAToken} from '../../../interfaces/IInitializableAToken.sol';
66
import {IInitializableDebtToken} from '../../../interfaces/IInitializableDebtToken.sol';
7-
import {IAaveIncentivesController} from '../../../interfaces/IAaveIncentivesController.sol';
87
import {InitializableImmutableAdminUpgradeabilityProxy} from '../aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
98
import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol';
109
import {DataTypes} from '../types/DataTypes.sol';

0 commit comments

Comments
 (0)