mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
PR change fixes
This commit is contained in:
parent
c786b246cc
commit
5f33163983
|
@ -55,10 +55,10 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
IAToken(baseData.aTokenAddress).getIncentivesController();
|
IAToken(baseData.aTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
(
|
(
|
||||||
|
uint256 aTokenIncentivesIndex,
|
||||||
uint256 aEmissionPerSecond,
|
uint256 aEmissionPerSecond,
|
||||||
uint256 aIncentivesLastUpdateTimestamp,
|
uint256 aIncentivesLastUpdateTimestamp
|
||||||
uint256 aTokenIncentivesIndex
|
) = aTokenIncentiveController.getAssetData(baseData.aTokenAddress);
|
||||||
) = aTokenIncentiveController.assets(baseData.aTokenAddress);
|
|
||||||
|
|
||||||
reserveIncentiveData.aIncentiveData = IncentiveData(
|
reserveIncentiveData.aIncentiveData = IncentiveData(
|
||||||
aEmissionPerSecond,
|
aEmissionPerSecond,
|
||||||
|
@ -73,10 +73,10 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
(
|
(
|
||||||
|
uint256 sTokenIncentivesIndex,
|
||||||
uint256 sEmissionPerSecond,
|
uint256 sEmissionPerSecond,
|
||||||
uint256 sIncentivesLastUpdateTimestamp,
|
uint256 sIncentivesLastUpdateTimestamp
|
||||||
uint256 sTokenIncentivesIndex
|
) = sTokenIncentiveController.getAssetData(baseData.stableDebtTokenAddress);
|
||||||
) = sTokenIncentiveController.assets(baseData.stableDebtTokenAddress);
|
|
||||||
|
|
||||||
reserveIncentiveData.sIncentiveData = IncentiveData(
|
reserveIncentiveData.sIncentiveData = IncentiveData(
|
||||||
sEmissionPerSecond,
|
sEmissionPerSecond,
|
||||||
|
@ -91,10 +91,10 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
(
|
(
|
||||||
|
uint256 vTokenIncentivesIndex,
|
||||||
uint256 vEmissionPerSecond,
|
uint256 vEmissionPerSecond,
|
||||||
uint256 vIncentivesLastUpdateTimestamp,
|
uint256 vIncentivesLastUpdateTimestamp
|
||||||
uint256 vTokenIncentivesIndex
|
) = vTokenIncentiveController.getAssetData(baseData.variableDebtTokenAddress);
|
||||||
) = vTokenIncentiveController.assets(baseData.variableDebtTokenAddress);
|
|
||||||
|
|
||||||
reserveIncentiveData.vIncentiveData = IncentiveData(
|
reserveIncentiveData.vIncentiveData = IncentiveData(
|
||||||
vEmissionPerSecond,
|
vEmissionPerSecond,
|
||||||
|
@ -135,49 +135,75 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
// user reserve data
|
// user reserve data
|
||||||
userReservesIncentivesData[i].underlyingAsset = reserves[i];
|
userReservesIncentivesData[i].underlyingAsset = reserves[i];
|
||||||
|
|
||||||
IAaveIncentivesController aTokenIncentiveController =
|
|
||||||
IAToken(baseData.aTokenAddress).getIncentivesController();
|
|
||||||
|
|
||||||
IUiIncentiveDataProvider.UserIncentiveData memory aUserIncentiveData;
|
IUiIncentiveDataProvider.UserIncentiveData memory aUserIncentiveData;
|
||||||
aUserIncentiveData.tokenincentivesUserIndex = aTokenIncentiveController.getUserAssetData(
|
|
||||||
user,
|
if (baseData.aTokenAddress != address(0)) {
|
||||||
baseData.aTokenAddress
|
IAaveIncentivesController aTokenIncentiveController =
|
||||||
);
|
IAToken(baseData.aTokenAddress).getIncentivesController();
|
||||||
aUserIncentiveData.userUnclaimedRewards = aTokenIncentiveController.getUserUnclaimedRewards(
|
|
||||||
user
|
aUserIncentiveData.tokenincentivesUserIndex = aTokenIncentiveController.getUserAssetData(
|
||||||
);
|
user,
|
||||||
aUserIncentiveData.tokenAddress = baseData.aTokenAddress;
|
baseData.aTokenAddress
|
||||||
aUserIncentiveData.rewardTokenAddress = aTokenIncentiveController.REWARD_TOKEN();
|
);
|
||||||
|
aUserIncentiveData.userUnclaimedRewards = aTokenIncentiveController.getUserUnclaimedRewards(
|
||||||
|
user
|
||||||
|
);
|
||||||
|
aUserIncentiveData.tokenAddress = baseData.aTokenAddress;
|
||||||
|
aUserIncentiveData.rewardTokenAddress = aTokenIncentiveController.REWARD_TOKEN();
|
||||||
|
} else {
|
||||||
|
aUserIncentiveData.tokenincentivesUserIndex = uint256(0);
|
||||||
|
aUserIncentiveData.userUnclaimedRewards = uint256(0);
|
||||||
|
aUserIncentiveData.tokenAddress = baseData.aTokenAddress;
|
||||||
|
aUserIncentiveData.rewardTokenAddress = address(0);
|
||||||
|
}
|
||||||
|
|
||||||
userReservesIncentivesData[i].aTokenIncentivesUserData = aUserIncentiveData;
|
userReservesIncentivesData[i].aTokenIncentivesUserData = aUserIncentiveData;
|
||||||
|
|
||||||
IAaveIncentivesController vTokenIncentiveController =
|
|
||||||
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
|
||||||
UserIncentiveData memory vUserIncentiveData;
|
UserIncentiveData memory vUserIncentiveData;
|
||||||
vUserIncentiveData.tokenincentivesUserIndex = vTokenIncentiveController.getUserAssetData(
|
|
||||||
user,
|
if (baseData.variableDebtTokenAddress != address(0)) {
|
||||||
baseData.variableDebtTokenAddress
|
IAaveIncentivesController vTokenIncentiveController =
|
||||||
);
|
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
||||||
vUserIncentiveData.userUnclaimedRewards = vTokenIncentiveController.getUserUnclaimedRewards(
|
|
||||||
user
|
vUserIncentiveData.tokenincentivesUserIndex = vTokenIncentiveController.getUserAssetData(
|
||||||
);
|
user,
|
||||||
vUserIncentiveData.tokenAddress = baseData.variableDebtTokenAddress;
|
baseData.variableDebtTokenAddress
|
||||||
vUserIncentiveData.rewardTokenAddress = vTokenIncentiveController.REWARD_TOKEN();
|
);
|
||||||
|
vUserIncentiveData.userUnclaimedRewards = vTokenIncentiveController.getUserUnclaimedRewards(
|
||||||
|
user
|
||||||
|
);
|
||||||
|
vUserIncentiveData.tokenAddress = baseData.variableDebtTokenAddress;
|
||||||
|
vUserIncentiveData.rewardTokenAddress = vTokenIncentiveController.REWARD_TOKEN();
|
||||||
|
} else {
|
||||||
|
vUserIncentiveData.tokenincentivesUserIndex = uint256(0);
|
||||||
|
vUserIncentiveData.userUnclaimedRewards = uint256(0);
|
||||||
|
vUserIncentiveData.tokenAddress = baseData.variableDebtTokenAddress;
|
||||||
|
vUserIncentiveData.rewardTokenAddress = address(0);
|
||||||
|
}
|
||||||
|
|
||||||
userReservesIncentivesData[i].vTokenIncentivesUserData = vUserIncentiveData;
|
userReservesIncentivesData[i].vTokenIncentivesUserData = vUserIncentiveData;
|
||||||
|
|
||||||
IAaveIncentivesController sTokenIncentiveController =
|
|
||||||
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
|
||||||
UserIncentiveData memory sUserIncentiveData;
|
UserIncentiveData memory sUserIncentiveData;
|
||||||
sUserIncentiveData.tokenincentivesUserIndex = sTokenIncentiveController.getUserAssetData(
|
|
||||||
user,
|
if (baseData.stableDebtTokenAddress != address(0)) {
|
||||||
baseData.stableDebtTokenAddress
|
IAaveIncentivesController sTokenIncentiveController =
|
||||||
);
|
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
||||||
sUserIncentiveData.userUnclaimedRewards = sTokenIncentiveController.getUserUnclaimedRewards(
|
|
||||||
user
|
sUserIncentiveData.tokenincentivesUserIndex = sTokenIncentiveController.getUserAssetData(
|
||||||
);
|
user,
|
||||||
sUserIncentiveData.tokenAddress = baseData.stableDebtTokenAddress;
|
baseData.stableDebtTokenAddress
|
||||||
sUserIncentiveData.rewardTokenAddress = sTokenIncentiveController.REWARD_TOKEN();
|
);
|
||||||
|
sUserIncentiveData.userUnclaimedRewards = sTokenIncentiveController.getUserUnclaimedRewards(
|
||||||
|
user
|
||||||
|
);
|
||||||
|
sUserIncentiveData.tokenAddress = baseData.stableDebtTokenAddress;
|
||||||
|
sUserIncentiveData.rewardTokenAddress = sTokenIncentiveController.REWARD_TOKEN();
|
||||||
|
} else {
|
||||||
|
sUserIncentiveData.tokenincentivesUserIndex = uint256(0);
|
||||||
|
sUserIncentiveData.userUnclaimedRewards = uint256(0);
|
||||||
|
sUserIncentiveData.tokenAddress = baseData.stableDebtTokenAddress;
|
||||||
|
sUserIncentiveData.rewardTokenAddress = address(0);
|
||||||
|
}
|
||||||
|
|
||||||
userReservesIncentivesData[i].sTokenIncentivesUserData = sUserIncentiveData;
|
userReservesIncentivesData[i].sTokenIncentivesUserData = sUserIncentiveData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,6 @@ interface IUiPoolDataProvider {
|
||||||
uint256 stableBorrowLastUpdateTimestamp;
|
uint256 stableBorrowLastUpdateTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IncentivesControllerData {
|
|
||||||
uint256 userUnclaimedRewards;
|
|
||||||
uint256 emissionEndTimestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getReservesList(ILendingPoolAddressesProvider provider)
|
function getReservesList(ILendingPoolAddressesProvider provider)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
|
|
Loading…
Reference in New Issue
Block a user