1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity = 0.8.12 ;
3
+
4
+ import "../../src/contracts/interfaces/IETHPOSDeposit.sol " ;
5
+
6
+ import "../../src/contracts/core/StrategyManager.sol " ;
7
+ import "../../src/contracts/core/Slasher.sol " ;
8
+ import "../../src/contracts/core/DelegationManager.sol " ;
9
+ import "../../src/contracts/core/AVSDirectory.sol " ;
10
+
11
+ import "../../src/contracts/pods/EigenPod.sol " ;
12
+ import "../../src/contracts/pods/EigenPodManager.sol " ;
13
+ import "../../src/contracts/pods/DelayedWithdrawalRouter.sol " ;
14
+
15
+ import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol " ;
16
+ import "../../src/test/mocks/EmptyContract.sol " ;
17
+ import "forge-std/Script.sol " ;
18
+ import "forge-std/Test.sol " ;
19
+
20
+ // # To load the variables in the .env file
21
+ // source .env
22
+
23
+ // # To deploy and verify our contract
24
+ // forge script script/upgrade/GoerliUpgrade2.s.sol:GoerliUpgrade2 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv
25
+
26
+ // NOTE: ONLY WORKS ON GOERLI
27
+ // CommitHash: 7257364d03d255ea8c855f36317ce0e892b78497
28
+ contract GoerliUpgrade2 is Script , Test {
29
+ Vm cheats = Vm (HEVM_ADDRESS);
30
+
31
+ string public deploymentOutputPath = string (bytes ("script/output/M2_preprod_deployment_from_scratch.json " ));
32
+
33
+ IDelayedWithdrawalRouter delayedWithdrawalRouter;
34
+ IDelegationManager delegation;
35
+ IEigenPodManager eigenPodManager;
36
+ IStrategyManager strategyManager;
37
+ ISlasher slasher;
38
+ IBeacon eigenPodBeacon;
39
+ EmptyContract emptyContract;
40
+ ProxyAdmin eigenLayerProxyAdmin;
41
+
42
+ function run () external {
43
+ // read and log the chainID
44
+ uint256 chainId = block .chainid ;
45
+ emit log_named_uint ("You are deploying on ChainID " , chainId);
46
+
47
+ string memory config_data = vm.readFile (deploymentOutputPath);
48
+
49
+ delayedWithdrawalRouter = IDelayedWithdrawalRouter (stdJson.readAddress (config_data, ".addresses.delayedWithdrawalRouter " ));
50
+ delegation = IDelegationManager (stdJson.readAddress (config_data, ".addresses.delegation " ));
51
+ eigenPodManager = IEigenPodManager (stdJson.readAddress (config_data, ".addresses.eigenPodManager " ));
52
+ strategyManager = IStrategyManager (stdJson.readAddress (config_data, ".addresses.strategyManager " ));
53
+ slasher = ISlasher (stdJson.readAddress (config_data, ".addresses.slasher " ));
54
+ eigenPodBeacon = IBeacon (stdJson.readAddress (config_data, ".addresses.eigenPodBeacon " ));
55
+ emptyContract = EmptyContract (stdJson.readAddress (config_data, ".addresses.emptyContract " ));
56
+ eigenLayerProxyAdmin = ProxyAdmin (stdJson.readAddress (config_data, ".addresses.eigenLayerProxyAdmin " ));
57
+
58
+ vm.startBroadcast ();
59
+
60
+ address delegationImplementation = address (
61
+ new DelegationManager (
62
+ strategyManager,
63
+ slasher,
64
+ eigenPodManager
65
+ )
66
+ );
67
+
68
+ address slasherImplementation = address (
69
+ new Slasher (
70
+ strategyManager,
71
+ delegation
72
+ )
73
+ );
74
+
75
+ address strategyManagerImplementation = address (
76
+ new StrategyManager (
77
+ delegation,
78
+ eigenPodManager,
79
+ slasher
80
+ )
81
+ );
82
+
83
+ address delayedWithdrawalRouterImplementation = address (
84
+ new DelayedWithdrawalRouter (
85
+ eigenPodManager
86
+ )
87
+ );
88
+
89
+ address eigenPodImplementation = address (
90
+ new EigenPod (
91
+ IETHPOSDeposit (0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b ),
92
+ delayedWithdrawalRouter,
93
+ eigenPodManager,
94
+ 32e9 ,
95
+ 1616508000
96
+ )
97
+ );
98
+
99
+ address eigenPodManagerImplementation = address (
100
+ new EigenPodManager (
101
+ IETHPOSDeposit (0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b ),
102
+ eigenPodBeacon,
103
+ strategyManager,
104
+ slasher,
105
+ delegation
106
+ )
107
+ );
108
+
109
+ vm.stopBroadcast ();
110
+
111
+ emit log_named_address ("DelegationImplementation " , delegationImplementation);
112
+ emit log_named_address ("SlasherImplementation " , slasherImplementation);
113
+ emit log_named_address ("StrategyManagerImplementation " , strategyManagerImplementation);
114
+ emit log_named_address ("DelayedWithdrawalRouterImplementation " , delayedWithdrawalRouterImplementation);
115
+ emit log_named_address ("EigenPodImplementation " , eigenPodImplementation);
116
+ emit log_named_address ("EigenPodManagerImplementation " , eigenPodManagerImplementation);
117
+
118
+ /*
119
+ == Logs ==
120
+ You are deploying on ChainID: 5
121
+ DelegationImplementation: 0x934eB3E2b6D5C2E1601B29B7180026D71438F20D
122
+ SlasherImplementation: 0x05c235183e8b9dFb7113Cf92bbDc3f5085324158
123
+ StrategyManagerImplementation: 0xb9B69504f1a727E783F4B4248A115D56F4080DF8
124
+ DelayedWithdrawalRouterImplementation: 0x44a40C60857b4B420Ad3D8b9646FefEBF2D0dB86
125
+ EigenPodImplementation: 0x83cbB48391F428878Bc5DD97C9792a8dbCAa0729
126
+ EigenPodManagerImplementation: 0xEEdCC9dB001fB8429721FE21426F51f0Cdd329EC
127
+ */
128
+ }
129
+ }
0 commit comments