-
Notifications
You must be signed in to change notification settings - Fork 355
/
Copy pathM2_Deploy_From_Scratch.s.sol
480 lines (405 loc) · 25.6 KB
/
M2_Deploy_From_Scratch.s.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;
import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol";
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import "../../src/contracts/interfaces/IETHPOSDeposit.sol";
import "../../src/contracts/interfaces/IBeaconChainOracle.sol";
import "../../src/contracts/core/StrategyManager.sol";
import "../../src/contracts/core/Slasher.sol";
import "../../src/contracts/core/DelegationManager.sol";
import "../../src/contracts/strategies/StrategyBaseTVLLimits.sol";
import "../../src/contracts/pods/EigenPod.sol";
import "../../src/contracts/pods/EigenPodManager.sol";
import "../../src/contracts/pods/DelayedWithdrawalRouter.sol";
import "../../src/contracts/permissions/PauserRegistry.sol";
import "../../src/contracts/middleware/BLSPublicKeyCompendium.sol";
import "../../src/test/mocks/EmptyContract.sol";
import "../../src/test/mocks/ETHDepositMock.sol";
import "forge-std/Script.sol";
import "forge-std/Test.sol";
// # To load the variables in the .env file
// source .env
// # To deploy and verify our contract
// forge script script/M1_Deploy.s.sol:Deployer_M1 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv
contract Deployer_M1 is Script, Test {
Vm cheats = Vm(HEVM_ADDRESS);
// struct used to encode token info in config file
struct StrategyConfig {
uint256 maxDeposits;
uint256 maxPerDeposit;
address tokenAddress;
string tokenSymbol;
}
string public deployConfigPath = string(bytes("script/testing/M2_deploy_from_scratch.config.json"));
// EigenLayer Contracts
ProxyAdmin public eigenLayerProxyAdmin;
PauserRegistry public eigenLayerPauserReg;
Slasher public slasher;
Slasher public slasherImplementation;
DelegationManager public delegation;
DelegationManager public delegationImplementation;
StrategyManager public strategyManager;
StrategyManager public strategyManagerImplementation;
EigenPodManager public eigenPodManager;
EigenPodManager public eigenPodManagerImplementation;
DelayedWithdrawalRouter public delayedWithdrawalRouter;
DelayedWithdrawalRouter public delayedWithdrawalRouterImplementation;
UpgradeableBeacon public eigenPodBeacon;
EigenPod public eigenPodImplementation;
StrategyBase public baseStrategyImplementation;
BLSPublicKeyCompendium public blsPublicKeyCompendium;
EmptyContract public emptyContract;
address executorMultisig;
address operationsMultisig;
address pauserMultisig;
// the ETH2 deposit contract -- if not on mainnet, we deploy a mock as stand-in
IETHPOSDeposit public ethPOSDeposit;
// strategies deployed
StrategyBaseTVLLimits[] public deployedStrategyArray;
// IMMUTABLES TO SET
uint64 MAX_VALIDATOR_BALANCE_GWEI;
uint64 RESTAKED_BALANCE_OFFSET_GWEI;
// OTHER DEPLOYMENT PARAMETERS
uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS;
uint256 SLASHER_INIT_PAUSED_STATUS;
uint256 DELEGATION_INIT_PAUSED_STATUS;
uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS;
uint256 EIGENPOD_MANAGER_MAX_PODS;
uint256 DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS;
// one week in blocks -- 50400
uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS;
uint32 DELAYED_WITHDRAWAL_ROUTER_INIT_WITHDRAWAL_DELAY_BLOCKS;
function run() external {
// read and log the chainID
uint256 chainId = block.chainid;
emit log_named_uint("You are deploying on ChainID", chainId);
// READ JSON CONFIG DATA
string memory config_data = vm.readFile(deployConfigPath);
// bytes memory parsedData = vm.parseJson(config_data);
STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".strategyManager.init_paused_status");
SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status");
DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status");
EIGENPOD_MANAGER_MAX_PODS = stdJson.readUint(config_data, ".eigenPodManager.max_pods");
EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status");
DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delayedWithdrawalRouter.init_paused_status");
STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32(stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks"));
DELAYED_WITHDRAWAL_ROUTER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32(stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks"));
MAX_VALIDATOR_BALANCE_GWEI = uint64(stdJson.readUint(config_data, ".eigenPod.MAX_VALIDATOR_BALANCE_GWEI"));
RESTAKED_BALANCE_OFFSET_GWEI = uint64(stdJson.readUint(config_data, ".eigenPod.RESTAKED_BALANCE_OFFSET_GWEI"));
// tokens to deploy strategies for
StrategyConfig[] memory strategyConfigs;
executorMultisig = stdJson.readAddress(config_data, ".multisig_addresses.executorMultisig");
operationsMultisig = stdJson.readAddress(config_data, ".multisig_addresses.operationsMultisig");
pauserMultisig = stdJson.readAddress(config_data, ".multisig_addresses.pauserMultisig");
// load token list
bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategies");
strategyConfigs = abi.decode(strategyConfigsRaw, (StrategyConfig[]));
require(executorMultisig != address(0), "executorMultisig address not configured correctly!");
require(operationsMultisig != address(0), "operationsMultisig address not configured correctly!");
// START RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.startBroadcast();
// deploy proxy admin for ability to upgrade proxy contracts
eigenLayerProxyAdmin = new ProxyAdmin();
//deploy pauser registry
{
address[] memory pausers = new address[](3);
pausers[0] = executorMultisig;
pausers[1] = operationsMultisig;
pausers[2] = pauserMultisig;
eigenLayerPauserReg = new PauserRegistry(pausers, executorMultisig);
}
/**
* First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are
* not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code.
*/
emptyContract = new EmptyContract();
delegation = DelegationManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
strategyManager = StrategyManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
slasher = Slasher(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
eigenPodManager = EigenPodManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
delayedWithdrawalRouter = DelayedWithdrawalRouter(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
// if on mainnet, use the ETH2 deposit contract address
if (chainId == 1) {
ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa);
// if not on mainnet, deploy a mock
} else {
ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress"));
}
eigenPodImplementation = new EigenPod(
ethPOSDeposit,
delayedWithdrawalRouter,
eigenPodManager,
MAX_VALIDATOR_BALANCE_GWEI,
RESTAKED_BALANCE_OFFSET_GWEI
);
eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation));
// Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs
delegationImplementation = new DelegationManager(strategyManager, slasher);
strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher);
slasherImplementation = new Slasher(strategyManager, delegation);
eigenPodManagerImplementation = new EigenPodManager(ethPOSDeposit, eigenPodBeacon, strategyManager, slasher);
delayedWithdrawalRouterImplementation = new DelayedWithdrawalRouter(eigenPodManager);
// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
eigenLayerProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(delegation))),
address(delegationImplementation),
abi.encodeWithSelector(
DelegationManager.initialize.selector,
executorMultisig,
eigenLayerPauserReg,
DELEGATION_INIT_PAUSED_STATUS
)
);
eigenLayerProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(strategyManager))),
address(strategyManagerImplementation),
abi.encodeWithSelector(
StrategyManager.initialize.selector,
executorMultisig,
operationsMultisig,
eigenLayerPauserReg,
STRATEGY_MANAGER_INIT_PAUSED_STATUS,
STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS
)
);
eigenLayerProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(slasher))),
address(slasherImplementation),
abi.encodeWithSelector(
Slasher.initialize.selector,
executorMultisig,
eigenLayerPauserReg,
SLASHER_INIT_PAUSED_STATUS
)
);
eigenLayerProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(eigenPodManager))),
address(eigenPodManagerImplementation),
abi.encodeWithSelector(
EigenPodManager.initialize.selector,
EIGENPOD_MANAGER_MAX_PODS,
IBeaconChainOracle(address(0)),
executorMultisig,
eigenLayerPauserReg,
EIGENPOD_MANAGER_INIT_PAUSED_STATUS
)
);
eigenLayerProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter))),
address(delayedWithdrawalRouterImplementation),
abi.encodeWithSelector(DelayedWithdrawalRouter.initialize.selector,
executorMultisig,
eigenLayerPauserReg,
DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS,
DELAYED_WITHDRAWAL_ROUTER_INIT_WITHDRAWAL_DELAY_BLOCKS)
);
// deploy StrategyBaseTVLLimits contract implementation
baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager);
// create upgradeable proxies that each point to the implementation and initialize them
for (uint256 i = 0; i < strategyConfigs.length; ++i) {
deployedStrategyArray.push(
StrategyBaseTVLLimits(address(
new TransparentUpgradeableProxy(
address(baseStrategyImplementation),
address(eigenLayerProxyAdmin),
abi.encodeWithSelector(StrategyBaseTVLLimits.initialize.selector, strategyConfigs[i].maxPerDeposit, strategyConfigs[i].maxDeposits, IERC20(strategyConfigs[i].tokenAddress), eigenLayerPauserReg)
)
))
);
}
blsPublicKeyCompendium = new BLSPublicKeyCompendium();
eigenLayerProxyAdmin.transferOwnership(executorMultisig);
eigenPodBeacon.transferOwnership(executorMultisig);
// STOP RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.stopBroadcast();
// CHECK CORRECTNESS OF DEPLOYMENT
_verifyContractsPointAtOneAnother(
delegationImplementation,
strategyManagerImplementation,
slasherImplementation,
eigenPodManagerImplementation,
delayedWithdrawalRouterImplementation
);
_verifyContractsPointAtOneAnother(
delegation,
strategyManager,
slasher,
eigenPodManager,
delayedWithdrawalRouter
);
_verifyImplementationsSetCorrectly();
_verifyInitialOwners();
_checkPauserInitializations();
_verifyInitializationParams();
// WRITE JSON DATA
string memory parent_object = "parent object";
string memory deployed_strategies = "strategies";
for (uint256 i = 0; i < strategyConfigs.length; ++i) {
vm.serializeAddress(deployed_strategies, strategyConfigs[i].tokenSymbol, address(deployedStrategyArray[i]));
}
string memory deployed_strategies_output = vm.serializeAddress(
deployed_strategies, strategyConfigs[strategyConfigs.length - 1].tokenSymbol,
address(deployedStrategyArray[strategyConfigs.length - 1])
);
string memory deployed_addresses = "addresses";
vm.serializeAddress(deployed_addresses, "eigenLayerProxyAdmin", address(eigenLayerProxyAdmin));
vm.serializeAddress(deployed_addresses, "eigenLayerPauserReg", address(eigenLayerPauserReg));
vm.serializeAddress(deployed_addresses, "slasher", address(slasher));
vm.serializeAddress(deployed_addresses, "slasherImplementation", address(slasherImplementation));
vm.serializeAddress(deployed_addresses, "delegation", address(delegation));
vm.serializeAddress(deployed_addresses, "delegationImplementation", address(delegationImplementation));
vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager));
vm.serializeAddress(deployed_addresses, "strategyManagerImplementation", address(strategyManagerImplementation));
vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager));
vm.serializeAddress(deployed_addresses, "eigenPodManagerImplementation", address(eigenPodManagerImplementation));
vm.serializeAddress(deployed_addresses, "delayedWithdrawalRouter", address(delayedWithdrawalRouter));
vm.serializeAddress(deployed_addresses, "delayedWithdrawalRouterImplementation", address(delayedWithdrawalRouterImplementation));
vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon));
vm.serializeAddress(deployed_addresses, "eigenPodImplementation", address(eigenPodImplementation));
vm.serializeAddress(deployed_addresses, "baseStrategyImplementation", address(baseStrategyImplementation));
vm.serializeAddress(deployed_addresses, "blsPublicKeyCompendium", address(blsPublicKeyCompendium));
vm.serializeAddress(deployed_addresses, "emptyContract", address(emptyContract));
string memory deployed_addresses_output = vm.serializeString(deployed_addresses, "strategies", deployed_strategies_output);
string memory parameters = "parameters";
vm.serializeAddress(parameters, "executorMultisig", executorMultisig);
string memory parameters_output = vm.serializeAddress(parameters, "operationsMultisig", operationsMultisig);
string memory chain_info = "chainInfo";
vm.serializeUint(chain_info, "deploymentBlock", block.number);
string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId);
// serialize all the data
vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output);
vm.serializeString(parent_object, chain_info, chain_info_output);
string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output);
vm.writeJson(finalJson, "script/output/M2_from_scratch_deployment_data.json");
}
function _verifyContractsPointAtOneAnother(
DelegationManager delegationContract,
StrategyManager strategyManagerContract,
Slasher slasherContract,
EigenPodManager eigenPodManagerContract,
DelayedWithdrawalRouter delayedWithdrawalRouterContract
) internal view {
require(delegationContract.slasher() == slasher, "delegation: slasher address not set correctly");
require(delegationContract.strategyManager() == strategyManager, "delegation: strategyManager address not set correctly");
require(strategyManagerContract.slasher() == slasher, "strategyManager: slasher address not set correctly");
require(strategyManagerContract.delegation() == delegation, "strategyManager: delegation address not set correctly");
require(strategyManagerContract.eigenPodManager() == eigenPodManager, "strategyManager: eigenPodManager address not set correctly");
require(slasherContract.strategyManager() == strategyManager, "slasher: strategyManager not set correctly");
require(slasherContract.delegation() == delegation, "slasher: delegation not set correctly");
require(eigenPodManagerContract.ethPOS() == ethPOSDeposit, " eigenPodManager: ethPOSDeposit contract address not set correctly");
require(eigenPodManagerContract.eigenPodBeacon() == eigenPodBeacon, "eigenPodManager: eigenPodBeacon contract address not set correctly");
require(eigenPodManagerContract.strategyManager() == strategyManager, "eigenPodManager: strategyManager contract address not set correctly");
require(eigenPodManagerContract.slasher() == slasher, "eigenPodManager: slasher contract address not set correctly");
require(delayedWithdrawalRouterContract.eigenPodManager() == eigenPodManager,
"delayedWithdrawalRouterContract: eigenPodManager address not set correctly");
}
function _verifyImplementationsSetCorrectly() internal view {
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(delegation)))) == address(delegationImplementation),
"delegation: implementation set incorrectly");
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(strategyManager)))) == address(strategyManagerImplementation),
"strategyManager: implementation set incorrectly");
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(slasher)))) == address(slasherImplementation),
"slasher: implementation set incorrectly");
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(eigenPodManager)))) == address(eigenPodManagerImplementation),
"eigenPodManager: implementation set incorrectly");
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter)))) == address(delayedWithdrawalRouterImplementation),
"delayedWithdrawalRouter: implementation set incorrectly");
for (uint256 i = 0; i < deployedStrategyArray.length; ++i) {
require(eigenLayerProxyAdmin.getProxyImplementation(
TransparentUpgradeableProxy(payable(address(deployedStrategyArray[i])))) == address(baseStrategyImplementation),
"strategy: implementation set incorrectly");
}
require(eigenPodBeacon.implementation() == address(eigenPodImplementation),
"eigenPodBeacon: implementation set incorrectly");
}
function _verifyInitialOwners() internal view {
require(strategyManager.owner() == executorMultisig, "strategyManager: owner not set correctly");
require(delegation.owner() == executorMultisig, "delegation: owner not set correctly");
require(slasher.owner() == executorMultisig, "slasher: owner not set correctly");
require(eigenPodManager.owner() == executorMultisig, "delegation: owner not set correctly");
require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly");
require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly");
require(delayedWithdrawalRouter.owner() == executorMultisig, "delayedWithdrawalRouter: owner not set correctly");
}
function _checkPauserInitializations() internal view {
require(delegation.pauserRegistry() == eigenLayerPauserReg, "delegation: pauser registry not set correctly");
require(strategyManager.pauserRegistry() == eigenLayerPauserReg, "strategyManager: pauser registry not set correctly");
require(slasher.pauserRegistry() == eigenLayerPauserReg, "slasher: pauser registry not set correctly");
require(eigenPodManager.pauserRegistry() == eigenLayerPauserReg, "eigenPodManager: pauser registry not set correctly");
require(delayedWithdrawalRouter.pauserRegistry() == eigenLayerPauserReg, "delayedWithdrawalRouter: pauser registry not set correctly");
require(eigenLayerPauserReg.isPauser(operationsMultisig), "pauserRegistry: operationsMultisig is not pauser");
require(eigenLayerPauserReg.isPauser(executorMultisig), "pauserRegistry: executorMultisig is not pauser");
require(eigenLayerPauserReg.isPauser(pauserMultisig), "pauserRegistry: pauserMultisig is not pauser");
require(eigenLayerPauserReg.unpauser() == executorMultisig, "pauserRegistry: unpauser not set correctly");
for (uint256 i = 0; i < deployedStrategyArray.length; ++i) {
require(deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, "StrategyBaseTVLLimits: pauser registry not set correctly");
require(deployedStrategyArray[i].paused() == 0, "StrategyBaseTVLLimits: init paused status set incorrectly");
}
// // pause *nothing*
// uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS = 0;
// // pause *everything*
// uint256 SLASHER_INIT_PAUSED_STATUS = type(uint256).max;
// // pause *everything*
// uint256 DELEGATION_INIT_PAUSED_STATUS = type(uint256).max;
// // pause *all of the proof-related functionality* (everything that can be paused other than creation of EigenPods)
// uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS = (2**1) + (2**2) + (2**3) + (2**4); /* = 30 */
// // pause *nothing*
// uint256 DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS = 0;
// require(strategyManager.paused() == 0, "strategyManager: init paused status set incorrectly");
// require(slasher.paused() == type(uint256).max, "slasher: init paused status set incorrectly");
// require(delegation.paused() == type(uint256).max, "delegation: init paused status set incorrectly");
// require(eigenPodManager.paused() == 30, "eigenPodManager: init paused status set incorrectly");
// require(delayedWithdrawalRouter.paused() == 0, "delayedWithdrawalRouter: init paused status set incorrectly");
}
function _verifyInitializationParams() internal {
// // one week in blocks -- 50400
// uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds;
// uint32 DELAYED_WITHDRAWAL_ROUTER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds;
// require(strategyManager.withdrawalDelayBlocks() == 7 days / 12 seconds,
// "strategyManager: withdrawalDelayBlocks initialized incorrectly");
// require(delayedWithdrawalRouter.withdrawalDelayBlocks() == 7 days / 12 seconds,
// "delayedWithdrawalRouter: withdrawalDelayBlocks initialized incorrectly");
// uint256 MAX_VALIDATOR_BALANCE_GWEI = 31 ether;
require(eigenPodImplementation.MAX_VALIDATOR_BALANCE_GWEI() == 31 gwei,
"eigenPod: MAX_VALIDATOR_BALANCE_GWEI initialized incorrectly");
require(strategyManager.strategyWhitelister() == operationsMultisig,
"strategyManager: strategyWhitelister address not set correctly");
require(eigenPodManager.beaconChainOracle() == IBeaconChainOracle(address(0)),
"eigenPodManager: eigenPodBeacon contract address not set correctly");
require(delayedWithdrawalRouter.eigenPodManager() == eigenPodManager,
"delayedWithdrawalRouter: eigenPodManager set incorrectly");
require(baseStrategyImplementation.strategyManager() == strategyManager,
"baseStrategyImplementation: strategyManager set incorrectly");
require(eigenPodImplementation.ethPOS() == ethPOSDeposit,
"eigenPodImplementation: ethPOSDeposit contract address not set correctly");
require(eigenPodImplementation.eigenPodManager() == eigenPodManager,
" eigenPodImplementation: eigenPodManager contract address not set correctly");
require(eigenPodImplementation.delayedWithdrawalRouter() == delayedWithdrawalRouter,
" eigenPodImplementation: delayedWithdrawalRouter contract address not set correctly");
string memory config_data = vm.readFile(deployConfigPath);
for (uint i = 0; i < deployedStrategyArray.length; i++) {
uint256 maxPerDeposit = stdJson.readUint(config_data, string.concat(".strategies[", vm.toString(i), "].max_per_deposit"));
uint256 maxDeposits = stdJson.readUint(config_data, string.concat(".strategies[", vm.toString(i), "].max_deposits"));
(uint256 setMaxPerDeposit, uint256 setMaxDeposits) = deployedStrategyArray[i].getTVLLimits();
require(setMaxPerDeposit == maxPerDeposit, "setMaxPerDeposit not set correctly");
require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly");
}
}
}