mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feature: added emission end timestamp. Return struct instead, to save on stack space
This commit is contained in:
parent
b0caaee52e
commit
5e5962372e
|
@ -13,6 +13,8 @@ interface IAaveIncentivesController {
|
|||
|
||||
function PRECISION() external view returns (uint8);
|
||||
|
||||
function DISTRIBUTION_END() external view returns (uint256);
|
||||
|
||||
function assets(address underlying) external view returns (AssetData memory assets);
|
||||
|
||||
function handleAction(
|
||||
|
|
|
@ -59,7 +59,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
AggregatedReserveData[] memory,
|
||||
UserReserveData[] memory,
|
||||
uint256,
|
||||
uint256
|
||||
IncentivesControllerData memory
|
||||
)
|
||||
{
|
||||
ILendingPool lendingPool = ILendingPool(provider.getLendingPool());
|
||||
|
@ -194,11 +194,20 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
IncentivesControllerData memory incentivesControllerData;
|
||||
incentivesControllerData.userUnclaimedRewards = incentivesController.getUserUnclaimedRewards(user);
|
||||
// incentivesControllerData.rewardToken = incentivesController.REWARD_TOKEN();
|
||||
// incentivesControllerData.rewardTokenDecimals = IERC20Detailed(incentivesControllerData.rewardToken).decimals();
|
||||
// incentivesControllerData.rewardTokenSymbol = IERC20Detailed(incentivesControllerData.rewardToken).symbol();
|
||||
// incentivesControllerData.precision = incentivesController.PRECISION();
|
||||
incentivesControllerData.emissionEndTimestamp = incentivesController.DISTRIBUTION_END();
|
||||
|
||||
return (
|
||||
reservesData,
|
||||
userReservesData,
|
||||
oracle.getAssetPrice(MOCK_USD_ADDRESS),
|
||||
incentivesController.getUserUnclaimedRewards(user)
|
||||
incentivesControllerData
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,16 @@ interface IUiPoolDataProvider {
|
|||
uint256 sTokenincentivesUserIndex;
|
||||
}
|
||||
|
||||
struct IncentivesControllerData {
|
||||
uint256 userUnclaimedRewards;
|
||||
// address rewardToken;
|
||||
// uint256 rewardTokenDecimals;
|
||||
// string rewardTokenSymbol;
|
||||
// uint8 precision;
|
||||
uint256 emissionEndTimestamp;
|
||||
}
|
||||
|
||||
|
||||
function getReservesData(ILendingPoolAddressesProvider provider, address user)
|
||||
external
|
||||
view
|
||||
|
@ -75,6 +85,6 @@ interface IUiPoolDataProvider {
|
|||
AggregatedReserveData[] memory,
|
||||
UserReserveData[] memory,
|
||||
uint256,
|
||||
uint256
|
||||
IncentivesControllerData memory
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user