@@ -63,6 +63,11 @@ library CoreDeploymentLib {
6363 address initialOwner;
6464 }
6565
66+ struct AVSDirectoryConfig {
67+ uint256 initPausedStatus;
68+ address initialOwner;
69+ }
70+
6671 struct RewardsCoordinatorConfig {
6772 uint256 initPausedStatus;
6873 address initialOwner;
@@ -76,13 +81,24 @@ library CoreDeploymentLib {
7681 uint32 genesisRewardsTimestamp;
7782 }
7883
84+ struct ETHPOSDepositConfig {
85+ address ethPOSDepositAddress;
86+ }
87+
88+ struct EigenPodConfig {
89+ uint64 genesisTimestamp;
90+ }
91+
7992 struct DeploymentConfigData {
8093 StrategyManagerConfig strategyManager;
8194 DelegationManagerConfig delegationManager;
8295 EigenPodManagerConfig eigenPodManager;
8396 AllocationManagerConfig allocationManager;
8497 StrategyFactoryConfig strategyFactory;
8598 RewardsCoordinatorConfig rewardsCoordinator;
99+ AVSDirectoryConfig avsDirectory;
100+ ETHPOSDepositConfig ethPOSDeposit;
101+ EigenPodConfig eigenPod;
86102 }
87103
88104 struct DeploymentData {
@@ -102,9 +118,7 @@ library CoreDeploymentLib {
102118 function deployContracts (
103119 address proxyAdmin ,
104120 DeploymentConfigData memory configData
105- ) internal returns (DeploymentData memory ) {
106- DeploymentData memory result;
107-
121+ ) internal returns (DeploymentData memory result ) {
108122 // Deploy proxy contracts
109123 result.delegationManager = UpgradeableProxyLib.setUpEmptyProxy (proxyAdmin);
110124 result.avsDirectory = UpgradeableProxyLib.setUpEmptyProxy (proxyAdmin);
@@ -120,7 +134,6 @@ library CoreDeploymentLib {
120134 // Deploy implementation contracts
121135 address permissionControllerImpl = address (new PermissionController ());
122136
123-
124137 address strategyManagerImpl = address (
125138 new StrategyManager (
126139 IDelegationManager (result.delegationManager),
@@ -156,13 +169,13 @@ library CoreDeploymentLib {
156169 )
157170 );
158171
159- address ethPOSDeposit;
160- if (block . chainid == 1 ) {
161- ethPOSDeposit = 0x00000000219ab540356cBB839Cbe05303d7705Fa ;
162- } else {
163- // For non-mainnet chains, deploy a mock
164- /// TODO: Handle Eth pos deposit contract
165- ethPOSDeposit = address ( 0 );
172+ address ethPOSDeposit = configData.ethPOSDeposit.ethPOSDepositAddress ;
173+ if (ethPOSDeposit == address ( 0 ) ) {
174+ if ( block . chainid == 1 ) {
175+ ethPOSDeposit = 0x00000000219ab540356cBB839Cbe05303d7705Fa ;
176+ } else {
177+ revert ( " DEPLOY_MOCK_ETHPOS_CONTRACT " );
178+ }
166179 }
167180
168181 address eigenPodManagerImpl = address (
@@ -178,7 +191,7 @@ library CoreDeploymentLib {
178191 new EigenPod (
179192 IETHPOSDeposit (ethPOSDeposit),
180193 IEigenPodManager (result.eigenPodManager),
181- uint64 (block .timestamp ) // Use current timestamp as genesis time for testing
194+ configData.eigenPod.genesisTimestamp == 0 ? uint64 (block .timestamp ) : configData.eigenPod.genesisTimestamp // Use configured timestamp or current timestamp as fallback
182195 )
183196 );
184197
@@ -213,11 +226,13 @@ library CoreDeploymentLib {
213226 )
214227 );
215228
216- // Deploy and configure the strategy beacon
217229 result.strategyBeacon = address (new UpgradeableBeacon (baseStrategyImpl));
218230
231+ // Upgrade contracts
232+ UpgradeableProxyLib.upgrade (result.eigenPodBeacon, eigenPodBeaconImpl);
233+
219234 UpgradeableProxyLib.upgrade (result.permissionController, permissionControllerImpl);
220- // Initialize contracts
235+
221236 bytes memory upgradeCall;
222237
223238 upgradeCall = abi.encodeCall (
@@ -229,8 +244,6 @@ library CoreDeploymentLib {
229244 )
230245 );
231246
232- // Upgrade the eigenPodBeacon with the eigenPodBeaconImpl
233- UpgradeableProxyLib.upgrade (result.eigenPodBeacon, eigenPodBeaconImpl);
234247
235248 UpgradeableProxyLib.upgradeAndCall (result.strategyManager, strategyManagerImpl, upgradeCall);
236249
@@ -255,10 +268,11 @@ library CoreDeploymentLib {
255268 upgradeCall = abi.encodeCall (
256269 AVSDirectory.initialize,
257270 (
258- proxyAdmin, // initialOwner
259- 0 // initialPausedStatus
271+ configData.avsDirectory. initialOwner,
272+ configData.avsDirectory.initPausedStatus
260273 )
261274 );
275+
262276 UpgradeableProxyLib.upgradeAndCall (result.avsDirectory, avsDirectoryImpl, upgradeCall);
263277
264278 upgradeCall = abi.encodeCall (
@@ -290,6 +304,7 @@ library CoreDeploymentLib {
290304 configData.rewardsCoordinator.defaultSplitBips
291305 )
292306 );
307+
293308 UpgradeableProxyLib.upgradeAndCall (result.rewardsCoordinator, rewardsCoordinatorImpl, upgradeCall);
294309
295310 return result;
0 commit comments