@@ -131,36 +131,40 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
131131 );
132132
133133 // incentives
134- IAaveIncentivesController.AssetData memory tokenIncentivesInfo =
135- incentivesController.assets (reserveData.aTokenAddress);
136- reserveData.aEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
137- reserveData.aIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
138- reserveData.aTokenIncentivesIndex = tokenIncentivesInfo.index;
139-
140- tokenIncentivesInfo = incentivesController.assets (reserveData.stableDebtTokenAddress);
141- reserveData.sEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
142- reserveData.sIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
143- reserveData.sTokenIncentivesIndex = tokenIncentivesInfo.index;
144-
145- tokenIncentivesInfo = incentivesController.assets (reserveData.variableDebtTokenAddress);
146- reserveData.vEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
147- reserveData.vIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
148- reserveData.vTokenIncentivesIndex = tokenIncentivesInfo.index;
149-
134+ if (address (incentivesController) != address (0 )) {
135+ IAaveIncentivesController.AssetData memory tokenIncentivesInfo =
136+ incentivesController.assets (reserveData.aTokenAddress);
137+ reserveData.aEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
138+ reserveData.aIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
139+ reserveData.aTokenIncentivesIndex = tokenIncentivesInfo.index;
140+
141+ tokenIncentivesInfo = incentivesController.assets (reserveData.stableDebtTokenAddress);
142+ reserveData.sEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
143+ reserveData.sIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
144+ reserveData.sTokenIncentivesIndex = tokenIncentivesInfo.index;
145+
146+ tokenIncentivesInfo = incentivesController.assets (reserveData.variableDebtTokenAddress);
147+ reserveData.vEmissionPerSecond = tokenIncentivesInfo.emissionPerSecond;
148+ reserveData.vIncentivesLastUpdateTimestamp = tokenIncentivesInfo.lastUpdateTimestamp;
149+ reserveData.vTokenIncentivesIndex = tokenIncentivesInfo.index;
150+ }
150151 if (user != address (0 )) {
151152 // incentives
152- userReservesData[i].aTokenincentivesUserIndex = incentivesController.getUserAssetData (
153- user,
154- reserveData.aTokenAddress
155- );
156- userReservesData[i].sTokenincentivesUserIndex = incentivesController.getUserAssetData (
157- user,
158- reserveData.stableDebtTokenAddress
159- );
160- userReservesData[i].vTokenincentivesUserIndex = incentivesController.getUserAssetData (
161- user,
162- reserveData.variableDebtTokenAddress
163- );
153+
154+ if (address (incentivesController) != address (0 )) {
155+ userReservesData[i].aTokenincentivesUserIndex = incentivesController.getUserAssetData (
156+ user,
157+ reserveData.aTokenAddress
158+ );
159+ userReservesData[i].sTokenincentivesUserIndex = incentivesController.getUserAssetData (
160+ user,
161+ reserveData.stableDebtTokenAddress
162+ );
163+ userReservesData[i].vTokenincentivesUserIndex = incentivesController.getUserAssetData (
164+ user,
165+ reserveData.variableDebtTokenAddress
166+ );
167+ }
164168 // user reserve data
165169 userReservesData[i].underlyingAsset = reserveData.underlyingAsset;
166170 userReservesData[i].scaledATokenBalance = IAToken (reserveData.aTokenAddress)
@@ -196,13 +200,16 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
196200
197201
198202 IncentivesControllerData memory incentivesControllerData;
199- incentivesControllerData.userUnclaimedRewards = incentivesController.getUserUnclaimedRewards (user);
200- // incentivesControllerData.rewardToken = incentivesController.REWARD_TOKEN();
201- // incentivesControllerData.rewardTokenDecimals = IERC20Detailed(incentivesControllerData.rewardToken).decimals();
202- // incentivesControllerData.rewardTokenSymbol = IERC20Detailed(incentivesControllerData.rewardToken).symbol();
203- // incentivesControllerData.precision = incentivesController.PRECISION();
204- incentivesControllerData.emissionEndTimestamp = incentivesController.DISTRIBUTION_END ();
205203
204+ if (address (incentivesController) != address (0 )) {
205+ incentivesControllerData.userUnclaimedRewards = incentivesController.getUserUnclaimedRewards (user);
206+ // incentivesControllerData.rewardToken = incentivesController.REWARD_TOKEN();
207+ // incentivesControllerData.rewardTokenDecimals = IERC20Detailed(incentivesControllerData.rewardToken).decimals();
208+ // incentivesControllerData.rewardTokenSymbol = IERC20Detailed(incentivesControllerData.rewardToken).symbol();
209+ // incentivesControllerData.precision = incentivesController.PRECISION();
210+ incentivesControllerData.emissionEndTimestamp = incentivesController.DISTRIBUTION_END ();
211+ }
212+
206213 return (
207214 reservesData,
208215 userReservesData,
0 commit comments