@gearbox-protocol/periphery-v3 1.2.5 → 1.2.7

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.
@@ -25,6 +25,8 @@ import {PoolService} from "@gearbox-protocol/core-v2/contracts/pool/PoolService.
25
25
 
26
26
  import {IVersion} from "@gearbox-protocol/core-v2/contracts/interfaces/IVersion.sol";
27
27
 
28
+ import {ACLNonReentrantTrait} from "@gearbox-protocol/core-v3/contracts/traits/ACLNonReentrantTrait.sol";
29
+
28
30
  import {IAddressProvider} from "@gearbox-protocol/core-v2/contracts/interfaces/IAddressProvider.sol";
29
31
  import {IDataCompressorV2_10} from "../interfaces/IDataCompressorV2_10.sol";
30
32
 
@@ -39,11 +41,21 @@ import {LinearInterestModelHelper} from "./LinearInterestModelHelper.sol";
39
41
  /// @title Data compressor 2.1.
40
42
  /// @notice Collects data from various contracts for use in the dApp
41
43
  /// Do not use for data from data compressor for state-changing functions
42
- contract DataCompressorV2_10 is IDataCompressorV2_10, ContractsRegisterTrait, LinearInterestModelHelper {
44
+ contract DataCompressorV2_10 is
45
+ IDataCompressorV2_10,
46
+ ACLNonReentrantTrait,
47
+ ContractsRegisterTrait,
48
+ LinearInterestModelHelper
49
+ {
43
50
  // Contract version
44
51
  uint256 public constant version = 2_10;
45
52
 
46
- constructor(address _addressProvider) ContractsRegisterTrait(_addressProvider) {}
53
+ mapping(address => string) public cmDescriptions;
54
+
55
+ constructor(address _addressProvider)
56
+ ACLNonReentrantTrait(_addressProvider)
57
+ ContractsRegisterTrait(_addressProvider)
58
+ {}
47
59
 
48
60
  /// @dev Returns CreditAccountData for all opened accounts for particular borrower
49
61
  /// @param borrower Borrower address
@@ -172,6 +184,7 @@ contract DataCompressorV2_10 is IDataCompressorV2_10, ContractsRegisterTrait, Li
172
184
 
173
185
  result.addr = _creditManager;
174
186
  result.cfVersion = ver;
187
+ result.description = cmDescriptions[_creditManager];
175
188
 
176
189
  result.underlying = creditManagerV2.underlying();
177
190
 
@@ -390,4 +403,8 @@ contract DataCompressorV2_10 is IDataCompressorV2_10, ContractsRegisterTrait, Li
390
403
  }
391
404
  }
392
405
  }
406
+
407
+ function setCreditManagerDescription(address _cm, string calldata description) external controllerOnly {
408
+ cmDescriptions[_cm] = description;
409
+ }
393
410
  }
@@ -344,7 +344,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
344
344
  ICreditFacadeV3 creditFacade = _getCreditFacade(address(creditManager));
345
345
 
346
346
  result.addr = _cm;
347
- result.description = _getDescription(_cm);
347
+ result.description = _getName(_cm);
348
348
  result.cfVersion = _getVersion(address(creditFacade));
349
349
 
350
350
  result.underlying = creditManager.underlying();
@@ -591,7 +591,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
591
591
 
592
592
  function _getSymbolAndName(address token) internal view returns (string memory symbol, string memory name) {
593
593
  symbol = IERC20Metadata(token).symbol();
594
- name = IERC20Metadata(token).name();
594
+ name = _getName(token);
595
595
  }
596
596
 
597
597
  function _getInterestRateModel(address pool) internal view returns (LinearModel memory) {
@@ -606,8 +606,8 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
606
606
  return ICreditManagerV3(cnt).pool();
607
607
  }
608
608
 
609
- function _getDescription(address _cm) internal view returns (string memory) {
610
- return ICreditManagerV3(_cm).description();
609
+ function _getName(address _cm) internal view returns (string memory) {
610
+ return IERC20Metadata(_cm).name();
611
611
  }
612
612
 
613
613
  function _getCollateralTokensCount(address _cm) internal view returns (uint256) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/periphery-v3",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
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>",
@@ -18,11 +18,11 @@
18
18
  "@commitlint/cli": "^17.6.3",
19
19
  "@commitlint/config-conventional": "17.6.0",
20
20
  "@gearbox-protocol/core-v2": "1.19.0-base.14",
21
- "@gearbox-protocol/core-v3": "^1.39.2",
21
+ "@gearbox-protocol/core-v3": "^1.40.0",
22
22
  "@gearbox-protocol/integrations-v3": "^1.16.0",
23
23
  "@gearbox-protocol/oracles-v3": "^1.7.2",
24
24
  "@gearbox-protocol/sdk-gov": "^1.5.10",
25
- "@openzeppelin/contracts": "4.8.3"
25
+ "@openzeppelin/contracts": "^4.9.3"
26
26
  },
27
27
  "dependencies": {
28
28
  "husky": "^8.0.3",