Skip to content

Commit c1c2cff

Browse files
committed
remove try catch as it doesnt catch the implementation exeption
1 parent d36b9fd commit c1c2cff

File tree

1 file changed

+24
-48
lines changed

1 file changed

+24
-48
lines changed

contracts/misc/UiPoolDataProvider.sol

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -132,57 +132,40 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
132132

133133
// incentives
134134
if (address(0) != address(incentivesController)) {
135-
try incentivesController.getAssetData(reserveData.aTokenAddress) returns (
136-
uint256 aEmissionPerSecond, uint256 aIncentivesLastUpdateTimestamp, uint256 aTokenIncentivesIndex) {
137-
138-
reserveData.aEmissionPerSecond = aEmissionPerSecond;
139-
reserveData.aIncentivesLastUpdateTimestamp = aIncentivesLastUpdateTimestamp;
140-
reserveData.aTokenIncentivesIndex = aTokenIncentivesIndex;
141-
} catch Error(string memory) {} catch (bytes memory) {}
142-
143-
try incentivesController.getAssetData(reserveData.variableDebtTokenAddress) returns (
144-
uint256 vEmissionPerSecond, uint256 vIncentivesLastUpdateTimestamp, uint256 vTokenIncentivesIndex) {
145-
146-
reserveData.vEmissionPerSecond = vEmissionPerSecond;
147-
reserveData.vIncentivesLastUpdateTimestamp = vIncentivesLastUpdateTimestamp;
148-
reserveData.vTokenIncentivesIndex = vTokenIncentivesIndex;
149-
} catch Error(string memory) {} catch (bytes memory) {}
150-
151-
try incentivesController.getAssetData(reserveData.stableDebtTokenAddress) returns (
152-
uint256 sEmissionPerSecond, uint256 sIncentivesLastUpdateTimestamp, uint256 sTokenIncentivesIndex) {
153-
154-
reserveData.sEmissionPerSecond = sEmissionPerSecond;
155-
reserveData.sIncentivesLastUpdateTimestamp = sIncentivesLastUpdateTimestamp;
156-
reserveData.sTokenIncentivesIndex = sTokenIncentivesIndex;
157-
} catch Error(string memory) {} catch (bytes memory) {}
135+
(
136+
reserveData.aEmissionPerSecond,
137+
reserveData.aIncentivesLastUpdateTimestamp,
138+
reserveData.aTokenIncentivesIndex
139+
) = incentivesController.getAssetData(reserveData.aTokenAddress);
140+
141+
(
142+
reserveData.sEmissionPerSecond,
143+
reserveData.sIncentivesLastUpdateTimestamp,
144+
reserveData.sTokenIncentivesIndex
145+
) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress);
146+
147+
(
148+
reserveData.vEmissionPerSecond,
149+
reserveData.vIncentivesLastUpdateTimestamp,
150+
reserveData.vTokenIncentivesIndex
151+
) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress);
158152
}
159153

160154
if (user != address(0)) {
161155
// incentives
162156
if (address(0) != address(incentivesController)) {
163-
try incentivesController.getUserAssetData(
157+
userReservesData[i].aTokenincentivesUserIndex = incentivesController.getUserAssetData(
164158
user,
165159
reserveData.aTokenAddress
166-
) returns (
167-
uint256 aTokenincentivesUserIndex) {
168-
userReservesData[i].aTokenincentivesUserIndex = aTokenincentivesUserIndex;
169-
} catch Error(string memory) {} catch (bytes memory) {}
170-
171-
try incentivesController.getUserAssetData(
160+
);
161+
userReservesData[i].vTokenincentivesUserIndex = incentivesController.getUserAssetData(
172162
user,
173163
reserveData.variableDebtTokenAddress
174-
) returns (
175-
uint256 vTokenincentivesUserIndex) {
176-
userReservesData[i].vTokenincentivesUserIndex = vTokenincentivesUserIndex;
177-
} catch Error(string memory) {} catch (bytes memory) {}
178-
179-
try incentivesController.getUserAssetData(
164+
);
165+
userReservesData[i].sTokenincentivesUserIndex = incentivesController.getUserAssetData(
180166
user,
181167
reserveData.stableDebtTokenAddress
182-
) returns (
183-
uint256 sTokenincentivesUserIndex) {
184-
userReservesData[i].sTokenincentivesUserIndex = sTokenincentivesUserIndex;
185-
} catch Error(string memory) {} catch (bytes memory) {}
168+
);
186169
}
187170
// user reserve data
188171
userReservesData[i].underlyingAsset = reserveData.underlyingAsset;
@@ -217,18 +200,11 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
217200
}
218201
}
219202

220-
uint256 unclaimedRewards;
221-
if (address(0) != address(incentivesController)) {
222-
try incentivesController.getUserUnclaimedRewards(user) returns (uint256 rewards) {
223-
unclaimedRewards = rewards;
224-
} catch {}
225-
}
226-
227203
return (
228204
reservesData,
229205
userReservesData,
230206
oracle.getAssetPrice(MOCK_USD_ADDRESS),
231-
unclaimedRewards
207+
incentivesController.getUserUnclaimedRewards(user)
232208
);
233209
}
234210
}

0 commit comments

Comments
 (0)