From ab143773166dedb1ac1ea5ec85bffb7834c74ba7 Mon Sep 17 00:00:00 2001 From: supernovahs Date: Fri, 13 Dec 2024 13:08:29 +0530 Subject: [PATCH] hello world service manager abstract error --- contracts/foundry.toml | 4 +- contracts/script/DeployEigenLayerCore.s.sol | 2 +- contracts/script/utils/CoreDeploymentLib.sol | 391 ++++++++++++------ .../script/utils/UpgradeableProxyLib.sol | 7 +- contracts/src/HelloWorldServiceManager.sol | 12 +- 5 files changed, 273 insertions(+), 143 deletions(-) diff --git a/contracts/foundry.toml b/contracts/foundry.toml index e0da02ff..0ba9448f 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -10,8 +10,8 @@ remappings = [ "@eigenlayer/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/", "@eigenlayer-scripts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/script/", "@eigenlayer-middleware/=lib/eigenlayer-middleware/", - "@openzeppelin/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/", - "@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/", + "@openzeppelin/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/", + "@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/", "forge-std/=lib/forge-std/src/", ] diff --git a/contracts/script/DeployEigenLayerCore.s.sol b/contracts/script/DeployEigenLayerCore.s.sol index 3c60480d..59c6fe99 100644 --- a/contracts/script/DeployEigenLayerCore.s.sol +++ b/contracts/script/DeployEigenLayerCore.s.sol @@ -23,7 +23,7 @@ contract DeployEigenLayerCore is Script { function run() external { vm.startBroadcast(deployer); proxyAdmin = UpgradeableProxyLib.deployProxyAdmin(); - deploymentData = CoreDeploymentLib.deployContracts(proxyAdmin, configData); + deploymentData = CoreDeploymentLib.deployContracts(deployer,proxyAdmin, configData); vm.stopBroadcast(); string memory deploymentPath = "deployments/core/"; CoreDeploymentLib.writeDeploymentJson(deploymentPath, block.chainid, deploymentData); diff --git a/contracts/script/utils/CoreDeploymentLib.sol b/contracts/script/utils/CoreDeploymentLib.sol index d90803cd..684a1cbf 100644 --- a/contracts/script/utils/CoreDeploymentLib.sol +++ b/contracts/script/utils/CoreDeploymentLib.sol @@ -6,6 +6,8 @@ import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; import {console2} from "forge-std/Test.sol"; +import {IPermissionController} from "@eigenlayer/contracts/interfaces/IPermissionController.sol"; +import {PermissionController} from "@eigenlayer/contracts/permissions/PermissionController.sol"; import {Vm} from "forge-std/Vm.sol"; import {stdJson} from "forge-std/StdJson.sol"; import {DelegationManager} from "@eigenlayer/contracts/core/DelegationManager.sol"; @@ -14,6 +16,8 @@ import {AVSDirectory} from "@eigenlayer/contracts/core/AVSDirectory.sol"; import {EigenPodManager} from "@eigenlayer/contracts/pods/EigenPodManager.sol"; import {RewardsCoordinator} from "@eigenlayer/contracts/core/RewardsCoordinator.sol"; import {StrategyBase} from "@eigenlayer/contracts/strategies/StrategyBase.sol"; +import {IAllocationManager} from "@eigenlayer/contracts/interfaces/IAllocationManager.sol"; +import {AllocationManager} from "@eigenlayer/contracts/core/AllocationManager.sol"; import {EigenPod} from "@eigenlayer/contracts/pods/EigenPod.sol"; import {IETHPOSDeposit} from "@eigenlayer/contracts/interfaces/IETHPOSDeposit.sol"; import {StrategyBaseTVLLimits} from "@eigenlayer/contracts/strategies/StrategyBaseTVLLimits.sol"; @@ -37,17 +41,14 @@ library CoreDeploymentLib { using Strings for *; using UpgradeableProxyLib for address; - Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + Vm internal constant vm = + Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); struct StrategyManagerConfig { uint256 initPausedStatus; uint256 initWithdrawalDelayBlocks; } - struct SlasherConfig { - uint256 initPausedStatus; - } - struct DelegationManagerConfig { uint256 initPausedStatus; uint256 withdrawalDelayBlocks; @@ -78,49 +79,91 @@ library CoreDeploymentLib { address avsDirectory; address strategyManager; address eigenPodManager; + address allocationManager; address rewardsCoordinator; address eigenPodBeacon; address pauserRegistry; address strategyFactory; address strategyBeacon; + address permissionController; } function deployContracts( + address deployer, address proxyAdmin, DeploymentConfigData memory configData ) internal returns (DeploymentData memory) { DeploymentData memory result; - result.delegationManager = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); + result.delegationManager = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); result.avsDirectory = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); - result.strategyManager = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); - result.eigenPodManager = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); - result.rewardsCoordinator = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); + result.strategyManager = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); + result.allocationManager = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); + result.avsDirectory = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); + result.rewardsCoordinator = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); result.eigenPodBeacon = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); - result.pauserRegistry = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); - result.strategyFactory = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); + result.pauserRegistry = address( + new PauserRegistry( + new address[](0), // Empty array for pausers + proxyAdmin // ProxyAdmin as the unpauser + ) + ); + result.strategyFactory = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); + result.eigenPodManager = UpgradeableProxyLib.setUpEmptyProxy( + proxyAdmin + ); + result.permissionController = UpgradeableProxyLib.setUpEmptyProxy(proxyAdmin); + // Deploy the implementation contracts, using the proxy contracts as inputs address delegationManagerImpl = address( new DelegationManager( IStrategyManager(result.strategyManager), - ISlasher(address(0)), - IEigenPodManager(result.eigenPodManager) + IEigenPodManager(result.eigenPodManager), + IAllocationManager(result.allocationManager), + IPauserRegistry(result.pauserRegistry), + IPermissionController(result.permissionController), + // IAVSDirectory(result.avsDirectory), + uint32(0) // TODO: check minWithdrawalDelay ) ); - address avsDirectoryImpl = - address(new AVSDirectory(IDelegationManager(result.delegationManager))); + address permissionControllerImpl = address(new PermissionController()); - address strategyManagerImpl = address( - new StrategyManager( + address avsDirectoryImpl = address( + new AVSDirectory( IDelegationManager(result.delegationManager), - IEigenPodManager(result.eigenPodManager), - ISlasher(address(0)) + IPauserRegistry(result.pauserRegistry) // _DEALLOCATION_DELAY: 17.5 days in seconds), ) ); - address strategyFactoryImpl = - address(new StrategyFactory(IStrategyManager(result.strategyManager))); + address strategyManagerImpl = address( + new StrategyManager(IDelegationManager(result.delegationManager),IPauserRegistry(result.pauserRegistry)) + ); + + address strategyFactoryImpl = address( + new StrategyFactory(IStrategyManager(result.strategyManager),IPauserRegistry(result.pauserRegistry)) + ); + + address allocationManagerImpl = address( + new AllocationManager( + IDelegationManager(result.delegationManager), + IPauserRegistry(result.pauserRegistry), + IPermissionController(result.permissionController), + // IAVSDirectory(result.avsDirectory), + uint32(0), // _DEALLOCATION_DELAY + uint32(0) // _ALLOCATION_CONFIGURATION_DELAY + ) + ); address ethPOSDeposit; if (block.chainid == 1) { @@ -135,9 +178,8 @@ library CoreDeploymentLib { new EigenPodManager( IETHPOSDeposit(ethPOSDeposit), IBeacon(result.eigenPodBeacon), - IStrategyManager(result.strategyManager), - ISlasher(address(0)), - IDelegationManager(result.delegationManager) + IDelegationManager(result.delegationManager), + IPauserRegistry(result.pauserRegistry) ) ); @@ -145,12 +187,15 @@ library CoreDeploymentLib { uint32 CALCULATION_INTERVAL_SECONDS = 1 days; uint32 MAX_REWARDS_DURATION = 1 days; uint32 MAX_RETROACTIVE_LENGTH = 1; - uint32 MAX_FUTURE_LENGTH = 1; + uint32 MAX_FUTURE_LENGTH = 1 days; uint32 GENESIS_REWARDS_TIMESTAMP = 10 days; address rewardsCoordinatorImpl = address( new RewardsCoordinator( IDelegationManager(result.delegationManager), IStrategyManager(result.strategyManager), + IAllocationManager(result.allocationManager), + IPauserRegistry(result.pauserRegistry), + IPermissionController(result.permissionController), CALCULATION_INTERVAL_SECONDS, MAX_REWARDS_DURATION, MAX_RETROACTIVE_LENGTH, @@ -159,7 +204,6 @@ library CoreDeploymentLib { ) ); - /// TODO: Get actual genesis time uint64 GENESIS_TIME = 1_564_000; address eigenPodImpl = address( @@ -169,19 +213,19 @@ library CoreDeploymentLib { GENESIS_TIME ) ); - address eigenPodBeaconImpl = address(new UpgradeableBeacon(eigenPodImpl)); - address baseStrategyImpl = - address(new StrategyBase(IStrategyManager(result.strategyManager))); - /// TODO: PauserRegistry isn't upgradeable - address pauserRegistryImpl = address( - new PauserRegistry( - new address[](0), // Empty array for pausers - proxyAdmin // ProxyAdmin as the unpauser - ) + address eigenPodBeaconImpl = address( + new UpgradeableBeacon(eigenPodImpl) + ); + address baseStrategyImpl = address( + new StrategyBase(IStrategyManager(result.strategyManager),IPauserRegistry(result.pauserRegistry)) ); + /// TODO: PauserRegistry isn't upgradeable + // Deploy and configure the strategy beacon - result.strategyBeacon = address(new UpgradeableBeacon(baseStrategyImpl)); + result.strategyBeacon = address( + new UpgradeableBeacon(baseStrategyImpl) + ); // Upgrade contracts /// TODO: Get from config @@ -189,15 +233,14 @@ library CoreDeploymentLib { DelegationManager.initialize, ( proxyAdmin, // initialOwner - IPauserRegistry(result.pauserRegistry), // _pauserRegistry - configData.delegationManager.initPausedStatus, // initialPausedStatus - configData.delegationManager.withdrawalDelayBlocks, // _minWithdrawalDelayBlocks - new IStrategy[](0), // _strategies (empty array for now) - new uint256[](0) // _withdrawalDelayBlocks (empty array for now) + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry + configData.delegationManager.initPausedStatus // initialPausedStatus ) ); UpgradeableProxyLib.upgradeAndCall( - result.delegationManager, delegationManagerImpl, upgradeCall + result.delegationManager, + delegationManagerImpl, + upgradeCall ); // Upgrade StrategyManager contract @@ -206,61 +249,84 @@ library CoreDeploymentLib { ( proxyAdmin, // initialOwner result.strategyFactory, // initialStrategyWhitelister - IPauserRegistry(result.pauserRegistry), // _pauserRegistry + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry configData.strategyManager.initPausedStatus // initialPausedStatus ) ); - UpgradeableProxyLib.upgradeAndCall(result.strategyManager, strategyManagerImpl, upgradeCall); + + UpgradeableProxyLib.upgradeAndCall( + result.strategyManager, + strategyManagerImpl, + upgradeCall + ); + UpgradeableProxyLib.upgrade(result.permissionController, permissionControllerImpl); + // Upgrade StrategyFactory contract upgradeCall = abi.encodeCall( StrategyFactory.initialize, ( proxyAdmin, // initialOwner - IPauserRegistry(result.pauserRegistry), // _pauserRegistry + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry configData.strategyFactory.initPausedStatus, // initialPausedStatus IBeacon(result.strategyBeacon) ) ); - UpgradeableProxyLib.upgradeAndCall(result.strategyFactory, strategyFactoryImpl, upgradeCall); + UpgradeableProxyLib.upgradeAndCall( + result.strategyFactory, + strategyFactoryImpl, + upgradeCall + ); // Upgrade EigenPodManager contract upgradeCall = abi.encodeCall( EigenPodManager.initialize, ( proxyAdmin, // initialOwner - IPauserRegistry(result.pauserRegistry), // _pauserRegistry + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry configData.eigenPodManager.initPausedStatus // initialPausedStatus ) ); - UpgradeableProxyLib.upgradeAndCall(result.eigenPodManager, eigenPodManagerImpl, upgradeCall); + UpgradeableProxyLib.upgradeAndCall( + result.eigenPodManager, + eigenPodManagerImpl, + upgradeCall + ); // Upgrade AVSDirectory contract upgradeCall = abi.encodeCall( AVSDirectory.initialize, ( proxyAdmin, // initialOwner - IPauserRegistry(result.pauserRegistry), // _pauserRegistry + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry 0 // TODO: AVS Missing configinitialPausedStatus ) ); - UpgradeableProxyLib.upgradeAndCall(result.avsDirectory, avsDirectoryImpl, upgradeCall); + UpgradeableProxyLib.upgradeAndCall( + result.avsDirectory, + avsDirectoryImpl, + upgradeCall + ); // Upgrade RewardsCoordinator contract upgradeCall = abi.encodeCall( RewardsCoordinator.initialize, ( - proxyAdmin, // initialOwner - IPauserRegistry(result.pauserRegistry), // _pauserRegistry + deployer, // initialOwner + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry configData.rewardsCoordinator.initPausedStatus, // initialPausedStatus /// TODO: is there a setter and is this expected? - address(0), // rewards updater + deployer, // rewards updater uint32(configData.rewardsCoordinator.activationDelay), // _activationDelay - uint16(configData.rewardsCoordinator.globalOperatorCommissionBips) // _globalCommissionBips + uint16( + configData.rewardsCoordinator.globalOperatorCommissionBips + ) // _globalCommissionBips ) ); UpgradeableProxyLib.upgradeAndCall( - result.rewardsCoordinator, rewardsCoordinatorImpl, upgradeCall + result.rewardsCoordinator, + rewardsCoordinatorImpl, + upgradeCall ); // Upgrade EigenPod contract @@ -269,7 +335,27 @@ library CoreDeploymentLib { // TODO: Double check this (address(result.eigenPodManager)) // _podOwner ); - UpgradeableProxyLib.upgradeAndCall(result.eigenPodBeacon, eigenPodImpl, upgradeCall); + UpgradeableProxyLib.upgradeAndCall( + result.eigenPodBeacon, + eigenPodImpl, + upgradeCall + ); + + // Upgrade AllocationManager contract + upgradeCall = abi.encodeCall( + AllocationManager.initialize, + // TODO: Double check this + ( + deployer, // initialOwner + // IPauserRegistry(result.pauserRegistry), // _pauserRegistry + configData.delegationManager.initPausedStatus // initialPausedStatus + ) + ); + UpgradeableProxyLib.upgradeAndCall( + result.allocationManager, + allocationManagerImpl, + upgradeCall + ); return result; } @@ -277,7 +363,6 @@ library CoreDeploymentLib { struct DeploymentConfigData { StrategyManagerConfig strategyManager; DelegationManagerConfig delegationManager; - SlasherConfig slasher; EigenPodManagerConfig eigenPodManager; RewardsCoordinatorConfig rewardsCoordinator; StrategyFactoryConfig strategyFactory; @@ -297,45 +382,57 @@ library CoreDeploymentLib { DeploymentConfigData memory data; // StrategyManager start - data.strategyManager.initPausedStatus = json.readUint(".strategyManager.init_paused_status"); - data.strategyManager.initWithdrawalDelayBlocks = - uint32(json.readUint(".strategyManager.init_withdrawal_delay_blocks")); - // slasher config end + data.strategyManager.initPausedStatus = json.readUint( + ".strategyManager.init_paused_status" + ); + data.strategyManager.initWithdrawalDelayBlocks = uint32( + json.readUint(".strategyManager.init_withdrawal_delay_blocks") + ); + // StrategyManager config end // DelegationManager config start - data.delegationManager.initPausedStatus = json.readUint(".delegation.init_paused_status"); - data.delegationManager.withdrawalDelayBlocks = - json.readUint(".delegation.init_withdrawal_delay_blocks"); + data.delegationManager.initPausedStatus = json.readUint( + ".delegation.init_paused_status" + ); + data.delegationManager.withdrawalDelayBlocks = json.readUint( + ".delegation.init_withdrawal_delay_blocks" + ); // DelegationManager config end - // Slasher config start - data.slasher.initPausedStatus = json.readUint(".slasher.init_paused_status"); - - // Slasher config end - // EigenPodManager config start - data.eigenPodManager.initPausedStatus = json.readUint(".eigenPodManager.init_paused_status"); + data.eigenPodManager.initPausedStatus = json.readUint( + ".eigenPodManager.init_paused_status" + ); // EigenPodManager config end // RewardsCoordinator config start - data.rewardsCoordinator.initPausedStatus = - json.readUint(".rewardsCoordinator.init_paused_status"); - data.rewardsCoordinator.maxRewardsDuration = - json.readUint(".rewardsCoordinator.MAX_REWARDS_DURATION"); - data.rewardsCoordinator.maxRetroactiveLength = - json.readUint(".rewardsCoordinator.MAX_RETROACTIVE_LENGTH"); - data.rewardsCoordinator.maxFutureLength = - json.readUint(".rewardsCoordinator.MAX_FUTURE_LENGTH"); - data.rewardsCoordinator.genesisRewardsTimestamp = - json.readUint(".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP"); - data.rewardsCoordinator.updater = - json.readAddress(".rewardsCoordinator.rewards_updater_address"); - data.rewardsCoordinator.activationDelay = - json.readUint(".rewardsCoordinator.activation_delay"); - data.rewardsCoordinator.calculationIntervalSeconds = - json.readUint(".rewardsCoordinator.calculation_interval_seconds"); - data.rewardsCoordinator.globalOperatorCommissionBips = - json.readUint(".rewardsCoordinator.global_operator_commission_bips"); + data.rewardsCoordinator.initPausedStatus = json.readUint( + ".rewardsCoordinator.init_paused_status" + ); + data.rewardsCoordinator.maxRewardsDuration = json.readUint( + ".rewardsCoordinator.MAX_REWARDS_DURATION" + ); + data.rewardsCoordinator.maxRetroactiveLength = json.readUint( + ".rewardsCoordinator.MAX_RETROACTIVE_LENGTH" + ); + data.rewardsCoordinator.maxFutureLength = json.readUint( + ".rewardsCoordinator.MAX_FUTURE_LENGTH" + ); + data.rewardsCoordinator.genesisRewardsTimestamp = json.readUint( + ".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP" + ); + data.rewardsCoordinator.updater = json.readAddress( + ".rewardsCoordinator.rewards_updater_address" + ); + data.rewardsCoordinator.activationDelay = json.readUint( + ".rewardsCoordinator.activation_delay" + ); + data.rewardsCoordinator.calculationIntervalSeconds = json.readUint( + ".rewardsCoordinator.calculation_interval_seconds" + ); + data.rewardsCoordinator.globalOperatorCommissionBips = json.readUint( + ".rewardsCoordinator.global_operator_commission_bips" + ); // RewardsCoordinator config end return data; @@ -346,14 +443,21 @@ library CoreDeploymentLib { uint256 chainId ) internal returns (DeploymentConfigData memory) { return - readDeploymentConfigValues(directoryPath, string.concat(vm.toString(chainId), ".json")); + readDeploymentConfigValues( + directoryPath, + string.concat(vm.toString(chainId), ".json") + ); } function readDeploymentJson( string memory directoryPath, uint256 chainId - ) internal returns (DeploymentData memory) { - return readDeploymentJson(directoryPath, string.concat(vm.toString(chainId), ".json")); + ) public returns (DeploymentData memory) { + return + readDeploymentJson( + directoryPath, + string.concat(vm.toString(chainId), ".json") + ); } function readDeploymentJson( @@ -372,14 +476,18 @@ library CoreDeploymentLib { data.eigenPodManager = json.readAddress(".addresses.eigenPodManager"); data.delegationManager = json.readAddress(".addresses.delegation"); data.avsDirectory = json.readAddress(".addresses.avsDirectory"); + data.rewardsCoordinator = json.readAddress( + ".addresses.rewardsCoordinator" + ); + data.allocationManager = json.readAddress( + ".addresses.allocationManager" + ); return data; } /// TODO: Need to be able to read json from eigenlayer-contracts repo for holesky/mainnet and output the json here - function writeDeploymentJson( - DeploymentData memory data - ) internal { + function writeDeploymentJson(DeploymentData memory data) internal { writeDeploymentJson("deployments/core/", block.chainid, data); } @@ -388,11 +496,20 @@ library CoreDeploymentLib { uint256 chainId, DeploymentData memory data ) internal { - address proxyAdmin = address(UpgradeableProxyLib.getProxyAdmin(data.strategyManager)); + address proxyAdmin = address( + UpgradeableProxyLib.getProxyAdmin(data.strategyManager) + ); - string memory deploymentData = _generateDeploymentJson(data, proxyAdmin); + string memory deploymentData = _generateDeploymentJson( + data, + proxyAdmin + ); - string memory fileName = string.concat(path, vm.toString(chainId), ".json"); + string memory fileName = string.concat( + path, + vm.toString(chainId), + ".json" + ); if (!vm.exists(path)) { vm.createDir(path, true); } @@ -405,15 +522,16 @@ library CoreDeploymentLib { DeploymentData memory data, address proxyAdmin ) private view returns (string memory) { - return string.concat( - '{"lastUpdate":{"timestamp":"', - vm.toString(block.timestamp), - '","block_number":"', - vm.toString(block.number), - '"},"addresses":', - _generateContractsJson(data, proxyAdmin), - "}" - ); + return + string.concat( + '{"lastUpdate":{"timestamp":"', + vm.toString(block.timestamp), + '","block_number":"', + vm.toString(block.number), + '"},"addresses":', + _generateContractsJson(data, proxyAdmin), + "}" + ); } function _generateContractsJson( @@ -421,32 +539,37 @@ library CoreDeploymentLib { address proxyAdmin ) private view returns (string memory) { /// TODO: namespace contracts -> {avs, core} - return string.concat( - '{"proxyAdmin":"', - proxyAdmin.toHexString(), - '","delegation":"', - data.delegationManager.toHexString(), - '","delegationManagerImpl":"', - data.delegationManager.getImplementation().toHexString(), - '","avsDirectory":"', - data.avsDirectory.toHexString(), - '","avsDirectoryImpl":"', - data.avsDirectory.getImplementation().toHexString(), - '","strategyManager":"', - data.strategyManager.toHexString(), - '","strategyManagerImpl":"', - data.strategyManager.getImplementation().toHexString(), - '","eigenPodManager":"', - data.eigenPodManager.toHexString(), - '","eigenPodManagerImpl":"', - data.eigenPodManager.getImplementation().toHexString(), - '","strategyFactory":"', - data.strategyFactory.toHexString(), - '","strategyFactoryImpl":"', - data.strategyFactory.getImplementation().toHexString(), - '","strategyBeacon":"', - data.strategyBeacon.toHexString(), - '"}' - ); + return + string.concat( + '{"proxyAdmin":"', + proxyAdmin.toHexString(), + '","delegation":"', + data.delegationManager.toHexString(), + '","delegationManagerImpl":"', + data.delegationManager.getImplementation().toHexString(), + '","avsDirectory":"', + data.avsDirectory.toHexString(), + '","avsDirectoryImpl":"', + data.avsDirectory.getImplementation().toHexString(), + '","strategyManager":"', + data.strategyManager.toHexString(), + '","strategyManagerImpl":"', + data.strategyManager.getImplementation().toHexString(), + '","eigenPodManager":"', + data.eigenPodManager.toHexString(), + '","eigenPodManagerImpl":"', + data.eigenPodManager.getImplementation().toHexString(), + '","strategyFactory":"', + data.strategyFactory.toHexString(), + '","rewardsCoordinator":"', + data.rewardsCoordinator.toHexString(), + '","pauserRegistry":"', + data.pauserRegistry.toHexString(), + '","strategyBeacon":"', + data.strategyBeacon.toHexString(), + '","allocationManager":"', + data.allocationManager.toHexString(), + '"}' + ); } -} +} \ No newline at end of file diff --git a/contracts/script/utils/UpgradeableProxyLib.sol b/contracts/script/utils/UpgradeableProxyLib.sol index 56bdae5d..40dd4909 100644 --- a/contracts/script/utils/UpgradeableProxyLib.sol +++ b/contracts/script/utils/UpgradeableProxyLib.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.0; import {Vm} from "forge-std/Vm.sol"; import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import {TransparentUpgradeableProxy} from +import {TransparentUpgradeableProxy,ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + import {EmptyContract} from "@eigenlayer/test/mocks/EmptyContract.sol"; library UpgradeableProxyLib { @@ -28,12 +29,12 @@ library UpgradeableProxyLib { function upgrade(address proxy, address impl) internal { ProxyAdmin admin = getProxyAdmin(proxy); - admin.upgrade(TransparentUpgradeableProxy(payable(proxy)), impl); + admin.upgrade(ITransparentUpgradeableProxy(payable(proxy)), impl); } function upgradeAndCall(address proxy, address impl, bytes memory initData) internal { ProxyAdmin admin = getProxyAdmin(proxy); - admin.upgradeAndCall(TransparentUpgradeableProxy(payable(proxy)), impl, initData); + admin.upgradeAndCall(ITransparentUpgradeableProxy(payable(proxy)), impl, initData); } function getImplementation( diff --git a/contracts/src/HelloWorldServiceManager.sol b/contracts/src/HelloWorldServiceManager.sol index fdebbbdc..67b681cc 100644 --- a/contracts/src/HelloWorldServiceManager.sol +++ b/contracts/src/HelloWorldServiceManager.sol @@ -43,16 +43,22 @@ contract HelloWorldServiceManager is ECDSAServiceManagerBase, IHelloWorldService address _avsDirectory, address _stakeRegistry, address _rewardsCoordinator, - address _delegationManager + address _delegationManager, + address _allocationManager ) ECDSAServiceManagerBase( _avsDirectory, _stakeRegistry, _rewardsCoordinator, - _delegationManager + _delegationManager, + _allocationManager ) - {} + { + // _initializePauser(_pauserRegistry, UNPAUSE_ALL); + + } + /* FUNCTIONS */ // NOTE: this function creates new task, assigns it a taskId