@gearbox-protocol/periphery-v3 1.7.0-next.38 → 1.7.0-next.39
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.
|
@@ -13,6 +13,10 @@ import {IContractsRegisterLegacy} from
|
|
|
13
13
|
import {ACL} from "@gearbox-protocol/governance/contracts/market/ACL.sol";
|
|
14
14
|
import {ContractsRegister} from "@gearbox-protocol/governance/contracts/market/ContractsRegister.sol";
|
|
15
15
|
|
|
16
|
+
contract LossPolicy {
|
|
17
|
+
uint256 public constant version = 3_10;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
/// @dev Extremely dumbed-down version of `MarketConfiguratorLegacy` that is just enough to let compressors work
|
|
17
21
|
contract MarketConfigurator {
|
|
18
22
|
string public name;
|
|
@@ -22,8 +26,8 @@ contract MarketConfigurator {
|
|
|
22
26
|
|
|
23
27
|
constructor(string memory name_, address acl_, address contractsRegister_, address treasury_) {
|
|
24
28
|
name = name_;
|
|
25
|
-
acl =
|
|
26
|
-
contractsRegister = address(new ContractsRegister(
|
|
29
|
+
acl = address(new ACL());
|
|
30
|
+
contractsRegister = address(new ContractsRegister(acl));
|
|
27
31
|
treasury = treasury_;
|
|
28
32
|
|
|
29
33
|
address[] memory pools = IContractsRegisterLegacy(contractsRegister_).getPools();
|
|
@@ -38,7 +42,7 @@ contract MarketConfigurator {
|
|
|
38
42
|
|
|
39
43
|
address priceOracle = _priceOracle(creditManagers[0]);
|
|
40
44
|
// NOTE: v3.0.x contracts don't have loss policies set so we don't bother with them here
|
|
41
|
-
address lossPolicy = address(
|
|
45
|
+
address lossPolicy = address(new LossPolicy());
|
|
42
46
|
|
|
43
47
|
ContractsRegister(contractsRegister).registerMarket(pool, priceOracle, lossPolicy);
|
|
44
48
|
for (uint256 j; j < numCreditManagers; ++j) {
|
|
@@ -58,8 +62,4 @@ contract MarketConfigurator {
|
|
|
58
62
|
function _priceOracle(address creditManager) internal view returns (address) {
|
|
59
63
|
return ICreditManagerV3(creditManager).priceOracle();
|
|
60
64
|
}
|
|
61
|
-
|
|
62
|
-
function _lossLiquidator(address creditManager) internal view returns (address) {
|
|
63
|
-
return ICreditFacadeV3(ICreditManagerV3(creditManager).creditFacade()).lossLiquidator();
|
|
64
|
-
}
|
|
65
65
|
}
|
package/package.json
CHANGED