Skip to content

Commit 5e59623

Browse files
committed
feature: added emission end timestamp. Return struct instead, to save on stack space
1 parent b0caaee commit 5e59623

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

contracts/interfaces/IAaveIncentivesController.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ interface IAaveIncentivesController {
1313

1414
function PRECISION() external view returns (uint8);
1515

16+
function DISTRIBUTION_END() external view returns (uint256);
17+
1618
function assets(address underlying) external view returns (AssetData memory assets);
1719

1820
function handleAction(

contracts/misc/UiPoolDataProvider.sol

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
5959
AggregatedReserveData[] memory,
6060
UserReserveData[] memory,
6161
uint256,
62-
uint256
62+
IncentivesControllerData memory
6363
)
6464
{
6565
ILendingPool lendingPool = ILendingPool(provider.getLendingPool());
@@ -194,11 +194,20 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
194194
}
195195
}
196196

197+
198+
IncentivesControllerData memory incentivesControllerData;
199+
incentivesControllerData.userUnclaimedRewards = incentivesController.getUserUnclaimedRewards(user);
200+
// incentivesControllerData.rewardToken = incentivesController.REWARD_TOKEN();
201+
// incentivesControllerData.rewardTokenDecimals = IERC20Detailed(incentivesControllerData.rewardToken).decimals();
202+
// incentivesControllerData.rewardTokenSymbol = IERC20Detailed(incentivesControllerData.rewardToken).symbol();
203+
// incentivesControllerData.precision = incentivesController.PRECISION();
204+
incentivesControllerData.emissionEndTimestamp = incentivesController.DISTRIBUTION_END();
205+
197206
return (
198207
reservesData,
199208
userReservesData,
200209
oracle.getAssetPrice(MOCK_USD_ADDRESS),
201-
incentivesController.getUserUnclaimedRewards(user)
210+
incentivesControllerData
202211
);
203212
}
204213
}

contracts/misc/interfaces/IUiPoolDataProvider.sol

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,23 @@ interface IUiPoolDataProvider {
6868
uint256 sTokenincentivesUserIndex;
6969
}
7070

71+
struct IncentivesControllerData {
72+
uint256 userUnclaimedRewards;
73+
// address rewardToken;
74+
// uint256 rewardTokenDecimals;
75+
// string rewardTokenSymbol;
76+
// uint8 precision;
77+
uint256 emissionEndTimestamp;
78+
}
79+
80+
7181
function getReservesData(ILendingPoolAddressesProvider provider, address user)
7282
external
7383
view
7484
returns (
7585
AggregatedReserveData[] memory,
7686
UserReserveData[] memory,
7787
uint256,
78-
uint256
88+
IncentivesControllerData memory
7989
);
8090
}

0 commit comments

Comments
 (0)