@gearbox-protocol/periphery-v3 1.3.17 → 1.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,13 +127,10 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
127
127
  uint256 len = creditManagers.length;
128
128
  unchecked {
129
129
  for (uint256 op = COUNT; op <= QUERY; ++op) {
130
- if (op == QUERY && index == 0) {
131
- break;
132
- } else {
133
- result = new CreditAccountData[](index);
134
- index = 0;
135
- }
130
+ if (op == QUERY && index == 0) break;
136
131
 
132
+ result = new CreditAccountData[](index);
133
+ index = 0;
137
134
  for (uint256 i = 0; i < len; ++i) {
138
135
  address _cm = creditManagers[i];
139
136
 
@@ -141,18 +138,20 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
141
138
  address[] memory creditAccounts = ICreditManagerV3(_cm).creditAccounts();
142
139
  uint256 caLen = creditAccounts.length;
143
140
  for (uint256 j; j < caLen; ++j) {
144
- if (
145
- (borrower == address(0) || _getBorrowerOrRevert(_cm, creditAccounts[j]) == borrower)
146
- && (
147
- !liquidatableOnly
148
- || ICreditManagerV3(_cm).isLiquidatable(creditAccounts[j], PERCENTAGE_FACTOR)
149
- )
150
- ) {
151
- if (op == QUERY) {
152
- result[index] = _getCreditAccountData(_cm, creditAccounts[j]);
153
- }
154
- ++index;
141
+ if (borrower != address(0) && borrower != _getBorrowerOrRevert(_cm, creditAccounts[j])) {
142
+ continue;
143
+ }
144
+
145
+ if (liquidatableOnly) {
146
+ try ICreditManagerV3(_cm).isLiquidatable(creditAccounts[j], PERCENTAGE_FACTOR) returns (
147
+ bool isLiquidatable
148
+ ) {
149
+ if (!isLiquidatable) continue;
150
+ } catch {}
155
151
  }
152
+
153
+ if (op == QUERY) result[index] = _getCreditAccountData(_cm, creditAccounts[j]);
154
+ ++index;
156
155
  }
157
156
  }
158
157
  }
@@ -548,9 +547,8 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
548
547
  TokenBalance memory balance = balances[i];
549
548
 
550
549
  if (balance.balance > 1 && balance.isEnabled) {
551
- try IPriceFeed(priceOracle.priceFeeds(balance.token)).latestRoundData() returns (
552
- uint80, int256, uint256, uint256, uint80
553
- ) {} catch {
550
+ try priceOracle.getPrice(balance.token) returns (uint256) {}
551
+ catch {
554
552
  if (op == QUERY) priceFeedFailed[index] = balance.token;
555
553
  ++index;
556
554
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/periphery-v3",
3
- "version": "1.3.17",
3
+ "version": "1.3.19",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:Gearbox-protocol/periphery-v3.git",
6
6
  "author": "Mikael <26343374+0xmikko@users.noreply.github.com>",
@@ -22,7 +22,9 @@
22
22
  "@gearbox-protocol/integrations-v3": "^1.23.1",
23
23
  "@gearbox-protocol/oracles-v3": "^1.8.1",
24
24
  "@gearbox-protocol/sdk-gov": "^1.14.0",
25
- "@openzeppelin/contracts": "^4.9.3"
25
+ "@openzeppelin/contracts": "^4.9.3",
26
+ "ds-test": "dapphub/ds-test",
27
+ "forge-std": "foundry-rs/forge-std"
26
28
  },
27
29
  "dependencies": {
28
30
  "husky": "^8.0.3",