diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index c24e8939..70aef7b9 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -132,40 +132,57 @@ contract UiPoolDataProvider is IUiPoolDataProvider { // incentives if (address(0) != address(incentivesController)) { - ( - reserveData.aEmissionPerSecond, - reserveData.aIncentivesLastUpdateTimestamp, - reserveData.aTokenIncentivesIndex - ) = incentivesController.getAssetData(reserveData.aTokenAddress); + try incentivesController.getAssetData(reserveData.aTokenAddress) returns ( + uint256 aEmissionPerSecond, uint256 aIncentivesLastUpdateTimestamp, uint256 aTokenIncentivesIndex) { - ( - reserveData.sEmissionPerSecond, - reserveData.sIncentivesLastUpdateTimestamp, - reserveData.sTokenIncentivesIndex - ) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress); + reserveData.aEmissionPerSecond = aEmissionPerSecond; + reserveData.aIncentivesLastUpdateTimestamp = aIncentivesLastUpdateTimestamp; + reserveData.aTokenIncentivesIndex = aTokenIncentivesIndex; + } catch Error(string memory /*reason*/) {} - ( - reserveData.vEmissionPerSecond, - reserveData.vIncentivesLastUpdateTimestamp, - reserveData.vTokenIncentivesIndex - ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress); + try incentivesController.getAssetData(reserveData.variableDebtTokenAddress) returns ( + uint256 vEmissionPerSecond, uint256 vIncentivesLastUpdateTimestamp, uint256 vTokenIncentivesIndex) { + + reserveData.vEmissionPerSecond = vEmissionPerSecond; + reserveData.vIncentivesLastUpdateTimestamp = vIncentivesLastUpdateTimestamp; + reserveData.vTokenIncentivesIndex = vTokenIncentivesIndex; + } catch Error(string memory /*reason*/) {} + + try incentivesController.getAssetData(reserveData.stableDebtTokenAddress) returns ( + uint256 sEmissionPerSecond, uint256 sIncentivesLastUpdateTimestamp, uint256 sTokenIncentivesIndex) { + + reserveData.sEmissionPerSecond = sEmissionPerSecond; + reserveData.sIncentivesLastUpdateTimestamp = sIncentivesLastUpdateTimestamp; + reserveData.sTokenIncentivesIndex = sTokenIncentivesIndex; + } catch Error(string memory /*reason*/) {} } if (user != address(0)) { // incentives if (address(0) != address(incentivesController)) { - userReservesData[i].aTokenincentivesUserIndex = incentivesController.getUserAssetData( + try incentivesController.getUserAssetData( user, reserveData.aTokenAddress - ); - userReservesData[i].sTokenincentivesUserIndex = incentivesController.getUserAssetData( - user, - reserveData.stableDebtTokenAddress - ); - userReservesData[i].vTokenincentivesUserIndex = incentivesController.getUserAssetData( + ) returns ( + uint256 aTokenincentivesUserIndex) { + userReservesData[i].aTokenincentivesUserIndex = aTokenincentivesUserIndex; + } catch Error(string memory /*reason*/) {} + + try incentivesController.getUserAssetData( user, reserveData.variableDebtTokenAddress - ); + ) returns ( + uint256 vTokenincentivesUserIndex) { + userReservesData[i].vTokenincentivesUserIndex = vTokenincentivesUserIndex; + } catch Error(string memory /*reason*/) {} + + try incentivesController.getUserAssetData( + user, + reserveData.stableDebtTokenAddress + ) returns ( + uint256 sTokenincentivesUserIndex) { + userReservesData[i].sTokenincentivesUserIndex = sTokenincentivesUserIndex; + } catch Error(string memory /*reason*/) {} } // user reserve data userReservesData[i].underlyingAsset = reserveData.underlyingAsset; @@ -202,7 +219,9 @@ contract UiPoolDataProvider is IUiPoolDataProvider { uint256 unclaimedRewards; if (address(0) != address(incentivesController)) { - unclaimedRewards = incentivesController.getUserUnclaimedRewards(user); + // try incentivesController.getUserUnclaimedRewards(user) returns (uint256 rewards) { + // unclaimedRewards = rewards; + // } catch Error (string memory) {} } return ( diff --git a/package-lock.json b/package-lock.json index 6cd1ef03..c5cc43eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7709,6 +7709,15 @@ "requires": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true, + "optional": true + } } }, "browserify-sign": { @@ -7819,9 +7828,9 @@ }, "dependencies": { "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "dev": true } } @@ -10891,14 +10900,6 @@ "requires": { "min-document": "^2.19.0", "process": "^0.11.10" - }, - "dependencies": { - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true - } } }, "got": { @@ -12575,6 +12576,12 @@ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -14241,9 +14248,9 @@ }, "dependencies": { "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "dev": true } }