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 PRECISION() external view returns (uint8);
|
||||||
|
|
||||||
|
function DISTRIBUTION_END() external view returns (uint256);
|
||||||
|
|
||||||
function assets(address underlying) external view returns (AssetData memory assets);
|
function assets(address underlying) external view returns (AssetData memory assets);
|
||||||
|
|
||||||
function handleAction(
|
function handleAction(
|
||||||
|
|
|
@ -59,7 +59,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
||||||
AggregatedReserveData[] memory,
|
AggregatedReserveData[] memory,
|
||||||
UserReserveData[] memory,
|
UserReserveData[] memory,
|
||||||
uint256,
|
uint256,
|
||||||
uint256
|
IncentivesControllerData memory
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ILendingPool lendingPool = ILendingPool(provider.getLendingPool());
|
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 (
|
return (
|
||||||
reservesData,
|
reservesData,
|
||||||
userReservesData,
|
userReservesData,
|
||||||
oracle.getAssetPrice(MOCK_USD_ADDRESS),
|
oracle.getAssetPrice(MOCK_USD_ADDRESS),
|
||||||
incentivesController.getUserUnclaimedRewards(user)
|
incentivesControllerData
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,16 @@ interface IUiPoolDataProvider {
|
||||||
uint256 sTokenincentivesUserIndex;
|
uint256 sTokenincentivesUserIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct IncentivesControllerData {
|
||||||
|
uint256 userUnclaimedRewards;
|
||||||
|
// address rewardToken;
|
||||||
|
// uint256 rewardTokenDecimals;
|
||||||
|
// string rewardTokenSymbol;
|
||||||
|
// uint8 precision;
|
||||||
|
uint256 emissionEndTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getReservesData(ILendingPoolAddressesProvider provider, address user)
|
function getReservesData(ILendingPoolAddressesProvider provider, address user)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
|
@ -75,6 +85,6 @@ interface IUiPoolDataProvider {
|
||||||
AggregatedReserveData[] memory,
|
AggregatedReserveData[] memory,
|
||||||
UserReserveData[] memory,
|
UserReserveData[] memory,
|
||||||
uint256,
|
uint256,
|
||||||
uint256
|
IncentivesControllerData memory
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user