@@ -2,22 +2,18 @@ pragma solidity 0.8.10;
22
33import {VersionedInitializable} from '@aave/core-v3/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol ' ;
44import {IScaledBalanceToken} from '@aave/core-v3/contracts/interfaces/IScaledBalanceToken.sol ' ;
5- import {DistributionManagerV2 } from './DistributionManagerV2 .sol ' ;
6- import {IAaveIncentivesControllerV2 } from './interfaces/IAaveIncentivesControllerV2 .sol ' ;
5+ import {RewardsDistributor } from './RewardsDistributor .sol ' ;
6+ import {IRewardsController } from './interfaces/IRewardsController .sol ' ;
77import {ITransferStrategyBase} from './interfaces/ITransferStrategyBase.sol ' ;
8- import {DistributionTypesV2 } from './libraries/DistributionTypesV2 .sol ' ;
8+ import {RewardsDistributorTypes } from './libraries/RewardsDistributorTypes .sol ' ;
99import {IEACAggregatorProxy} from '../misc/interfaces/IEACAggregatorProxy.sol ' ;
1010
1111/**
12- * @title IncentivesControllerV2
12+ * @title RewardsController
1313 * @notice Abstract contract template to build Distributors contracts for ERC20 rewards to protocol participants
1414 * @author Aave
1515 **/
16- contract IncentivesControllerV2 is
17- DistributionManagerV2 ,
18- VersionedInitializable ,
19- IAaveIncentivesControllerV2
20- {
16+ contract RewardsController is RewardsDistributor , VersionedInitializable , IRewardsController {
2117 uint256 public constant REVISION = 1 ;
2218
2319 // This mapping allows whitelisted addresses to claim on behalf of others
@@ -41,14 +37,14 @@ contract IncentivesControllerV2 is
4137 _;
4238 }
4339
44- constructor (address emissionManager ) DistributionManagerV2 (emissionManager) {}
40+ constructor (address emissionManager ) RewardsDistributor (emissionManager) {}
4541
4642 /**
47- * @dev Empty initialize for IncentivesControllerV2
43+ * @dev Empty initialize for RewardsController
4844 **/
4945 function initialize () external initializer {}
5046
51- /// @inheritdoc IAaveIncentivesControllerV2
47+ /// @inheritdoc IRewardsController
5248 function getClaimer (address user ) external view override returns (address ) {
5349 return _authorizedClaimers[user];
5450 }
@@ -61,18 +57,18 @@ contract IncentivesControllerV2 is
6157 return REVISION;
6258 }
6359
64- /// @inheritdoc IAaveIncentivesControllerV2
60+ /// @inheritdoc IRewardsController
6561 function getRewardOracle (address reward ) external view override returns (address ) {
6662 return address (_rewardOracle[reward]);
6763 }
6864
69- /// @inheritdoc IAaveIncentivesControllerV2
65+ /// @inheritdoc IRewardsController
7066 function getTransferStrategy (address reward ) external view override returns (address ) {
7167 return address (_transferStrategy[reward]);
7268 }
7369
74- /// @inheritdoc IAaveIncentivesControllerV2
75- function configureAssets (DistributionTypesV2 .RewardsConfigInput[] memory config )
70+ /// @inheritdoc IRewardsController
71+ function configureAssets (RewardsDistributorTypes .RewardsConfigInput[] memory config )
7672 external
7773 override
7874 onlyEmissionManager
@@ -90,23 +86,23 @@ contract IncentivesControllerV2 is
9086 _configureAssets (config);
9187 }
9288
93- /// @inheritdoc IAaveIncentivesControllerV2
89+ /// @inheritdoc IRewardsController
9490 function setTransferStrategy (address reward , ITransferStrategyBase transferStrategy )
9591 external
9692 onlyEmissionManager
9793 {
9894 _installTransferStrategy (reward, transferStrategy);
9995 }
10096
101- /// @inheritdoc IAaveIncentivesControllerV2
97+ /// @inheritdoc IRewardsController
10298 function setRewardOracle (address reward , IEACAggregatorProxy rewardOracle )
10399 external
104100 onlyEmissionManager
105101 {
106102 _setRewardOracle (reward, rewardOracle);
107103 }
108104
109- /// @inheritdoc IAaveIncentivesControllerV2
105+ /// @inheritdoc IRewardsController
110106 function handleAction (
111107 address user ,
112108 uint256 totalSupply ,
@@ -115,7 +111,7 @@ contract IncentivesControllerV2 is
115111 _updateUserRewardsPerAssetInternal (msg .sender , user, userBalance, totalSupply);
116112 }
117113
118- /// @inheritdoc IAaveIncentivesControllerV2
114+ /// @inheritdoc IRewardsController
119115 function claimRewards (
120116 address [] calldata assets ,
121117 uint256 amount ,
@@ -126,7 +122,7 @@ contract IncentivesControllerV2 is
126122 return _claimRewards (assets, amount, msg .sender , msg .sender , to, reward);
127123 }
128124
129- /// @inheritdoc IAaveIncentivesControllerV2
125+ /// @inheritdoc IRewardsController
130126 function claimRewardsOnBehalf (
131127 address [] calldata assets ,
132128 uint256 amount ,
@@ -139,7 +135,7 @@ contract IncentivesControllerV2 is
139135 return _claimRewards (assets, amount, msg .sender , user, to, reward);
140136 }
141137
142- /// @inheritdoc IAaveIncentivesControllerV2
138+ /// @inheritdoc IRewardsController
143139 function claimRewardsToSelf (
144140 address [] calldata assets ,
145141 uint256 amount ,
@@ -148,7 +144,7 @@ contract IncentivesControllerV2 is
148144 return _claimRewards (assets, amount, msg .sender , msg .sender , msg .sender , reward);
149145 }
150146
151- /// @inheritdoc IAaveIncentivesControllerV2
147+ /// @inheritdoc IRewardsController
152148 function claimAllRewards (address [] calldata assets , address to )
153149 external
154150 override
@@ -158,7 +154,7 @@ contract IncentivesControllerV2 is
158154 return _claimAllRewards (assets, msg .sender , msg .sender , to);
159155 }
160156
161- /// @inheritdoc IAaveIncentivesControllerV2
157+ /// @inheritdoc IRewardsController
162158 function claimAllRewardsOnBehalf (
163159 address [] calldata assets ,
164160 address user ,
@@ -174,7 +170,7 @@ contract IncentivesControllerV2 is
174170 return _claimAllRewards (assets, msg .sender , user, to);
175171 }
176172
177- /// @inheritdoc IAaveIncentivesControllerV2
173+ /// @inheritdoc IRewardsController
178174 function claimAllRewardsToSelf (address [] calldata assets )
179175 external
180176 override
@@ -183,7 +179,7 @@ contract IncentivesControllerV2 is
183179 return _claimAllRewards (assets, msg .sender , msg .sender , msg .sender );
184180 }
185181
186- /// @inheritdoc IAaveIncentivesControllerV2
182+ /// @inheritdoc IRewardsController
187183 function setClaimer (address user , address caller ) external override onlyEmissionManager {
188184 _authorizedClaimers[user] = caller;
189185 emit ClaimerSet (user, caller);
@@ -199,9 +195,9 @@ contract IncentivesControllerV2 is
199195 internal
200196 view
201197 override
202- returns (DistributionTypesV2 .UserAssetStatsInput[] memory userState )
198+ returns (RewardsDistributorTypes .UserAssetStatsInput[] memory userState )
203199 {
204- userState = new DistributionTypesV2 .UserAssetStatsInput [](assets.length );
200+ userState = new RewardsDistributorTypes .UserAssetStatsInput [](assets.length );
205201 for (uint256 i = 0 ; i < assets.length ; i++ ) {
206202 userState[i].underlyingAsset = assets[i];
207203 (userState[i].userBalance, userState[i].totalSupply) = IScaledBalanceToken (assets[i])
0 commit comments