From d51ac1d6fea00bb49ed850390c504c58ebe1172e Mon Sep 17 00:00:00 2001 From: andyk Date: Wed, 14 Jul 2021 15:56:41 +0200 Subject: [PATCH] temp fix for UIPoolDataProvider on polygon --- .../interfaces/IAaveIncentivesController.sol | 15 +++++++++++++++ contracts/misc/UiPoolDataProvider.sol | 18 ++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/contracts/interfaces/IAaveIncentivesController.sol b/contracts/interfaces/IAaveIncentivesController.sol index bae75967..0006e31e 100644 --- a/contracts/interfaces/IAaveIncentivesController.sol +++ b/contracts/interfaces/IAaveIncentivesController.sol @@ -30,6 +30,21 @@ interface IAaveIncentivesController { uint256 ); + /* + * LEGACY ************************** + * @dev Returns the configuration of the distribution for a certain asset + * @param asset The address of the reference asset of the distribution + * @return The asset index, the emission per second and the last updated timestamp + **/ + function assets(address asset) + external + view + returns ( + uint128, + uint128, + uint256 + ); + /** * @dev Whitelists an address to claim the rewards on behalf of another address * @param user The address of the user diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index 86876aab..5be19954 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -141,19 +141,22 @@ contract UiPoolDataProvider is IUiPoolDataProvider { reserveData.aTokenIncentivesIndex, reserveData.aEmissionPerSecond, reserveData.aIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.aTokenAddress); + // ) = incentivesController.getAssetData(reserveData.aTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.aTokenAddress); ( reserveData.sTokenIncentivesIndex, reserveData.sEmissionPerSecond, reserveData.sIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress); + // ) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.stableDebtTokenAddress); ( reserveData.vTokenIncentivesIndex, reserveData.vEmissionPerSecond, reserveData.vIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress); + // ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.variableDebtTokenAddress); } } @@ -315,19 +318,22 @@ contract UiPoolDataProvider is IUiPoolDataProvider { reserveData.aTokenIncentivesIndex, reserveData.aEmissionPerSecond, reserveData.aIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.aTokenAddress); + // ) = incentivesController.getAssetData(reserveData.aTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.aTokenAddress); ( reserveData.sTokenIncentivesIndex, reserveData.sEmissionPerSecond, reserveData.sIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress); + // ) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.stableDebtTokenAddress); ( reserveData.vTokenIncentivesIndex, reserveData.vEmissionPerSecond, reserveData.vIncentivesLastUpdateTimestamp - ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress); + // ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress); TODO: temp fix + ) = incentivesController.assets(reserveData.variableDebtTokenAddress); } if (user != address(0)) {