diff --git a/script/output/GV2_preprod_deployment_2024_30_1.json b/script/output/GV2_preprod_deployment_2024_30_1.json new file mode 100644 index 000000000..f705e6f9f --- /dev/null +++ b/script/output/GV2_preprod_deployment_2024_30_1.json @@ -0,0 +1,30 @@ +{ + "addresses": { + "baseStrategyImplementation": "0xA548BF0106108A0c14779F3f1d8981517b8fA9D0", + "delayedWithdrawalRouter": "0x9572e46797B7A07257314e587061dC46c4dfCE0E", + "delayedWithdrawalRouterImplementation": "0x44a40C60857b4B420Ad3D8b9646FefEBF2D0dB86", + "delegation": "0x45b4c4DAE69393f62e1d14C5fe375792DF4E6332", + "delegationImplementation": "0x934eB3E2b6D5C2E1601B29B7180026D71438F20D", + "eigenLayerPauserReg": "0x94A2679B6A87ADb4e0CabA8E3E40f463C6062DeC", + "eigenLayerProxyAdmin": "0x555573Ff2B3b2731e69eeBAfb40a4EEA7fBaC54A", + "eigenPodBeacon": "0x38cBD4e08eA1840B91dA42fE02B55Abc89083bFB", + "eigenPodImplementation": "0x83cbB48391F428878Bc5DD97C9792a8dbCAa0729", + "eigenPodManager": "0x33e42d539abFe9b387B27b0e467374Bbb76cf925", + "eigenPodManagerImplementation": "0xEEdCC9dB001fB8429721FE21426F51f0Cdd329EC", + "emptyContract": "0xb23633b2240D78502fA308B817C892b2d5778469", + "slasher": "0xF751E8C37ACd3AD5a35D5db03E57dB6F9AD0bDd0", + "slasherImplementation": "0x05c235183e8b9dFb7113Cf92bbDc3f5085324158", + "strategyManager": "0xD309ADd2B269d522112DcEe0dCf0b0f04a09C29e", + "strategyManagerImplementation": "0xb9B69504f1a727E783F4B4248A115D56F4080DF8", + "avsDirectory": "0x47eFB8e38656a805BC6B3b13FA331d34dcDeB374", + "avsDirectoryImplementation": "0x728111B10227F44E5e389e5650725948d1DCcE7A" + }, + "chainInfo": { + "chainId": 5, + "deploymentBlock": 10469472 + }, + "parameters": { + "executorMultisig": "0x27977e6E4426A525d055A587d2a0537b4cb376eA", + "operationsMultisig": "0x27977e6E4426A525d055A587d2a0537b4cb376eA" + } +} \ No newline at end of file diff --git a/script/output/M2_preprod_deployment_from_scratch.json b/script/output/M2_preprod_deployment_from_scratch.json new file mode 100644 index 000000000..0ac97a9e9 --- /dev/null +++ b/script/output/M2_preprod_deployment_from_scratch.json @@ -0,0 +1,33 @@ +{ + "addresses": { + "baseStrategyImplementation": "0xA548BF0106108A0c14779F3f1d8981517b8fA9D0", + "blsPublicKeyCompendium": "0x663F1f6A8E4417b9dB3117821068DAD862395aF0", + "delayedWithdrawalRouter": "0x9572e46797B7A07257314e587061dC46c4dfCE0E", + "delayedWithdrawalRouterImplementation": "0xaDd6b52E063bE5CdeF6450F28D9CA038bDAB9A49", + "delegation": "0x45b4c4DAE69393f62e1d14C5fe375792DF4E6332", + "delegationImplementation": "0x679cf51e303827c99e924bea05331101bF90B126", + "eigenLayerPauserReg": "0x94A2679B6A87ADb4e0CabA8E3E40f463C6062DeC", + "eigenLayerProxyAdmin": "0x555573Ff2B3b2731e69eeBAfb40a4EEA7fBaC54A", + "eigenPodBeacon": "0x38cBD4e08eA1840B91dA42fE02B55Abc89083bFB", + "eigenPodImplementation": "0x9CeE917f0f5d4123585A4B12906a8A65cFac1ac8", + "eigenPodManager": "0x33e42d539abFe9b387B27b0e467374Bbb76cf925", + "eigenPodManagerImplementation": "0x6A4855ab9a3924c8169f20a189272FFF3cd00b68", + "emptyContract": "0xb23633b2240D78502fA308B817C892b2d5778469", + "slasher": "0xF751E8C37ACd3AD5a35D5db03E57dB6F9AD0bDd0", + "slasherImplementation": "0xa02171440AfD8d5f09BaAB74Cd48b1401C47F2f9", + "strategies": { + "Liquid staked Ether 2.0": "0xed6DE3f2916d20Cb427fe7255194a05061319FFB", + "Rocket Pool ETH": "0xd421b2a340497545dA68AE53089d99b9Fe0493cD" + }, + "strategyManager": "0xD309ADd2B269d522112DcEe0dCf0b0f04a09C29e", + "strategyManagerImplementation": "0xC10133A329A210f8DEbf597C8eF5907c95D673e9" + }, + "chainInfo": { + "chainId": 5, + "deploymentBlock": 9729808 + }, + "parameters": { + "executorMultisig": "0x27977e6E4426A525d055A587d2a0537b4cb376eA", + "operationsMultisig": "0x27977e6E4426A525d055A587d2a0537b4cb376eA" + } + } \ No newline at end of file diff --git a/script/upgrade/GoerliUpgrade2.s.sol b/script/upgrade/GoerliUpgrade2.s.sol new file mode 100644 index 000000000..cc6884167 --- /dev/null +++ b/script/upgrade/GoerliUpgrade2.s.sol @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.8.12; + +import "../../src/contracts/interfaces/IETHPOSDeposit.sol"; + +import "../../src/contracts/core/StrategyManager.sol"; +import "../../src/contracts/core/Slasher.sol"; +import "../../src/contracts/core/DelegationManager.sol"; +import "../../src/contracts/core/AVSDirectory.sol"; + +import "../../src/contracts/pods/EigenPod.sol"; +import "../../src/contracts/pods/EigenPodManager.sol"; +import "../../src/contracts/pods/DelayedWithdrawalRouter.sol"; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "../../src/test/mocks/EmptyContract.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/upgrade/GoerliUpgrade2.s.sol:GoerliUpgrade2 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv + +// NOTE: ONLY WORKS ON GOERLI +// CommitHash: 7257364d03d255ea8c855f36317ce0e892b78497 +contract GoerliUpgrade2 is Script, Test { + Vm cheats = Vm(HEVM_ADDRESS); + + string public deploymentOutputPath = string(bytes("script/output/M2_preprod_deployment_from_scratch.json")); + + IDelayedWithdrawalRouter delayedWithdrawalRouter; + IDelegationManager delegation; + IEigenPodManager eigenPodManager; + IStrategyManager strategyManager; + ISlasher slasher; + IBeacon eigenPodBeacon; + EmptyContract emptyContract; + ProxyAdmin eigenLayerProxyAdmin; + + function run() external { + // read and log the chainID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + string memory config_data = vm.readFile(deploymentOutputPath); + + delayedWithdrawalRouter = IDelayedWithdrawalRouter(stdJson.readAddress(config_data, ".addresses.delayedWithdrawalRouter")); + delegation = IDelegationManager(stdJson.readAddress(config_data, ".addresses.delegation")); + eigenPodManager = IEigenPodManager(stdJson.readAddress(config_data, ".addresses.eigenPodManager")); + strategyManager = IStrategyManager(stdJson.readAddress(config_data, ".addresses.strategyManager")); + slasher = ISlasher(stdJson.readAddress(config_data, ".addresses.slasher")); + eigenPodBeacon = IBeacon(stdJson.readAddress(config_data, ".addresses.eigenPodBeacon")); + emptyContract = EmptyContract(stdJson.readAddress(config_data, ".addresses.emptyContract")); + eigenLayerProxyAdmin = ProxyAdmin(stdJson.readAddress(config_data, ".addresses.eigenLayerProxyAdmin")); + + vm.startBroadcast(); + + address delegationImplementation = address( + new DelegationManager( + strategyManager, + slasher, + eigenPodManager + ) + ); + + address slasherImplementation = address( + new Slasher( + strategyManager, + delegation + ) + ); + + address strategyManagerImplementation = address( + new StrategyManager( + delegation, + eigenPodManager, + slasher + ) + ); + + address delayedWithdrawalRouterImplementation = address( + new DelayedWithdrawalRouter( + eigenPodManager + ) + ); + + address eigenPodImplementation = address( + new EigenPod( + IETHPOSDeposit(0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b), + delayedWithdrawalRouter, + eigenPodManager, + 32e9, + 1616508000 + ) + ); + + address eigenPodManagerImplementation = address( + new EigenPodManager( + IETHPOSDeposit(0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b), + eigenPodBeacon, + strategyManager, + slasher, + delegation + ) + ); + + vm.stopBroadcast(); + + emit log_named_address("DelegationImplementation", delegationImplementation); + emit log_named_address("SlasherImplementation", slasherImplementation); + emit log_named_address("StrategyManagerImplementation", strategyManagerImplementation); + emit log_named_address("DelayedWithdrawalRouterImplementation", delayedWithdrawalRouterImplementation); + emit log_named_address("EigenPodImplementation", eigenPodImplementation); + emit log_named_address("EigenPodManagerImplementation", eigenPodManagerImplementation); + + /* + == Logs == + You are deploying on ChainID: 5 + DelegationImplementation: 0x934eB3E2b6D5C2E1601B29B7180026D71438F20D + SlasherImplementation: 0x05c235183e8b9dFb7113Cf92bbDc3f5085324158 + StrategyManagerImplementation: 0xb9B69504f1a727E783F4B4248A115D56F4080DF8 + DelayedWithdrawalRouterImplementation: 0x44a40C60857b4B420Ad3D8b9646FefEBF2D0dB86 + EigenPodImplementation: 0x83cbB48391F428878Bc5DD97C9792a8dbCAa0729 + EigenPodManagerImplementation: 0xEEdCC9dB001fB8429721FE21426F51f0Cdd329EC + */ + } +} \ No newline at end of file diff --git a/script/utils/ExistingDeploymentParser.sol b/script/utils/ExistingDeploymentParser.sol index f11e8b5cd..8d2544b26 100644 --- a/script/utils/ExistingDeploymentParser.sol +++ b/script/utils/ExistingDeploymentParser.sol @@ -8,6 +8,7 @@ import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; import "../../src/contracts/core/StrategyManager.sol"; import "../../src/contracts/core/Slasher.sol"; import "../../src/contracts/core/DelegationManager.sol"; +import "../../src/contracts/core/AVSDirectory.sol"; import "../../src/contracts/strategies/StrategyBase.sol"; @@ -29,6 +30,8 @@ contract ExistingDeploymentParser is Script, Test { PauserRegistry public eigenLayerPauserReg; Slasher public slasher; Slasher public slasherImplementation; + AVSDirectory public avsDirectory; + AVSDirectory public avsDirectoryImplementation; DelegationManager public delegation; DelegationManager public delegationImplementation; StrategyManager public strategyManager; @@ -71,6 +74,8 @@ contract ExistingDeploymentParser is Script, Test { slasherImplementation = Slasher(stdJson.readAddress(existingDeploymentData, ".addresses.slasherImplementation")); delegation = DelegationManager(stdJson.readAddress(existingDeploymentData, ".addresses.delegation")); delegationImplementation = DelegationManager(stdJson.readAddress(existingDeploymentData, ".addresses.delegationImplementation")); + avsDirectory = AVSDirectory(stdJson.readAddress(existingDeploymentData, ".addresses.avsDirectory")); + avsDirectoryImplementation = AVSDirectory(stdJson.readAddress(existingDeploymentData, ".addresses.avsDirectoryImplementation")); strategyManager = StrategyManager(stdJson.readAddress(existingDeploymentData, ".addresses.strategyManager")); strategyManagerImplementation = StrategyManager(stdJson.readAddress(existingDeploymentData, ".addresses.strategyManagerImplementation")); eigenPodManager = EigenPodManager(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodManager"));