Skip to content

Commit 5ce3165

Browse files
authored
Merge branch 'next' into market-generation
2 parents 9dd74ec + 683377c commit 5ce3165

File tree

1 file changed

+0
-177
lines changed

1 file changed

+0
-177
lines changed

script/Migrate.sol

Lines changed: 0 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,179 +1,2 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.17;
3-
4-
// import "forge-std/Script.sol";
5-
// import {IAddressProviderV3_1} from "../contracts/interfaces/IAddressProviderV3_1.sol";
6-
// import {AddressProviderV3_1} from "../contracts/global/AddressProviderV3.sol";
7-
8-
// import {
9-
// AP_ADDRESS_PROVIDER,
10-
// AP_ACL,
11-
// AP_WETH_TOKEN,
12-
// AP_GEAR_STAKING,
13-
// AP_ACCOUNT_FACTORY,
14-
// AP_POOL,
15-
// AP_POOL_QUOTA_KEEPER,
16-
// AP_POOL_RATE_KEEPER,
17-
// AP_PRICE_ORACLE,
18-
// AP_CREDIT_MANAGER,
19-
// AP_CREDIT_FACADE,
20-
// AP_CREDIT_CONFIGURATOR,
21-
// AP_MARKET_CONFIGURATOR_FACTORY,
22-
// AP_INTEREST_MODEL_FACTORY,
23-
// AP_ADAPTER_FACTORY,
24-
// AP_GEAR_TOKEN,
25-
// AP_BOT_LIST,
26-
// AP_GEAR_STAKING,
27-
// AP_DEGEN_NFT,
28-
// AP_ACCOUNT_FACTORY,
29-
// AP_ROUTER,
30-
// AP_INFLATION_ATTACK_BLOCKER,
31-
// AP_ZERO_PRICE_FEED,
32-
// AP_DEGEN_DISTRIBUTOR,
33-
// AP_MULTI_PAUSE,
34-
// AP_ZAPPER_REGISTER,
35-
// AP_BYTECODE_REPOSITORY,
36-
// NO_VERSION_CONTROL
37-
// } from "../contracts/libraries/ContractLiterals.sol";
38-
// import {IACL} from "../contracts/interfaces/IACL.sol";
39-
// import {MarketConfiguratorLegacy} from "../contracts/market/MarketConfiguratorLegacy.sol";
40-
// import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
41-
42-
// import {BytecodeRepository} from "../contracts/global/BytecodeRepository.sol";
43-
// import {InterestModelFactory} from "../contracts/factories/InterestModelFactory.sol";
44-
// import {PoolFactoryV3} from "../contracts/factories/PoolFactoryV3.sol";
45-
// import {CreditFactoryV3} from "../contracts/factories/CreditFactoryV3.sol";
46-
// import {PriceOracleFactoryV3} from "../contracts/factories/PriceOracleFactoryV3.sol";
47-
// import {MarketConfiguratorFactoryV3} from "../contracts/factories/MarketConfiguratorFactoryV3.sol";
48-
// import {AdapterFactoryV3} from "../contracts/factories/AdapterFactoryV3.sol";
49-
// import {LibString} from "@solady/utils/LibString.sol";
50-
51-
// import "forge-std/console.sol";
52-
53-
// struct APMigration {
54-
// bytes32 name;
55-
// uint256 version;
56-
// }
57-
58-
// /// @title Address provider V3 interface
59-
// interface IAddressProviderV3Legacy {
60-
// function getAddressOrRevert(bytes32 key, uint256 _version) external view returns (address result);
61-
// }
62-
63-
// address constant emergencyLiquidator = 0x7BD9c8161836b1F402233E80F55E3CaE0Fde4d87;
64-
// address constant PUBLIC_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
65-
66-
// contract Migrate is Script {
67-
// using LibString for bytes32;
68-
69-
// function run() external virtual {
70-
// uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
71-
// address deployer = vm.addr(deployerPrivateKey);
72-
// address oldAddressProvider = vm.envAddress("ADDRESS_PROVIDER");
73-
// address vetoAdmin = vm.envAddress("VETO_ADMIN");
74-
75-
// vm.startBroadcast(deployerPrivateKey);
76-
77-
// _deployGovernance3_1(oldAddressProvider, vetoAdmin, deployer);
78-
79-
// vm.stopBroadcast();
80-
// }
81-
82-
// function _deployGovernance3_1(address oldAddressProvider, address vetoAdmin, address deployer)
83-
// internal
84-
// returns (address)
85-
// {
86-
// address acl = IAddressProviderV3Legacy(oldAddressProvider).getAddressOrRevert(AP_ACL, NO_VERSION_CONTROL);
87-
// AddressProviderV3_1 _addressProvider = new AddressProviderV3_1();
88-
// console.log("new address provider:", address(_addressProvider));
89-
90-
// _addressProvider.transferOwnership(IACL(acl).owner());
91-
92-
// /// AddressProvider migration
93-
// APMigration[17] memory migrations = [
94-
// APMigration({name: AP_GEAR_TOKEN, version: 0}),
95-
// APMigration({name: AP_WETH_TOKEN, version: 0}),
96-
// APMigration({name: AP_GEAR_TOKEN, version: 0}),
97-
// APMigration({name: AP_BOT_LIST, version: 300}),
98-
// APMigration({name: AP_GEAR_STAKING, version: 300}),
99-
// APMigration({name: AP_DEGEN_NFT, version: 1}),
100-
// APMigration({name: AP_ACCOUNT_FACTORY, version: 0}),
101-
// APMigration({name: AP_INFLATION_ATTACK_BLOCKER, version: 300}),
102-
// APMigration({name: AP_ROUTER, version: 302}),
103-
// APMigration({name: AP_ZERO_PRICE_FEED, version: 0}),
104-
// APMigration({name: AP_ZAPPER_REGISTER, version: 300}),
105-
// APMigration({name: AP_MULTI_PAUSE, version: 0}),
106-
// APMigration({name: AP_DEGEN_DISTRIBUTOR, version: 300}),
107-
// APMigration({name: "PARTIAL_LIQUIDATION_BOT", version: 300}),
108-
// APMigration({name: "DELEVERAGE_BOT_PEGGED", version: 300}),
109-
// APMigration({name: "DELEVERAGE_BOT_LV", version: 300}),
110-
// APMigration({name: "DELEVERAGE_BOT_HV", version: 300})
111-
// ];
112-
113-
// uint256 len = migrations.length;
114-
115-
// for (uint256 i; i < len; i++) {
116-
// string memory key = migrations[i].name.fromSmallString();
117-
118-
// try IAddressProviderV3Legacy(oldAddressProvider).getAddressOrRevert(
119-
// migrations[i].name, migrations[i].version
120-
// ) returns (address oldAddress) {
121-
// console.log("migrating", key, oldAddress);
122-
123-
// _addressProvider.setAddress({
124-
// key: key,
125-
// value: oldAddress,
126-
// saveVersion: migrations[i].version != NO_VERSION_CONTROL
127-
// });
128-
// } catch {
129-
// console.log("Failed to migrate", key);
130-
// }
131-
// }
132-
133-
// /// Deploy new factories
134-
// address repository = address(new BytecodeRepository());
135-
// _addressProvider.setAddress(repository, false);
136-
137-
// address factory = address(new InterestModelFactory());
138-
// _addressProvider.setAddress(factory, true);
139-
140-
// factory = address(new PoolFactoryV3(address(_addressProvider)));
141-
// _addressProvider.setAddress(factory, true);
142-
143-
// factory = address(new CreditFactoryV3(address(_addressProvider)));
144-
// _addressProvider.setAddress(factory, true);
145-
146-
// factory = address(new PriceOracleFactoryV3(address(_addressProvider)));
147-
// _addressProvider.setAddress(factory, true);
148-
149-
// factory = address(new MarketConfiguratorFactoryV3(address(_addressProvider)));
150-
// _addressProvider.setAddress(factory, true);
151-
152-
// factory = address(new AdapterFactoryV3());
153-
// _addressProvider.setAddress(factory, true);
154-
155-
// /// Deploy MarketConfiguratorLegacy
156-
// bytes memory bytecode = type(MarketConfiguratorLegacy).creationCode;
157-
// bytes memory parameters = abi.encode(oldAddressProvider, address(_addressProvider), "ChaosLabs", vetoAdmin);
158-
159-
// bytes memory bytecodeWithParams = abi.encodePacked(bytecode, parameters);
160-
// address mcl = Create2.computeAddress(0, keccak256(bytecodeWithParams), PUBLIC_FACTORY);
161-
162-
// console.log("MarketConfiguratorLegacy:", mcl);
163-
164-
// /// set this contract to add mcl as marketConfigurator
165-
// _addressProvider.setAddress(AP_MARKET_CONFIGURATOR_FACTORY.fromSmallString(), deployer, false);
166-
167-
// /// Register this marketConfigurator in AddressProvider
168-
// _addressProvider.addMarketConfigurator(address(mcl));
169-
170-
// /// Deploy MarketConfiguratorLegacy
171-
// address pp = Create2.deploy(0, 0, bytecodeWithParams);
172-
// console.log("MarketConfiguratorLegacy deployed at:", pp);
173-
174-
// factory = address(new MarketConfiguratorFactoryV3(address(_addressProvider)));
175-
// _addressProvider.setAddress(factory, false);
176-
177-
// return address(_addressProvider);
178-
// }
179-
// }

0 commit comments

Comments
 (0)