diff --git a/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json b/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json deleted file mode 100644 index 93a1ee271..000000000 --- a/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "chainInfo": { - "chainId": 17000 - }, - "multisig_addresses": { - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - }, - "strategies": { - "numStrategies": 0, - "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "strategiesToDeploy": [] - }, - "strategyManager": { - "init_strategy_whitelister": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "init_paused_status": 0 - }, - "delegationManager": { - "init_paused_status": 0, - "init_minWithdrawalDelayBlocks": 10 - }, - "rewardsCoordinator": { - "init_paused_status": 0, - "CALCULATION_INTERVAL_SECONDS": 604800, - "MAX_REWARDS_DURATION": 6048000, - "MAX_RETROACTIVE_LENGTH": 7776000, - "MAX_FUTURE_LENGTH": 2592000, - "GENESIS_REWARDS_TIMESTAMP": 1710979200, - "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", - "activation_delay": 7200, - "calculation_interval_seconds": 604800, - "global_operator_commission_bips": 1000 - }, - "avsDirectory": { - "init_paused_status": 0 - }, - "slasher": { - "init_paused_status": 0 - }, - "eigenPod": { - "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": 32000000000, - "GENESIS_TIME": 1695902400 - }, - "eigenPodManager": { - "init_paused_status": 0, - "deneb_fork_timestamp": "1707305664" - }, - "delayedWithdrawalRouter": { - "init_paused_status": 0, - "init_withdrawalDelayBlocks": 10 - }, - "ethPOSDepositAddress": "0x4242424242424242424242424242424242424242", - "beaconOracleAddress": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25" -} \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_addresses.config.json b/script/configs/holesky/eigenlayer_addresses_testnet.config.json similarity index 96% rename from script/configs/holesky/eigenlayer_addresses.config.json rename to script/configs/holesky/eigenlayer_addresses_testnet.config.json index 84948803b..ec49ca834 100644 --- a/script/configs/holesky/eigenlayer_addresses.config.json +++ b/script/configs/holesky/eigenlayer_addresses_testnet.config.json @@ -1,4 +1,5 @@ { + "lastUpdated": "v0.4.3-rewards-incentives", "addresses": { "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", @@ -16,7 +17,7 @@ "eigenPodManagerImplementation": "0x91A6525a4a843F5a5B633905300c33F79413CCc5", "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", "rewardsCoordinator": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", - "rewardsCoordinatorImplementation": "0xe54625095656206AC1B42819875343453c447f97", + "rewardsCoordinatorImplementation": "0x1131D88143a35011E35263b43eC66cDd27025584", "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", "numStrategiesDeployed": 10, diff --git a/script/configs/holesky/eigenlayer_testnet.config.json b/script/configs/holesky/eigenlayer_testnet.config.json new file mode 100644 index 000000000..ddc6d2120 --- /dev/null +++ b/script/configs/holesky/eigenlayer_testnet.config.json @@ -0,0 +1,57 @@ +{ + "lastUpdated": "v0.4.3-rewards-incentives", + "chainInfo": { + "chainId": 17000 + }, + "multisig_addresses": { + "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", + "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", + "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", + "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", + "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" + }, + "strategies": { + "numStrategies": 0, + "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "strategiesToDeploy": [] + }, + "strategyManager": { + "init_strategy_whitelister": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", + "init_paused_status": 0 + }, + "delegationManager": { + "init_paused_status": 0, + "init_minWithdrawalDelayBlocks": 10 + }, + "rewardsCoordinator": { + "init_paused_status": 0, + "CALCULATION_INTERVAL_SECONDS": 604800, + "MAX_REWARDS_DURATION": 6048000, + "MAX_RETROACTIVE_LENGTH": 7776000, + "MAX_FUTURE_LENGTH": 2592000, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", + "activation_delay": 7200, + "calculation_interval_seconds": 604800, + "global_operator_commission_bips": 1000 + }, + "avsDirectory": { + "init_paused_status": 0 + }, + "slasher": { + "init_paused_status": 0 + }, + "eigenPod": { + "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": 32000000000, + "GENESIS_TIME": 1695902400 + }, + "eigenPodManager": { + "init_paused_status": 0 + }, + "delayedWithdrawalRouter": { + "init_paused_status": 0, + "init_withdrawalDelayBlocks": 10 + }, + "ethPOSDepositAddress": "0x4242424242424242424242424242424242424242" + } \ No newline at end of file diff --git a/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol index c534efea1..fa077f934 100644 --- a/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol +++ b/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol @@ -17,7 +17,7 @@ import "./Deploy_Test_RewardsCoordinator.s.sol"; */ contract Deploy_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator { function run(string memory deployArg) external virtual { - _parseInitialDeploymentParams("script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json"); + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_preprod.config.json"); _parseDeployedContracts("script/output/holesky/M2_deploy_preprod.output.json"); // Overwrite testAddress and multisigs to be EOAowner diff --git a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol index 244a26dc1..480123d70 100644 --- a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol +++ b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol @@ -16,7 +16,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser { address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; function run() external virtual { - _parseInitialDeploymentParams("script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json"); + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses.config.json"); // START RECORDING TRANSACTIONS FOR DEPLOYMENT diff --git a/script/deploy/holesky/v040-holesky-pepe.s.sol b/script/deploy/holesky/v040-holesky-pepe.s.sol index 6baa09e16..6b12ccf56 100644 --- a/script/deploy/holesky/v040-holesky-pepe.s.sol +++ b/script/deploy/holesky/v040-holesky-pepe.s.sol @@ -16,7 +16,7 @@ contract PEPE_Deploy_Preprod is ExistingDeploymentParser { function run() external virtual { _parseInitialDeploymentParams( - "script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json" + "script/configs/holesky/eigenlayer_preprod.config.json" ); _parseDeployedContracts( "script/configs/holesky/eigenlayer_addresses.config.json" diff --git a/script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol b/script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol new file mode 100644 index 000000000..aeed0cc37 --- /dev/null +++ b/script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./Deploy_Test_RewardsCoordinator.s.sol"; +import "script/utils/TimelockEncoding.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * anvil --fork-url $RPC_HOLESKY + * + * Holesky testnet: Deploy/Upgrade RewardsCoordinator + * forge script script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY + * + */ +contract Upgrade_Testnet_RewardsCoordinator is Deploy_Test_RewardsCoordinator, TimelockEncoding { + function run() external virtual override { + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); + _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses_testnet.config.json"); + + RewardsCoordinator oldRewardsCoordinator = rewardsCoordinatorImplementation; + + // Deploy Rewards Coordinator + vm.startBroadcast(); + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + vm.stopBroadcast(); + + _sanityCheckImplementations(oldRewardsCoordinator, rewardsCoordinatorImplementation); + + emit log_named_address("Rewards Coordinator Implementation", address(rewardsCoordinatorImplementation)); + + // Create Upgrade Tx via Community Multisig + bytes memory calldata_to_proxy_admin = abi.encodeWithSelector( + ProxyAdmin.upgrade.selector, + TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + rewardsCoordinatorImplementation + ); + + bytes memory final_calldata_to_executor_multisig = encodeForExecutor( + communityMultisig, //from + address(eigenLayerProxyAdmin), //to + 0, // value + calldata_to_proxy_admin, // data + ISafe.Operation.Call // operation + ); + + // Simulate Transaction + vm.prank(communityMultisig); + (bool success, ) = address(executorMultisig).call(final_calldata_to_executor_multisig); + require(success, "Transaction failed"); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(); + _verifyInitializationParams(); + } + + function _sanityCheckImplementations(RewardsCoordinator oldRc, RewardsCoordinator newRc) internal { + // Verify configs between both rewardsCoordinatorImplementations + assertEq( + address(oldRc.delegationManager()), + address(newRc.delegationManager()), + "DM mismatch" + ); + assertEq( + address(oldRc.strategyManager()), + address(newRc.strategyManager()), + "SM mismatch" + ); + assertEq( + oldRc.CALCULATION_INTERVAL_SECONDS(), + newRc.CALCULATION_INTERVAL_SECONDS(), + "CALCULATION_INTERVAL_SECONDS mismatch" + ); + assertEq( + oldRc.MAX_REWARDS_DURATION(), + newRc.MAX_REWARDS_DURATION(), + "MAX_REWARDS_DURATION mismatch" + ); + assertEq( + oldRc.MAX_RETROACTIVE_LENGTH(), + newRc.MAX_RETROACTIVE_LENGTH(), + "MAX_RETROACTIVE_LENGTH mismatch" + ); + assertEq( + oldRc.MAX_FUTURE_LENGTH(), + newRc.MAX_FUTURE_LENGTH(), + "MAX_FUTURE_LENGTH mismatch" + ); + assertEq( + oldRc.GENESIS_REWARDS_TIMESTAMP(), + newRc.GENESIS_REWARDS_TIMESTAMP(), + "GENESIS_REWARDS_TIMESTAMP mismatch" + ); + } + + function setRewardForAllSubmitter() external { + address hopper; + + require(hopper != address(0), "Hopper address is not set"); + + // Set reward for all submitters + vm.startBroadcast(); + rewardsCoordinator.setRewardsForAllSubmitter(hopper, true); + vm.stopBroadcast(); + + require(rewardsCoordinator.isRewardsForAllSubmitter(hopper), "Hopper is not set as rewards for all submitter"); + } +} \ No newline at end of file