mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
PR changes
This commit is contained in:
parent
5f33163983
commit
b25c7a0ad5
|
@ -136,11 +136,10 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
userReservesIncentivesData[i].underlyingAsset = reserves[i];
|
userReservesIncentivesData[i].underlyingAsset = reserves[i];
|
||||||
|
|
||||||
IUiIncentiveDataProvider.UserIncentiveData memory aUserIncentiveData;
|
IUiIncentiveDataProvider.UserIncentiveData memory aUserIncentiveData;
|
||||||
|
|
||||||
if (baseData.aTokenAddress != address(0)) {
|
|
||||||
IAaveIncentivesController aTokenIncentiveController =
|
IAaveIncentivesController aTokenIncentiveController =
|
||||||
IAToken(baseData.aTokenAddress).getIncentivesController();
|
IAToken(baseData.aTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
|
if (address(aTokenIncentiveController) != address(0)) {
|
||||||
aUserIncentiveData.tokenincentivesUserIndex = aTokenIncentiveController.getUserAssetData(
|
aUserIncentiveData.tokenincentivesUserIndex = aTokenIncentiveController.getUserAssetData(
|
||||||
user,
|
user,
|
||||||
baseData.aTokenAddress
|
baseData.aTokenAddress
|
||||||
|
@ -150,21 +149,15 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
);
|
);
|
||||||
aUserIncentiveData.tokenAddress = baseData.aTokenAddress;
|
aUserIncentiveData.tokenAddress = baseData.aTokenAddress;
|
||||||
aUserIncentiveData.rewardTokenAddress = aTokenIncentiveController.REWARD_TOKEN();
|
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;
|
||||||
|
|
||||||
UserIncentiveData memory vUserIncentiveData;
|
UserIncentiveData memory vUserIncentiveData;
|
||||||
|
|
||||||
if (baseData.variableDebtTokenAddress != address(0)) {
|
|
||||||
IAaveIncentivesController vTokenIncentiveController =
|
IAaveIncentivesController vTokenIncentiveController =
|
||||||
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
IVariableDebtToken(baseData.variableDebtTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
|
if (address(vTokenIncentiveController) != address(0)) {
|
||||||
vUserIncentiveData.tokenincentivesUserIndex = vTokenIncentiveController.getUserAssetData(
|
vUserIncentiveData.tokenincentivesUserIndex = vTokenIncentiveController.getUserAssetData(
|
||||||
user,
|
user,
|
||||||
baseData.variableDebtTokenAddress
|
baseData.variableDebtTokenAddress
|
||||||
|
@ -174,21 +167,15 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
);
|
);
|
||||||
vUserIncentiveData.tokenAddress = baseData.variableDebtTokenAddress;
|
vUserIncentiveData.tokenAddress = baseData.variableDebtTokenAddress;
|
||||||
vUserIncentiveData.rewardTokenAddress = vTokenIncentiveController.REWARD_TOKEN();
|
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;
|
||||||
|
|
||||||
UserIncentiveData memory sUserIncentiveData;
|
UserIncentiveData memory sUserIncentiveData;
|
||||||
|
|
||||||
if (baseData.stableDebtTokenAddress != address(0)) {
|
|
||||||
IAaveIncentivesController sTokenIncentiveController =
|
IAaveIncentivesController sTokenIncentiveController =
|
||||||
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
IStableDebtToken(baseData.stableDebtTokenAddress).getIncentivesController();
|
||||||
|
|
||||||
|
if (address(sTokenIncentiveController) != address(0)) {
|
||||||
sUserIncentiveData.tokenincentivesUserIndex = sTokenIncentiveController.getUserAssetData(
|
sUserIncentiveData.tokenincentivesUserIndex = sTokenIncentiveController.getUserAssetData(
|
||||||
user,
|
user,
|
||||||
baseData.stableDebtTokenAddress
|
baseData.stableDebtTokenAddress
|
||||||
|
@ -198,11 +185,6 @@ contract UiIncentiveDataProvider is IUiIncentiveDataProvider {
|
||||||
);
|
);
|
||||||
sUserIncentiveData.tokenAddress = baseData.stableDebtTokenAddress;
|
sUserIncentiveData.tokenAddress = baseData.stableDebtTokenAddress;
|
||||||
sUserIncentiveData.rewardTokenAddress = sTokenIncentiveController.REWARD_TOKEN();
|
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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user