@gearbox-protocol/periphery-v3 1.3.15 → 1.3.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.
- package/contracts/data/{DataCompressor_2_1.sol → DataCompressorV2_1.sol} +3 -3
- package/contracts/data/{DataCompressor_3_0.sol → DataCompressorV3.sol} +4 -16
- package/contracts/interfaces/{IDataCompressorV2_10.sol → IDataCompressorV2_1.sol} +1 -1
- package/contracts/interfaces/{IDataCompressorV3_00.sol → IDataCompressorV3.sol} +1 -1
- package/contracts/test/DC_Test.sol +8 -8
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ import {IVersion} from "@gearbox-protocol/core-v2/contracts/interfaces/IVersion.
|
|
|
28
28
|
import {ACLNonReentrantTrait} from "@gearbox-protocol/core-v3/contracts/traits/ACLNonReentrantTrait.sol";
|
|
29
29
|
|
|
30
30
|
import {IAddressProvider} from "@gearbox-protocol/core-v2/contracts/interfaces/IAddressProvider.sol";
|
|
31
|
-
import {
|
|
31
|
+
import {IDataCompressorV2_1} from "../interfaces/IDataCompressorV2_1.sol";
|
|
32
32
|
|
|
33
33
|
import {
|
|
34
34
|
COUNT,
|
|
@@ -48,8 +48,8 @@ import {LinearInterestModelHelper} from "./LinearInterestModelHelper.sol";
|
|
|
48
48
|
/// @title Data compressor 2.1.
|
|
49
49
|
/// @notice Collects data from various contracts for use in the dApp
|
|
50
50
|
/// Do not use for data from data compressor for state-changing functions
|
|
51
|
-
contract
|
|
52
|
-
|
|
51
|
+
contract DataCompressorV2_1 is
|
|
52
|
+
IDataCompressorV2_1,
|
|
53
53
|
ACLNonReentrantTrait,
|
|
54
54
|
ContractsRegisterTrait,
|
|
55
55
|
LinearInterestModelHelper
|
|
@@ -39,7 +39,7 @@ import {IUpdatablePriceFeed} from "@gearbox-protocol/core-v2/contracts/interface
|
|
|
39
39
|
import {IVersion} from "@gearbox-protocol/core-v2/contracts/interfaces/IVersion.sol";
|
|
40
40
|
|
|
41
41
|
import {AddressProvider} from "@gearbox-protocol/core-v2/contracts/core/AddressProvider.sol";
|
|
42
|
-
import {
|
|
42
|
+
import {IDataCompressorV3, PriceOnDemand} from "../interfaces/IDataCompressorV3.sol";
|
|
43
43
|
import {IZapper} from "@gearbox-protocol/integrations-v3/contracts/interfaces/zappers/IZapper.sol";
|
|
44
44
|
|
|
45
45
|
import {
|
|
@@ -68,9 +68,9 @@ import "forge-std/console.sol";
|
|
|
68
68
|
/// @title Data compressor 3.0.
|
|
69
69
|
/// @notice Collects data from various contracts for use in the dApp
|
|
70
70
|
/// Do not use for data from data compressor for state-changing functions
|
|
71
|
-
contract
|
|
71
|
+
contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearInterestModelHelper {
|
|
72
72
|
// Contract version
|
|
73
|
-
uint256 public constant version =
|
|
73
|
+
uint256 public constant version = 3_01;
|
|
74
74
|
|
|
75
75
|
IZapperRegister public zapperRegister;
|
|
76
76
|
|
|
@@ -269,22 +269,10 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
269
269
|
result.totalValue = collateralDebtData.totalValue;
|
|
270
270
|
result.isSuccessful = true;
|
|
271
271
|
} catch {
|
|
272
|
-
result.priceFeedsNeeded = _getPriceFeedFailedList(
|
|
272
|
+
result.priceFeedsNeeded = _getPriceFeedFailedList(_cm, result.balances);
|
|
273
273
|
result.isSuccessful = false;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// (result.totalValue,) = creditFacade.calcTotalValue(creditAccount);
|
|
277
|
-
// = ICreditAccountV3(creditAccount).cumulativeIndexAtOpen();
|
|
278
|
-
|
|
279
|
-
// uint256 debt;
|
|
280
|
-
// uint256 cumulativeIndexLastUpdate;
|
|
281
|
-
// uint128 cumulativeQuotaInterest;
|
|
282
|
-
// uint128 quotaFees;
|
|
283
|
-
// uint256 enabledTokensMask;
|
|
284
|
-
// uint16 flags;
|
|
285
|
-
// uint64 since;
|
|
286
|
-
// address borrower;
|
|
287
|
-
|
|
288
276
|
(result.debt, result.cumulativeIndexLastUpdate, result.cumulativeQuotaInterest,,,, result.since,) =
|
|
289
277
|
CreditManagerV3(_cm).creditAccountInfo(_creditAccount);
|
|
290
278
|
|
|
@@ -6,7 +6,7 @@ pragma solidity ^0.8.10;
|
|
|
6
6
|
import {CreditAccountData, CreditManagerData, PoolData} from "../data/Types.sol";
|
|
7
7
|
import {IVersion} from "@gearbox-protocol/core-v2/contracts/interfaces/IVersion.sol";
|
|
8
8
|
|
|
9
|
-
interface
|
|
9
|
+
interface IDataCompressorV2_1 is IVersion {
|
|
10
10
|
/// @dev Returns CreditAccountData for all opened accounts for particular borrower
|
|
11
11
|
/// @param borrower Borrower address
|
|
12
12
|
function getCreditAccountsByBorrower(address borrower) external view returns (CreditAccountData[] memory);
|
|
@@ -11,7 +11,7 @@ struct PriceOnDemand {
|
|
|
11
11
|
bytes callData;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface
|
|
14
|
+
interface IDataCompressorV3 is IVersion {
|
|
15
15
|
/// @dev Returns CreditAccountData for all opened accounts for particular borrower
|
|
16
16
|
/// @param borrower Borrower address
|
|
17
17
|
/// @param priceUpdates Price updates for price on demand oracles
|
|
@@ -5,9 +5,9 @@ pragma solidity ^0.8.17;
|
|
|
5
5
|
|
|
6
6
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import {DataCompressorV2_1} from "../data/DataCompressorV2_1.sol";
|
|
9
|
+
import {DataCompressorV3} from "../data/DataCompressorV3.sol";
|
|
10
|
+
import {IDataCompressorV3, PriceOnDemand} from "../interfaces/IDataCompressorV3.sol";
|
|
11
11
|
import {CreditAccountData, CreditManagerData, PoolData, TokenBalance, ContractAdapter} from "../data/Types.sol";
|
|
12
12
|
|
|
13
13
|
import {NetworkDetector} from "@gearbox-protocol/sdk-gov/contracts/NetworkDetector.sol";
|
|
@@ -17,8 +17,8 @@ import "forge-std/console.sol";
|
|
|
17
17
|
address constant ap = 0x9ea7b04Da02a5373317D745c1571c84aaD03321D;
|
|
18
18
|
|
|
19
19
|
contract DCTest {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
DataCompressorV2_1 public dc2;
|
|
21
|
+
DataCompressorV3 public dc3;
|
|
22
22
|
|
|
23
23
|
uint256 chainId;
|
|
24
24
|
|
|
@@ -34,8 +34,8 @@ contract DCTest {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function setUp() public liveTestOnly {
|
|
37
|
-
dc2 = new
|
|
38
|
-
dc3 = new
|
|
37
|
+
dc2 = new DataCompressorV2_1(ap);
|
|
38
|
+
dc3 = new DataCompressorV3(ap);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function _printPools(PoolData[] memory pools) internal view {
|
|
@@ -139,6 +139,6 @@ contract DCTest {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// function test_dc_04_borrower() public liveTestOnly {
|
|
142
|
-
// dc3.getCreditAccountsByBorrower(
|
|
142
|
+
// dc3.getCreditAccountsByBorrower(0xf13df765f3047850Cede5aA9fDF20a12A75f7F70, new PriceOnDemand[](0));
|
|
143
143
|
// }
|
|
144
144
|
}
|
package/package.json
CHANGED