@gearbox-protocol/periphery-v3 1.7.0-next.14 → 1.7.0-next.16

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.
@@ -367,12 +367,12 @@ contract CreditAccountCompressor is IVersion, SanityCheckTrait {
367
367
  }
368
368
 
369
369
  // allocate the array with maximum potentially needed size (total number of credit managers can be assumed
370
- // to be relatively small and the function is only called once, so memary expansion cost is not an issue)
370
+ // to be relatively small and the function is only called once, so memory expansion cost is not an issue)
371
371
  creditManagers = new address[](max);
372
372
  uint256 num;
373
373
  for (uint256 i; i < configurators.length; ++i) {
374
- if (filter.curator != address(0)) {
375
- if (IMarketConfiguratorV3(configurators[i]).owner() != filter.curator) continue;
374
+ if (filter.curators.length != 0) {
375
+ if (!_contains(filter.curators, IMarketConfiguratorV3(configurators[i]).owner())) continue;
376
376
  }
377
377
 
378
378
  address cr = IMarketConfiguratorV3(configurators[i]).contractsRegister();
@@ -382,8 +382,8 @@ contract CreditAccountCompressor is IVersion, SanityCheckTrait {
382
382
  uint256 ver = IVersion(managers[j]).version();
383
383
  if (ver < 3_00 || ver > 3_99) continue;
384
384
 
385
- if (filter.pool != address(0)) {
386
- if (ICreditManagerV3(managers[j]).pool() != filter.pool) continue;
385
+ if (filter.pools.length != 0) {
386
+ if (!_contains(filter.pools, ICreditManagerV3(managers[j]).pool())) continue;
387
387
  }
388
388
 
389
389
  if (filter.underlying != address(0)) {
@@ -399,4 +399,12 @@ contract CreditAccountCompressor is IVersion, SanityCheckTrait {
399
399
  mstore(creditManagers, num)
400
400
  }
401
401
  }
402
+
403
+ /// @dev Checks whether `arr` contains `value`
404
+ function _contains(address[] memory arr, address value) internal pure returns (bool) {
405
+ for (uint256 i; i < arr.length; ++i) {
406
+ if (value == arr[i]) return true;
407
+ }
408
+ return false;
409
+ }
402
410
  }
@@ -62,6 +62,7 @@ contract PriceFeedCompressor is IPriceFeedCompressor {
62
62
  _setSerializer(uint8(PriceFeedType.WRAPPED_AAVE_V2_ORACLE), lpSerializer);
63
63
  _setSerializer(uint8(PriceFeedType.WSTETH_ORACLE), lpSerializer);
64
64
  _setSerializer(uint8(PriceFeedType.YEARN_ORACLE), lpSerializer);
65
+ _setSerializer(uint8(PriceFeedType.MELLOW_LRT_ORACLE), lpSerializer);
65
66
 
66
67
  // these types need special serialization
67
68
  _setSerializer(uint8(PriceFeedType.BALANCER_WEIGHTED_LP_ORACLE), address(new BPTWeightedPriceFeedSerializer()));
@@ -55,13 +55,13 @@ struct CreditAccountFilter {
55
55
  bool reverting;
56
56
  }
57
57
 
58
- // @notice Credit manager filters
59
- /// @param curator If set, match credit managers managed by given curator
60
- /// @param pool If set, match credit managers connected to a given pool
58
+ /// @notice Credit manager filters
59
+ /// @param curators If set, match credit managers managed by given curators
60
+ /// @param pools If set, match credit managers connected to given pools
61
61
  /// @param underlying If set, match credit managers with given underlying
62
62
  struct CreditManagerFilter {
63
- address curator;
64
- address pool;
63
+ address[] curators;
64
+ address[] pools;
65
65
  address underlying;
66
66
  }
67
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/periphery-v3",
3
- "version": "1.7.0-next.14",
3
+ "version": "1.7.0-next.16",
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,7 @@
22
22
  "@gearbox-protocol/governance": "^1.4.0-next.5",
23
23
  "@gearbox-protocol/integrations-v3": "^1.23.1",
24
24
  "@gearbox-protocol/oracles-v3": "^1.11.0-next.3",
25
- "@gearbox-protocol/sdk-gov": "^2.3.1",
25
+ "@gearbox-protocol/sdk-gov": "^2.14.1",
26
26
  "@openzeppelin/contracts": "^4.9.3",
27
27
  "@redstone-finance/evm-connector": "0.2.5",
28
28
  "ds-test": "dapphub/ds-test",