diff --git a/.gitmodules b/.gitmodules index e729e9fc1..3c23de6f8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "lib/openzeppelin-contracts-upgradeable-v4.9.0"] path = lib/openzeppelin-contracts-upgradeable-v4.9.0 url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable +[submodule "lib/zeus-templates"] + path = lib/zeus-templates + url = https://github.com/Layr-Labs/zeus-templates diff --git a/certora/scripts/libraries/verifyStructuredLinkedList.sh b/certora/scripts/libraries/verifyStructuredLinkedList.sh deleted file mode 100644 index c03c593d4..000000000 --- a/certora/scripts/libraries/verifyStructuredLinkedList.sh +++ /dev/null @@ -1,18 +0,0 @@ -if [[ "$2" ]] -then - RULE="--rule $2" -fi - -solc-select use 0.8.12 - -certoraRun certora/harnesses/StructuredLinkedListHarness.sol \ - --verify StructuredLinkedListHarness:certora/specs/libraries/StructuredLinkedList.spec \ - --solc_via_ir \ - --solc_optimize 1 \ - --optimistic_loop \ - --optimistic_fallback \ - --parametric_contracts StructuredLinkedListHarness \ - $RULE \ - --rule_sanity \ - --loop_iter 3 \ - --msg "StructuredLinkedList $1 $2" \ \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index 8a79acefa..d294bafcc 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,7 +2,7 @@ src = 'src' out = 'out' libs = ['lib'] -fs_permissions = [{ access = "read-write", path = "./"}] +fs_permissions = [{ access = "read-write", path = "./"}, { access = "read-write", path = "/var/folders"}] gas_reports = ["*"] # ignore upgrade testing in scripts by default no_match_test = "queueUpgrade" diff --git a/lib/forge-std b/lib/forge-std index 4f57c59f0..fc560fa34 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 4f57c59f066a03d13de8c65bb34fca8247f5fcb2 +Subproject commit fc560fa34fa12a335a50c35d92e55a6628ca467c diff --git a/lib/zeus-templates b/lib/zeus-templates new file mode 160000 index 000000000..ec220a0a4 --- /dev/null +++ b/lib/zeus-templates @@ -0,0 +1 @@ +Subproject commit ec220a0a421dd582097156270905630de8aaca51 diff --git a/script/README.md b/script/README.md new file mode 100644 index 000000000..34bdb34e4 --- /dev/null +++ b/script/README.md @@ -0,0 +1,197 @@ +# Release Scripts + +This directory contains the following subdirectories: + +* `configs`: to store configuration data related to a given network. +* `interfaces`: to store interfaces relevant to your scripts. +* `releases`: to set up more subdirectories corresponding to your release, and the most important `script/` subdirectory. +* `utils`: to define any utility contracts for performing common actions. + +It is intended to be driven by [Zeus](https://github.com/Layr-Labs/zeus), which will run `forge` commands under the hood and track the status of upgrades. + +## Using Zeus Templates + +The [zeus-templates](https://github.com/Layr-Labs/zeus-templates) repository provides two base contract classes to facilitate deployment and multisig scripts. + +### EOADeployer + +`EOADeployer` is the base contract for performing EOA deploys, providing a `Deployment` struct. The entry function is `deploy()` and requires adding `-s "deploy(string memory)" ""` as a `forge script` flag. Any inheriting contract is expected to inherit the `_deploy()` internal function and return a `Deployment[]` array, containing all deployed contract details. + +The `Deployment` struct contains 3 fields: +* `name`: the name of the contract published +* `address`: the address to which the contract was published +* `envToUpdate`: the environment variable in the config file to update if relevant. + * Leave this as an empty string if deploying an instance of a contract that doesn't need to be tracked long-term. + +If you need to do something with an EOA other than deploy, the base `ConfigParser` provided by `zeus-templates` is the appropriate base contract. + +### MultisigBuilder + +`MultisigBuilder` is the base class for any action to be taken by a Safe Multisig. The entry function is `execute()` and requires adding `-s "execute(string memory)" ""` as a `forge script` flag. Any inheriting contract is expected to inherit the `_execute()` internal function and return a `MultisigCall[]` object, containing all intended multisig calls. + +The `MultisigCall` struct contains 3 fields: +* `to`: the address to call with the multisig +* `value`: the amount of ETH to send as part of the transaction. +* `data`: the calldata associated with the multisig call. + +Once the `_execute()` function is implemented, the base MultisigBuilder contract will combine these calls into one `SafeTx` object, which is intended to pass all calls into the [MultiSendCallOnly](https://github.com/safe-global/safe-smart-account/blob/6fde75d29c8b52d5ac0c93a6fb7631d434b64119/contracts/libraries/MultiSendCallOnly.sol) contract. + +## Setting up a Release Directory + +### Naming + +Every file must be named either `#-eoa.s.sol` or `#-multisig.s.sol`, where `#` represents the script's order in the release process and the choice of `(eoa|multisig)` represents the relevant signing strategy. + +## Example: How to write a Deploy-Queue-Upgrade + +Before diving into how to do this, a quick context blurb for those unfamiliar. If you are familiar, feel free to jump to the next subsection, [Deploy](#deploy). + +### Context + +A deploy-queue-execute flow is common given EigenLayer's [multisig governance](https://docs.eigenlayer.xyz/eigenlayer/security/multisig-governance) structure. For context, the Executor Multisig (a 1-of-2 multisig) owns many critical privileges on EigenLayer, such as the ability to upgrade core contracts. An EigenLayer upgrade will often originate from the Operations Multisig, controlled by Eigen Labs, which is 1 of the 2 signers. Well, in spirit at least. + +Technically, there is an intermediate contract between the Ops Multisig and Executor known as the Timelock into which actions must be queued for a waiting period (~10 days). After the delay, the Operations Multsig must then poke the Timelock to forward the transaction to the Executor, which will finally take action. + +### Deploy + +Deploy scripts are expected to inherit the `EOADeployer` script and produce a `Deployment[]` array containing all deployed contract names, addresses, and overridden config values. + +An example deploy script looks as follows: + +```solidity +pragma solidity ^0.8.12; + +import "zeus-templates/templates/EOADeployer.sol"; + +... // imagine imports here + +contract DeployEigenPodManager is EOADeployer { + + function _deploy(Addresses memory, Environment memory, Params memory params) internal override returns (Deployment[] memory) { + + vm.startBroadcast(); + + address newEigenPodManager = new EigenPodManager( + ... // imagine params here + ); + + _deployments.push(Deployment({ + name: type(EigenPodManager).name, + deployedTo: newEigenPodManager, + envToUpdate: "eigenPodManager.pendingImpl" + })); + + vm.stopBroadcast(); + + return _deployments; + } +} +``` + +Here, the script inherits the `EOADeployer` and implements the `_deploy()` function, creating a new `EigenPodManager` with relevant details and requesting for Zeus to set the `pendingImpl` field of the `eigenPodManager` in the config to the given address. It would be pending because a transaction must be issued to upgrade the EigenPodManager to this new implementation. + +### Queue + +Once the above `eigenPodManager` is deployed, a `queueTransaction` operation must be taken in the Timelock if upgrading via the Ops Multisig. This could look like something below: + +```solidity +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "zeus-templates/templates/OpsTimelockBuilder.sol"; + +import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import {IUpgradeableBeacon} from "script/interfaces/IUpgradeableBeacon.sol"; +import "src/contracts/pods/EigenPodManager.sol"; + +contract QueueEigenPodAndManager is OpsTimelockBuilder { + + using MultisigCallUtils for MultisigCall[]; + using SafeTxUtils for SafeTx; + + MultisigCall[] internal _executorCalls; + + function queue(Addresses memory addrs, Environment memory env, Params memory params) public override returns (MultisigCall[] memory) { + + // construct initialization data for eigenPodManager + bytes memory eigenPodManagerData = abi.encodeWithSelector( + EigenPodManager(addrs.eigenPodManager.pendingImpl).initialize.selector, + ... // imagine initialization data + ); + + // upgrade eigenPodManager + _executorCalls.append({ + to: addrs.proxyAdmin, + data: abi.encodeWithSelector( + ProxyAdmin.upgradeAndCall.selector, + addrs.eigenPodManager.proxy, + addrs.eigenPodManager.pendingImpl, + eigenPodManagerData // initialize impl here + ) + }); + + // upgrade eigenPod beacon implementation + _executorCalls.append({ + to: addrs.eigenPod.beacon, + data: abi.encodeWithSelector( + IUpgradeableBeacon.upgradeTo.selector, + addrs.eigenPod.pendingImpl + ) + }); + + return _executorCalls; + } +} +``` + +After inheriting the `OpsTimelockBuilder` contract (which is an extension of `MultisigBuilder`), we implement the `queue()` function from the perspective of the Executor Multisig. All calls are eventually encoded as a `SafeTx` from the Ops Multisig to the Timelock. + +### Upgrade + +Once the delay has passed, `executeTransaction` can be called on the timelock with the appropriate calldata. As an example: + +```solidity +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "zeus-templates/templates/OpsTimelockBuilder.sol"; + +import "src/contracts/pods/EigenPodManager.sol"; + +import "./2-multisig.s.sol"; // using previous script to avoid rewriting + +contract ExecuteEigenPodManager is MultisigBuilder { + + using MultisigCallUtils for MultisigCall[]; + using SafeTxUtils for *; + + function _execute(Addresses memory addrs, Environment memory env, Params memory params) internal override returns (MultisigCall[] memory) { + + QueueEigenPodManager queue = new QueueEigenPodManager(); + + MultisigCall[] memory _executorCalls = queue.queue(addrs, env, params); + + // steals logic from queue() to perform execute() + // likely the first step of any _execute() after a _queue() + bytes memory executorCalldata = queue.makeExecutorCalldata( + _executorCalls, + params.multiSendCallOnly, + addrs.timelock + ); + + // execute queued transaction upgrading eigenPodManager + _multisigCalls.append({ + to: addrs.timelock, + value: 0, + data: abi.encodeWithSelector( + ITimelock.executeTransaction.selector, + executorCalldata + ) + }); + + return _multisigCalls; + } +} +``` + +After reusing the previous script's `queue()` function to recreate the calldata, we wrap it up in an `executeTransaction` encoded data blob and return the `MultisigCall`, which will then be crafted as a `SafeTx` by the parent contract. \ No newline at end of file diff --git a/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol b/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol deleted file mode 100644 index 47d96a354..000000000 --- a/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; -import "../../utils/TimelockEncoding.sol"; - -// forge script script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol:Mainnet_Unpause_Deposits --fork-url $RPC_MAINNET -vvvv -contract Mainnet_Unpause_Deposits is ExistingDeploymentParser, TimelockEncoding { - Vm cheats = Vm(VM_ADDRESS); - - // Tues Apr 16 2024 12:00:00 GMT-0700 (Pacific Daylight Time) - uint256 timelockEta = 1713250800; - - function run() external virtual { - _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); - - bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ - // call to executor will be from the timelock - from: timelock, - // performing single pause operation - to: address(strategyManager), - // value to send in tx - value: 0, - // calldata for the operation - data: abi.encodeWithSelector(Pausable.unpause.selector, 0), - // operation type (for performing single operation) - operation: ISafe.Operation.Call - }); - - (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) = encodeForTimelock({ - // address to be called from the timelock - to: executorMultisig, - // value to send in tx - value: 0, - // calldata for the operation - data: final_calldata_to_executor_multisig, - // time at which the tx will become executable - timelockEta: timelockEta - }); - - bytes32 expectedTxHash = getTxHash({ - target: executorMultisig, - _value: 0, - _data: final_calldata_to_executor_multisig, - eta: timelockEta - }); - emit log_named_bytes32("expectedTxHash", expectedTxHash); - - cheats.prank(operationsMultisig); - (bool success, ) = timelock.call(calldata_to_timelock_queuing_action); - require(success, "call to timelock queuing action failed"); - - require(ITimelock(timelock).queuedTransactions(expectedTxHash), "expectedTxHash not queued"); - - // test performing the upgrade - cheats.warp(timelockEta); - cheats.prank(operationsMultisig); - (success, ) = timelock.call(calldata_to_timelock_executing_action); - require(success, "call to timelock executing action failed"); - - // Check correctness after upgrade - require(strategyManager.paused() == 0, "unpausing was not completed correctly"); - } - - function getTxHash(address target, uint256 _value, bytes memory _data, uint256 eta) public pure returns (bytes32) { - // empty bytes - bytes memory signature; - bytes32 txHash = keccak256(abi.encode(target, _value, signature, _data, eta)); - return txHash; - } -} \ No newline at end of file diff --git a/script/configs/holesky.json b/script/configs/holesky.json new file mode 100644 index 000000000..b6c35dd06 --- /dev/null +++ b/script/configs/holesky.json @@ -0,0 +1,124 @@ +{ + "config": { + "environment": { + "chainid": 17000, + "lastUpdated": "v0.4.2-mainnet-pepe", + "name": "testnet-holesky" + }, + "params": { + "ethPOS": "0x4242424242424242424242424242424242424242", + "EIGENPOD_GENESIS_TIME": 1695902400, + "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, + "GLOBAL_OPERATOR_COMMISSION_BIPS": 1000 + } + }, + "deployment": { + "admin": { + "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", + "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", + "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", + "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", + "pauserRegistry": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", + "proxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", + "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" + }, + "core": { + "avsDirectory": { + "proxy": "0x055733000064333CaDDbC92763c58BF0192fFeBf", + "impl": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "delegationManager": { + "proxy": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", + "impl": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "rewardsCoordinator": { + "proxy": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", + "impl": "0x1a17df4170099577b79038fd310f3ff62f79752e", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "slasher": { + "proxy": "0xcAe751b75833ef09627549868A04E32679386e7C", + "impl": "0x99715D255E34a39bE9943b82F281CA734bcF345A", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyManager": { + "proxy": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", + "impl": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "pods": { + "delayedWithdrawalRouter": { + "proxy": "0x642c646053eaf2254f088e9019ACD73d9AE0FA32", + "impl": "0xcE8b8D99773a718423F8040a6e52c06a4ce63407", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPod": { + "beacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", + "impl": "0x10ad7e30e3F52076C8462D573530f4461377319c", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPodManager": { + "proxy": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", + "impl": "0x91A6525a4a843F5a5B633905300c33F79413CCc5", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "strategies": { + "strategyFactory": { + "proxy": "0x9c01252B580efD11a05C00Aa42Dd3ac1Ec52DF6d", + "impl": "0x5E699de7bFc4DD2A5E72EB5a2Ca99651EfdD51CB", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyBeacon": { + "beacon": "0xd3c6C6BA4E40dB9288c6a2077e5635344F8aFA4F", + "impl": "0xb637caeedfCBf88e0d019E7AE4691b554c994A1e", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "preLongtailStrats": { + "impl": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", + "addrs": [ + "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", + "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", + "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", + "0x31B6F59e1627cEfC9fA174aD03859fC337666af7", + "0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6", + "0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c", + "0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943", + "0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef", + "0xaccc5A86732BE85b5012e8614AF237801636F8e5", + "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac", + "0xAD76D205564f955A9c18103C4422D1Cd94016899", + "0x78dBcbEF8fF94eC7F631c23d38d197744a323868" + ] + } + }, + "token": { + "bEIGEN": { + "proxy": "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27", + "impl": "0x4500927874Ad41538c1bEF2F5278E7a86DF6bce8", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0x67482666771e82c9a73bb9e9a22b2b597f448bbf" + }, + "EIGEN": { + "proxy": "0x3B78576F7D6837500bA3De27A60c7f594934027E", + "impl": "0x083bC9e0DCF2C3e13E24686e5202232995578c5a", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0x67482666771e82c9a73bb9e9a22b2b597f448bbf" + }, + "eigenStrategy": { + "proxy": "0x43252609bff8a13dFe5e057097f2f45A24387a84", + "impl": "0x94650e09a471CEF96e7966cabf26718FBf352697", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + } + } +} \ No newline at end of file diff --git a/script/configs/holesky/M2_deploy_from_scratch.holesky.config.json b/script/configs/holesky/M2_deploy_from_scratch.holesky.config.json deleted file mode 100644 index b0cdcc42c..000000000 --- a/script/configs/holesky/M2_deploy_from_scratch.holesky.config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "chainInfo": { - "chainId": 17000 - }, - "multisig_addresses": { - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - }, - "strategies": { - "numStrategies": 3, - "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "strategiesToDeploy": [ - { - "token_address": "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034", - "token_name": "Liquid staked Ether 2.0", - "token_symbol": "stETH" - }, - { - "token_address": "0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1", - "token_name": "Rocket Pool ETH", - "token_symbol": "rETH" - }, - { - "token_address": "0x94373a4919B3240D86eA41593D5eBa789FEF3848", - "token_name": "Wrapped Ether", - "token_symbol": "WETH" - } - ] - }, - "strategyManager": { - "init_strategy_whitelister": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "init_paused_status": 0 - }, - "delegationManager": { - "init_paused_status": 0, - "init_minWithdrawalDelayBlocks": 50400 - }, - "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": 50400 - }, - "ethPOSDepositAddress": "0x4242424242424242424242424242424242424242", - "beaconOracleAddress": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25" -} \ No newline at end of file diff --git a/script/configs/holesky/M2_deploy_preprod.holesky.config.json b/script/configs/holesky/M2_deploy_preprod.holesky.config.json deleted file mode 100644 index 498c6c4d4..000000000 --- a/script/configs/holesky/M2_deploy_preprod.holesky.config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "chainInfo": { - "chainId": 17000 - }, - "multisig_addresses": { - "pauserMultisig": "0x0000000000000000000000000000000000000000", - "communityMultisig": "0x0000000000000000000000000000000000000000", - "operationsMultisig": "0x0000000000000000000000000000000000000000", - "executorMultisig": "0x0000000000000000000000000000000000000000", - "timelock": "0x0000000000000000000000000000000000000000" - }, - "strategies": { - "numStrategies": 2, - "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "strategiesToDeploy": [ - { - "token_address": "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034", - "token_name": "Liquid staked Ether 2.0", - "token_symbol": "stETH" - }, - { - "token_address": "0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1", - "token_name": "Rocket Pool ETH", - "token_symbol": "rETH" - } - ] - }, - "strategyManager": { - "init_strategy_whitelister": "0x0000000000000000000000000000000000000000", - "init_paused_status": 0 - }, - "delegationManager": { - "init_paused_status": 0, - "init_minWithdrawalDelayBlocks": 50400 - }, - "avsDirectory": { - "init_paused_status": 0 - }, - "slasher": { - "init_paused_status": 0 - }, - "eigenPod": { - "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": 32000000000000000000, - "GENESIS_TIME": 1695902400 - }, - "eigenPodManager": { - "init_paused_status": 0, - "deneb_fork_timestamp": "1707305664" - }, - "delayedWithdrawalRouter": { - "init_paused_status": 0, - "init_withdrawalDelayBlocks": 50400 - }, - "ethPOSDepositAddress": "0x4242424242424242424242424242424242424242", - "beaconOracleAddress": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25" -} \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_addresses_preprod.config.json b/script/configs/holesky/eigenlayer_addresses_preprod.config.json deleted file mode 100644 index d5c111f0a..000000000 --- a/script/configs/holesky/eigenlayer_addresses_preprod.config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "lastUpdated": "v0.4.3-preprod-rewards-incentives", - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", - "delayedWithdrawalRouterImplementation": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7523b42b081C30fA245AA4039c645e36746fC400", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "numStrategiesDeployed": 0, - "strategies": {}, - "strategyAddresses": [], - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199", - "strategyFactory": "0xad4A89E3cA9b3dc25AABe0aa7d72E61D2Ec66052", - "strategyFactoryImplementation": "0x7a9478c0AcB819d7c235FbE2a6E13ee1D2fCD862", - "strategyFactoryBeacon": "0xf2c2AcA859C685895E60ca7A14274365b64c0c2a", - "strategyFactoryBeaconImplementation": "0xd648792F932FbabcCC80Cd376812074434412685", - "token": { - "EIGEN": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926", - "EIGENImpl": "0xdE80f6aE98DDD544d7e9442e656a2609EBAC7890", - "bEIGEN": "0xA72942289a043874249E60469F68f08B8c6ECCe8", - "bEIGENImpl": "0x3Ef8CcaD64043A57eeDEcC3900b819E6c80f5419", - "eigenStrategy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2", - "eigenStrategyImpl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B", - "tokenProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" - } - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1477016 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_addresses_testnet.config.json b/script/configs/holesky/eigenlayer_addresses_testnet.config.json deleted file mode 100644 index c9fc9cb7b..000000000 --- a/script/configs/holesky/eigenlayer_addresses_testnet.config.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "lastUpdated": "v0.4.3-rewards-incentives", - "addresses": { - "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", - "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", - "baseStrategyImplementation": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0x642c646053eaf2254f088e9019ACD73d9AE0FA32", - "delayedWithdrawalRouterImplementation": "0xcE8b8D99773a718423F8040a6e52c06a4ce63407", - "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - "delegationManagerImplementation": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", - "eigenLayerPauserReg": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", - "eigenLayerProxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", - "eigenPodBeacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", - "eigenPodImplementation": "0x10ad7e30e3F52076C8462D573530f4461377319c", - "eigenPodManager": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", - "eigenPodManagerImplementation": "0x91A6525a4a843F5a5B633905300c33F79413CCc5", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", - "rewardsCoordinatorImplementation": "0x1131D88143a35011E35263b43eC66cDd27025584", - "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", - "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", - "numStrategiesDeployed": 10, - "strategies": { - "WETH": "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", - "rETH": "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", - "stETH": "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", - "ETHx": "0x31B6F59e1627cEfC9fA174aD03859fC337666af7", - "cbETH": "0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6", - "sfrxETH": "0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c", - "lsETH": "0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943", - "osETH": "0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef", - "mETH": "0xaccc5A86732BE85b5012e8614AF237801636F8e5", - "ankrETH" :"0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac" - }, - "strategyAddresses": [ - "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", - "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", - "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", - "0x31B6F59e1627cEfC9fA174aD03859fC337666af7", - "0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6", - "0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c", - "0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943", - "0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef", - "0xaccc5A86732BE85b5012e8614AF237801636F8e5", - "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac" - ], - "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "strategyManagerImplementation": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18", - "strategyFactory": "0x9c01252B580efD11a05C00Aa42Dd3ac1Ec52DF6d", - "strategyFactoryImplementation": "0x5E699de7bFc4DD2A5E72EB5a2Ca99651EfdD51CB", - "strategyFactoryBeacon": "0xd3c6C6BA4E40dB9288c6a2077e5635344F8aFA4F", - "strategyFactoryBeaconImplementation": "0xb637caeedfCBf88e0d019E7AE4691b554c994A1e", - "token": { - "tokenProxyAdmin": "0x67482666771e82C9a73BB9e9A22B2B597f448BBf", - "EIGEN": "0x3B78576F7D6837500bA3De27A60c7f594934027E", - "bEIGEN": "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27", - "EIGENImpl": "0x01cbB2ae8eFE46EEdB9f7575D91cA1EB38823050", - "bEIGENImpl": "0x05adA1C66DdDD7c36705bC23a4d50dBa72E4E05c", - "eigenStrategy": "0x43252609bff8a13dFe5e057097f2f45A24387a84", - "eigenStrategyImpl": "0x94650e09a471CEF96e7966cabf26718FBf352697" - } - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1195642 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} - \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_preprod.config.json b/script/configs/holesky/eigenlayer_preprod.config.json deleted file mode 100644 index c3717424c..000000000 --- a/script/configs/holesky/eigenlayer_preprod.config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "lastUpdated": "v0.4.2-preprod-longtail", - "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": 120, - "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/configs/holesky/eigenlayer_testnet.config.json b/script/configs/holesky/eigenlayer_testnet.config.json deleted file mode 100644 index ddc6d2120..000000000 --- a/script/configs/holesky/eigenlayer_testnet.config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "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/configs/local/deploy_from_scratch.anvil.config.json b/script/configs/local/deploy_from_scratch.anvil.config.json index 96df127e1..81c6ef2c5 100644 --- a/script/configs/local/deploy_from_scratch.anvil.config.json +++ b/script/configs/local/deploy_from_scratch.anvil.config.json @@ -1,55 +1,55 @@ { - "maintainer": "samlaf@eigenlabs.org", - "multisig_addresses": { - "operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "pauserMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "timelock": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" - }, - "strategies": [ - { - "token_address": "0x0000000000000000000000000000000000000000", - "token_symbol": "WETH", - "max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935 - } - ], - "strategyManager": { - "init_paused_status": 0, - "init_withdrawal_delay_blocks": 1 - }, - "eigenPod": { - "PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS": 1, - "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": "32000000000" - }, - "eigenPodManager": { - "init_paused_status": 30 - }, - "delayedWithdrawalRouter": { - "init_paused_status": 0, - "init_withdrawal_delay_blocks": 1 - }, - "slasher": { - "init_paused_status": 0 - }, - "delegation": { - "init_paused_status": 0, - "init_withdrawal_delay_blocks": 1 - }, - "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, - "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, - "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 - }, - "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" -} \ No newline at end of file + "maintainer": "samlaf@eigenlabs.org", + "multisig_addresses": { + "operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pauserMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "timelock": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "strategies": [ + { + "token_address": "0x0000000000000000000000000000000000000000", + "token_symbol": "WETH", + "max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935 + } + ], + "strategyManager": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "eigenPod": { + "PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS": 1, + "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": "32000000000" + }, + "eigenPodManager": { + "init_paused_status": 30 + }, + "delayedWithdrawalRouter": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "slasher": { + "init_paused_status": 0 + }, + "delegation": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "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, + "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, + "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 + }, + "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" + } \ No newline at end of file diff --git a/script/configs/mainnet.json b/script/configs/mainnet.json new file mode 100644 index 000000000..3b42bc362 --- /dev/null +++ b/script/configs/mainnet.json @@ -0,0 +1,124 @@ +{ + "config": { + "environment": { + "chainid": 1, + "lastUpdated": "v0.4.2-mainnet-pepe", + "name": "mainnet" + }, + "params": { + "ethPOS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", + "EIGENPOD_GENESIS_TIME": 1606824023, + "CALCULATION_INTERVAL_SECONDS": 604800, + "MAX_REWARDS_DURATION": 6048000, + "MAX_RETROACTIVE_LENGTH": 14515200, + "MAX_FUTURE_LENGTH": 2592000, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "REWARDS_UPDATER_ADDRESS": "0x8f94F55fD8c9E090296283137C303fE97d32A9e2", + "ACTIVATION_DELAY": 604800, + "GLOBAL_OPERATOR_COMMISSION_BIPS": 1000 + } + }, + "deployment": { + "admin": { + "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", + "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", + "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", + "pauserRegistry": "0x0c431C66F4dE941d089625E5B423D00707977060", + "proxyAdmin": "0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444", + "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" + }, + "core": { + "avsDirectory": { + "proxy": "0x135dda560e946695d6f155dacafc6f1f25c1f5af", + "impl": "0xdabdb3cd346b7d5f5779b0b614ede1cc9dcba5b7", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "delegationManager": { + "proxy": "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", + "impl": "0x1784be6401339fc0fedf7e9379409f5c1bfe9dda", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "rewardsCoordinator": { + "proxy": "0x7750d328b314EfFa365A0402CcfD489B80B0adda", + "impl": "0x5bf7c13D5FAdba224ECB3D5C0a67A231D1628785", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "slasher": { + "proxy": "0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd", + "impl": "0xf3234220163a757edf1e11a8a085638d9b236614", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyManager": { + "proxy": "0x858646372CC42E1A627fcE94aa7A7033e7CF075A", + "impl": "0x70f44c13944d49a236e3cd7a94f48f5dab6c619b", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "pods": { + "delayedWithdrawalRouter": { + "proxy": "0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8", + "impl": "0x4bb6731b02314d40abbffbc4540f508874014226", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPod": { + "beacon": "0x5a2a4F2F3C18f09179B6703e63D9eDD165909073", + "impl": "0x6D225e974Fa404D25Ffb84eD6E242Ffa18eF6430", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPodManager": { + "proxy": "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338", + "impl": "0x731A0aD160e407393Ff662231Add6Dd145AD3FEa", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "strategies": { + "strategyFactory": { + "proxy": "0x5e4C39Ad7A3E881585e383dB9827EB4811f6F647", + "impl": "0x3e07cc2D34C8E0965f5BA45Ac1E960e535155c74", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyBeacon": { + "beacon": "0x0ed6703C298d28aE0878d1b28e88cA87F9662fE9", + "impl": "0xe9FA8F904d97854C7389b68923262ADCC6C27827", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "preLongtailStrats": { + "impl": "0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3", + "addrs": [ + "0x93c4b944D05dfe6df7645A86cd2206016c51564D", + "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", + "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", + "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", + "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", + "0xa4C637e0F704745D182e4D38cAb7E7485321d059", + "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", + "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", + "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", + "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", + "0xAe60d8180437b5C34bB956822ac2710972584473", + "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" + ] + } + }, + "token": { + "bEIGEN": { + "proxy": "0x83E9115d334D248Ce39a6f36144aEaB5b3456e75", + "impl": "0xB91c69Af3eE022bd0a59Da082945914BFDcEFFE3", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9" + }, + "EIGEN": { + "proxy": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83", + "impl": "0x7ec354c84680112d3cff1544ec1eb19ca583700b", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0xB8915E195121f2B5D989Ec5727fd47a5259F1CEC" + }, + "eigenStrategy": { + "proxy": "0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7", + "impl": "0x27e7a3a81741b9fcc5ad7edcbf9f8a72a5c00428", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + } + } +} \ No newline at end of file diff --git a/script/configs/mainnet/Mainnet_current_eigenPods.config.json b/script/configs/mainnet/Mainnet_current_eigenPods.config.json deleted file mode 100644 index 73f8dfb28..000000000 --- a/script/configs/mainnet/Mainnet_current_eigenPods.config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "chainInfo": { - "chainId": 1, - "deploymentBlock": 19285000 - }, - "eigenPods": { - "multiValidators": [ - "0x2641c2ded63a0c640629f5edf1189e0f53c06561", - "0xa345dcb63f984ed1c6d1a8901e0cdbd13b2b4d19", - "0x7fb3d3801883341a02ddd1beb2e624a278e87930", - "0x2f5cb052d397d0b628299a9d4cfc49a5019c4170", - "0xdb678e1056acd7db74507b921a6295c3d586ece9" - ], - "singleValidators": [ - "0xc149531419db43b8cc0d4f2f2ce1700ae46f4c8a", - "0x61340dcc5aef625ded27f21e5068916ad334dad0", - "0x722e2350a55e6b617e66983b4b91d47fe9e9403e", - "0x49213606dc1953eae3b733187fed9e7307edd55b", - "0xa8fc63e72288b79009f7b5952760114513efc700" - ], - "inActive": [ - "0xcbb42f0d320056453c497867119814c59615daeb", - "0xd6e50e7f6250ca26d5d5033138ad09cfe2aaeacb", - "0xe18c1447804563af9647cf8c879f35ced8172c1f", - "0x38de067514c77fed61630bb77ecc24f2adb73ff4", - "0xc3f9bbd74ded6b2bc2ff8b5c693fcbabf2e24efd" - ], - "allEigenPods": [ - "0x2641c2ded63a0c640629f5edf1189e0f53c06561", - "0xa345dcb63f984ed1c6d1a8901e0cdbd13b2b4d19", - "0x7fb3d3801883341a02ddd1beb2e624a278e87930", - "0x2f5cb052d397d0b628299a9d4cfc49a5019c4170", - "0xdb678e1056acd7db74507b921a6295c3d586ece9", - "0xc149531419db43b8cc0d4f2f2ce1700ae46f4c8a", - "0x61340dcc5aef625ded27f21e5068916ad334dad0", - "0x722e2350a55e6b617e66983b4b91d47fe9e9403e", - "0x49213606dc1953eae3b733187fed9e7307edd55b", - "0xa8fc63e72288b79009f7b5952760114513efc700", - "0xcbb42f0d320056453c497867119814c59615daeb", - "0xd6e50e7f6250ca26d5d5033138ad09cfe2aaeacb", - "0xe18c1447804563af9647cf8c879f35ced8172c1f", - "0x38de067514c77fed61630bb77ecc24f2adb73ff4", - "0xc3f9bbd74ded6b2bc2ff8b5c693fcbabf2e24efd" - ] - } -} diff --git a/script/configs/mainnet/mainnet-config.config.json b/script/configs/mainnet/mainnet-config.config.json deleted file mode 100644 index f646ad7e6..000000000 --- a/script/configs/mainnet/mainnet-config.config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "lastUpdated": "v0.4.2-mainnet-pepe", - "chainInfo": { - "chainId": 1 - }, - "multisig_addresses": { - "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", - "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", - "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", - "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", - "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" - }, - "strategies": { - "numStrategies": 0, - "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, - "strategiesToDeploy": [] - }, - "strategyManager": { - "init_strategy_whitelister": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", - "init_paused_status": 0 - }, - "delegationManager": { - "init_paused_status": 0, - "init_minWithdrawalDelayBlocks": 50400 - }, - "avsDirectory": { - "init_paused_status": 0 - }, - "slasher": { - "init_paused_status": 115792089237316195423570985008687907853269984665640564039457584007913129639935 - }, - "eigenPod": { - "GENESIS_TIME": 1606824023 - }, - "eigenPodManager": { - "init_paused_status": 0 - }, - "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa", - "rewardsCoordinator": { - "init_paused_status": 0, - "CALCULATION_INTERVAL_SECONDS": 604800, - "MAX_REWARDS_DURATION": 6048000, - "MAX_RETROACTIVE_LENGTH": 14515200, - "MAX_FUTURE_LENGTH": 2592000, - "GENESIS_REWARDS_TIMESTAMP": 1710979200, - "rewards_updater_address": "0x8f94F55fD8c9E090296283137C303fE97d32A9e2", - "activation_delay": 604800, - "global_operator_commission_bips": 1000 - } - } \ No newline at end of file diff --git a/script/configs/preprod.json b/script/configs/preprod.json new file mode 100644 index 000000000..877caa40a --- /dev/null +++ b/script/configs/preprod.json @@ -0,0 +1,126 @@ +{ + "config": { + "environment": { + "chainid": 17000, + "lastUpdated": "v0.4.2-mainnet-pepe", + "name": "preprod-holesky" + }, + "params": { + "ACTIVATION_DELAY": 7200, + "CALCULATION_INTERVAL_SECONDS": 604800, + "EIGENPOD_GENESIS_TIME": 1695902400, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "GLOBAL_OPERATOR_COMMISSION_BIPS": 1000, + "MAX_FUTURE_LENGTH": 2592000, + "MAX_RETROACTIVE_LENGTH": 7776000, + "MAX_REWARDS_DURATION": 6048000, + "REWARDS_UPDATER_ADDRESS": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", + "ethPOS": "0x4242424242424242424242424242424242424242", + "multiSendCallOnly": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D" + } + }, + "deployment": { + "admin": { + "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserRegistry": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", + "timelock": "0x0000000000000000000000000000000000000000" + }, + "core": { + "avsDirectory": { + "proxy": "0x141d6995556135D4997b2ff72EB443Be300353bC", + "impl": "0x357978adC03375BD6a3605DE055fABb84695d79A", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "delegationManager": { + "proxy": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", + "impl": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "rewardsCoordinator": { + "proxy": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", + "impl": "0x7523b42b081C30fA245AA4039c645e36746fC400", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "slasher": { + "proxy": "0x12699471dF8dca329C76D72823B1b79d55709384", + "impl": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyManager": { + "proxy": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", + "impl": "0x1a26B23a004C512350d7Dd89056655A80b850199", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "pods": { + "delayedWithdrawalRouter": { + "proxy": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", + "impl": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPod": { + "beacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", + "impl": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPodManager": { + "proxy": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", + "impl": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + }, + "strategies": { + "strategyFactory": { + "proxy": "0xad4A89E3cA9b3dc25AABe0aa7d72E61D2Ec66052", + "impl": "0x7a9478c0AcB819d7c235FbE2a6E13ee1D2fCD862", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyBeacon": { + "beacon": "0xf2c2AcA859C685895E60ca7A14274365b64c0c2a", + "impl": "0xd648792F932FbabcCC80Cd376812074434412685", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "preLongtailStrats": { + "impl": "0x62450517EfA1CE60d79801daf8f95973865e8D40", + "addrs": [ + "0x6e5d5060b33ca2090a78e9cb74fe207453b30e49", + "0xf6a09ae03d7760aecf1626ce7df0f113bec2d9bd", + "0x7fa77c321bf66e42eabc9b10129304f7f90c5585", + "0x24da526f9e465c4fb6bae41e226df8aa5b34eac7", + "0x6dc6ce589f852f96ac86cb160ab0b15b9f56dedd", + "0x3c28437e610fb099cc3d6de4d9c707dfacd308ae", + "0x7b6257f5caf7311b36f7416133a8499c68a83c3a", + "0xc86382179500e8ed3e686fc4a99ed9ec72df3f56", + "0x3cb1fd19cfb178c1098f2fc1e11090a0642b2314", + "0x87f6c7d24b109919eb38295e3f8298425e6331d9", + "0x5c8b55722f421556a2aafb7a3ea63d4c3e514312", + "0xd523267698c81a372191136e477fdebfa33d9fb4", + "0xdccf401fd121d8c542e96bc1d0078884422afad2" + ] + } + }, + "token": { + "bEIGEN": { + "proxy": "0xA72942289a043874249E60469F68f08B8c6ECCe8", + "impl": "0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" + }, + "EIGEN": { + "proxy": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926", + "impl": "0x95a7431400F362F3647a69535C5666cA0133CAA0", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" + }, + "eigenStrategy": { + "proxy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2", + "impl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B", + "pendingImpl": "0x0000000000000000000000000000000000000000" + } + } + } +} \ No newline at end of file diff --git a/script/configs/zipzoop.json b/script/configs/zipzoop.json new file mode 100644 index 000000000..cb1a019d1 --- /dev/null +++ b/script/configs/zipzoop.json @@ -0,0 +1,126 @@ +{ + "config": { + "environment": { + "chainid": 31337, + "lastUpdated": "v0.4.2-mainnet-pepe", + "name": "zipzoop-tester" + }, + "params": { + "ACTIVATION_DELAY": 7200, + "CALCULATION_INTERVAL_SECONDS": 604800, + "EIGENPOD_GENESIS_TIME": 1695902400, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "GLOBAL_OPERATOR_COMMISSION_BIPS": 1000, + "MAX_FUTURE_LENGTH": 2592000, + "MAX_RETROACTIVE_LENGTH": 7776000, + "MAX_REWARDS_DURATION": 6048000, + "REWARDS_UPDATER_ADDRESS": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", + "ethPOS": "0x4242424242424242424242424242424242424242", + "multiSendCallOnly": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D" + } + }, + "deployment": { + "admin": { + "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserRegistry": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", + "timelock": "0x0000000000000000000000000000000000000000" + }, + "core": { + "avsDirectory": { + "impl": "0x357978adC03375BD6a3605DE055fABb84695d79A", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0x141d6995556135D4997b2ff72EB443Be300353bC" + }, + "delegationManager": { + "impl": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC" + }, + "rewardsCoordinator": { + "impl": "0x7523b42b081C30fA245AA4039c645e36746fC400", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0" + }, + "slasher": { + "impl": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0x12699471dF8dca329C76D72823B1b79d55709384" + }, + "strategyManager": { + "impl": "0x1a26B23a004C512350d7Dd89056655A80b850199", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a" + } + }, + "pods": { + "delayedWithdrawalRouter": { + "impl": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa" + }, + "eigenPod": { + "beacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", + "impl": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "eigenPodManager": { + "impl": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xB8d8952f572e67B11e43bC21250967772fa883Ff" + } + }, + "strategies": { + "preLongtailStrats": { + "addrs": [ + "0x6E5D5060B33ca2090A78E9cb74Fe207453b30E49", + "0xf6a09ae03D7760aEcf1626Ce7Df0F113BEC2d9bD", + "0x7fA77c321bf66e42eaBC9b10129304F7f90c5585", + "0x24DA526F9e465c4fb6BAe41E226Df8aA5b34eAc7", + "0x6dC6cE589F852F96ac86cB160AB0B15b9f56DeDd", + "0x3c28437E610fB099Cc3d6De4D9c707DFACD308AE", + "0x7b6257F5caf7311b36F7416133A8499c68a83c3a", + "0xC86382179500e8Ed3e686fC4A99eD9EC72df3f56", + "0x3cb1fD19CFb178C1098f2fc1e11090A0642B2314", + "0x87f6C7d24b109919eB38295e3F8298425e6331D9", + "0x5C8b55722f421556a2AAfb7A3EA63d4c3e514312", + "0xD523267698C81a372191136e477fdebFa33D9FB4", + "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2" + ], + "impl": "0x62450517EfA1CE60d79801daf8f95973865e8D40" + }, + "strategyBeacon": { + "beacon": "0xf2c2AcA859C685895E60ca7A14274365b64c0c2a", + "impl": "0xd648792F932FbabcCC80Cd376812074434412685", + "pendingImpl": "0x0000000000000000000000000000000000000000" + }, + "strategyFactory": { + "impl": "0x7a9478c0AcB819d7c235FbE2a6E13ee1D2fCD862", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xad4A89E3cA9b3dc25AABe0aa7d72E61D2Ec66052" + } + }, + "token": { + "EIGEN": { + "impl": "0x95a7431400F362F3647a69535C5666cA0133CAA0", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" + }, + "bEIGEN": { + "impl": "0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xA72942289a043874249E60469F68f08B8c6ECCe8", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" + }, + "eigenStrategy": { + "impl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B", + "pendingImpl": "0x0000000000000000000000000000000000000000", + "proxy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2" + } + } + } +} \ 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 deleted file mode 100644 index c395c2f5f..000000000 --- a/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "./Deploy_Test_RewardsCoordinator.s.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * anvil --fork-url $RPC_HOLESKY - * Local Fork: Deploy/Upgrade RewardsCoordinator - * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" deploy - * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" upgrade - * - * Holesky testnet: Deploy/Upgrade RewardsCoordinator - * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" deploy - * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" upgrade - * - */ -contract Deploy_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator { - function run(string memory deployArg) external virtual { - _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_preprod.config.json"); - _parseDeployedContracts("script/output/holesky/M2_deploy_preprod.output.json"); - - // Overwrite testAddress and multisigs to be EOAowner - testAddress = msg.sender; - executorMultisig = testAddress; - operationsMultisig = testAddress; - pauserMultisig = testAddress; - communityMultisig = testAddress; - STRATEGY_MANAGER_WHITELISTER = testAddress; - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - if (keccak256(abi.encode(deployArg)) == keccak256(abi.encode("upgrade"))) { - _upgradeRewardsCoordinator(); - } else if (keccak256(abi.encode(deployArg)) == keccak256(abi.encode("deploy"))) { - _deployRewardsCoordinator(); - } - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json"); - } -} diff --git a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol deleted file mode 100644 index 11bb5f61c..000000000 --- a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol +++ /dev/null @@ -1,129 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * anvil --fork-url $RPC_HOLESKY - * forge script script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv - * - */ -contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser { - - address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - - function run() external virtual { - _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); - _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses.config.json"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployImplementation(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json"); - } - - /** - * @notice Deploy RewardsCoordinator for Holesky - */ - function _deployRewardsCoordinator() internal { - // Deploy RewardsCoordinator proxy and implementation - 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 - ); - rewardsCoordinator = RewardsCoordinator( - address( - new TransparentUpgradeableProxy( - address(rewardsCoordinatorImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - RewardsCoordinator.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - REWARDS_COORDINATOR_INIT_PAUSED_STATUS, - REWARDS_COORDINATOR_UPDATER, - REWARDS_COORDINATOR_ACTIVATION_DELAY, - REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS - ) - ) - ) - ); - } - - /** - * @notice Deploy RewardsCoordinator Implementation for Holesky and upgrade the proxy - */ - function _upgradeRewardsCoordinator() internal { - // Deploy RewardsCoordinator proxy and implementation - 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 - ); - - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), - address(rewardsCoordinatorImplementation) - ); - } - - function _deployImplementation() internal { - // Existing values for current RewardsCoordinator implementationt on holesky - require( - REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS == 604800, - "REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS must be 604800" - ); - require( - REWARDS_COORDINATOR_MAX_REWARDS_DURATION == 6048000, - "REWARDS_COORDINATOR_MAX_REWARDS_DURATION must be 6048000" - ); - require( - REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH == 7776000, - "REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH must be 7776000" - ); - require( - REWARDS_COORDINATOR_MAX_FUTURE_LENGTH == 2592000, - "REWARDS_COORDINATOR_MAX_FUTURE_LENGTH must be 2592000" - ); - require( - REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP == 1710979200, - "REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP must be 1710979200" - ); - - // Deploy RewardsCoordinator implementation - 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 - ); - } -} diff --git a/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol b/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol deleted file mode 100644 index 233f158bb..000000000 --- a/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * @notice Script used for the first deployment of Eigen token strategy contracts on Holesky - * forge script script/deploy/holesky/Eigen_Strategy_Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/Eigen_Strategy_Deploy.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv - */ -contract Eigen_Strategy_Deploy is ExistingDeploymentParser { - - function run() external virtual { - _parseDeployedContracts("script/configs/holesky/Holesky_current_deployment.config.json"); - - vm.startBroadcast(); - - _deployStrategy(); - - _setTransferRestrictions(); - - vm.stopBroadcast(); - - _verifyDeployment(); - - emit log_string("====Deployed Contracts===="); - - emit log_named_address("EigenStrategy", address(eigenStrategy)); - emit log_named_address("EigenStrategyImpl", address(eigenStrategyImpl)); - } - - function _deployStrategy() internal { - eigenStrategyImpl = new EigenStrategy(strategyManager); - - eigenStrategy = EigenStrategy( - address( - new TransparentUpgradeableProxy( - address(eigenStrategyImpl), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - EigenStrategy.initialize.selector, - EIGEN, - bEIGEN, - eigenLayerPauserReg - ) - ) - ) - ); - } - - function _setTransferRestrictions() internal { - EIGEN.setAllowedFrom(address(eigenStrategy), true); - EIGEN.setAllowedTo(address(eigenStrategy), true); - bEIGEN.setAllowedFrom(address(eigenStrategy), true); - bEIGEN.setAllowedTo(address(eigenStrategy), true); - } - - function _verifyDeployment() internal { - IStrategy[] memory strategies = new IStrategy[](1); - strategies[0] = eigenStrategy; - bool[] memory thirdPartyTransfersForbiddenValues = new bool[](1); - thirdPartyTransfersForbiddenValues[0] = true; - - vm.prank(executorMultisig); - strategyManager.addStrategiesToDepositWhitelist(strategies, thirdPartyTransfersForbiddenValues); - - vm.startPrank(msg.sender); - EIGEN.approve(address(strategyManager), type(uint256).max); - strategyManager.depositIntoStrategy(eigenStrategy, EIGEN, 1 ether); - } -} diff --git a/script/deploy/holesky/Eigen_Token_Deploy.s.sol b/script/deploy/holesky/Eigen_Token_Deploy.s.sol deleted file mode 100644 index bd130a034..000000000 --- a/script/deploy/holesky/Eigen_Token_Deploy.s.sol +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "../../../src/contracts/token/Eigen.sol"; -import "../../../src/contracts/token/BackingEigen.sol"; -import "../../../src/test/mocks/EmptyContract.sol"; - -import "forge-std/Script.sol"; -import "forge-std/Test.sol"; - -/** - * @notice Script used for the first deployment of Eigen token on Holesky - * forge script script/deploy/holesky/Eigen_Token_Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/Eigen_Token_Deploy.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv - */ -contract Eigen_Token_Deploy is Script, Test { - address operationsMultisig = 0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d; - EmptyContract public emptyContract = EmptyContract(0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2); - - ProxyAdmin public tokenProxyAdmin; - Eigen public EIGENImpl; - Eigen public EIGEN; - BackingEigen public bEIGENImpl; - BackingEigen public bEIGEN; - - uint256 constant TOTAL_SUPPLY = 1673646668284660000000000000; - - function run() external virtual { - vm.startBroadcast(); - - _deployToken(); - - vm.stopBroadcast(); - - _verifyDeployment(); - - emit log_string("====Deployed Contracts===="); - - emit log_named_address("ProxyAdmin", address(tokenProxyAdmin)); - emit log_named_address("EIGEN", address(EIGEN)); - emit log_named_address("bEIGEN", address(bEIGEN)); - emit log_named_address("EIGENImpl", address(EIGENImpl)); - emit log_named_address("bEIGENImpl", address(bEIGENImpl)); - } - - function _deployToken() internal { - // Deploy ProxyAdmin, later set admins for all proxies to be executorMultisig - tokenProxyAdmin = new ProxyAdmin(); - - EIGEN = Eigen( - address(new TransparentUpgradeableProxy(address(emptyContract), address(tokenProxyAdmin), "")) - ); - - bEIGEN = BackingEigen( - address(new TransparentUpgradeableProxy(address(emptyContract), address(tokenProxyAdmin), "")) - ); - - // deploy impls - EIGENImpl = new Eigen(IERC20(address(bEIGEN))); - bEIGENImpl = new BackingEigen(IERC20(address(EIGEN))); - - address[] memory minters = new address[](1); - minters[0] = msg.sender; - - uint256[] memory mintingAllowances = new uint256[](1); - mintingAllowances[0] = TOTAL_SUPPLY; - - uint256[] memory mintAllowedAfters = new uint256[](1); - - // upgrade and initialize proxies - tokenProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(EIGEN))), - address(EIGENImpl), - abi.encodeWithSelector( - Eigen.initialize.selector, - msg.sender, - minters, - mintingAllowances, - mintAllowedAfters - ) - ); - - EIGEN.mint(); - - tokenProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(bEIGEN))), - address(bEIGENImpl), - abi.encodeWithSelector( - BackingEigen.initialize.selector, - msg.sender - ) - ); - - tokenProxyAdmin.transferOwnership(operationsMultisig); - } - - function _verifyDeployment() internal view { - require(EIGEN.totalSupply() == TOTAL_SUPPLY, "Eigen_Token_Deploy: total supply mismatch"); - require(bEIGEN.totalSupply() == TOTAL_SUPPLY, "Eigen_Token_Deploy: total supply mismatch"); - - require(bEIGEN.balanceOf(address(EIGEN)) == TOTAL_SUPPLY, "Eigen_Token_Deploy: bEIGEN balance mismatch"); - require(EIGEN.balanceOf(msg.sender) == TOTAL_SUPPLY, "Eigen_Token_Deploy: EIGEN balance mismatch"); - - require(EIGEN.owner() == msg.sender, "Eigen_Token_Deploy: EIGEN owner mismatch"); - require(bEIGEN.owner() == msg.sender, "Eigen_Token_Deploy: bEIGEN owner mismatch"); - - require(tokenProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(EIGEN)))) == address(EIGENImpl), "Eigen_Token_Deploy: EIGEN implementation mismatch"); - require(tokenProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(bEIGEN)))) == address(bEIGENImpl), "Eigen_Token_Deploy: bEIGEN implementation mismatch"); - - require(tokenProxyAdmin.owner() == operationsMultisig, "Eigen_Token_Deploy: ProxyAdmin owner mismatch"); - } -} diff --git a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol deleted file mode 100644 index c495cf650..000000000 --- a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol +++ /dev/null @@ -1,195 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * forge script script/deploy/holesky/M2_Deploy_From_Scratch.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/M2_Deploy_From_Scratch.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv - * - */ -contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { - function run() external virtual { - _parseInitialDeploymentParams("script/configs/holesky/M2_deploy_from_scratch.holesky.config.json"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployFromScratch(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/holesky/M2_deploy_from_scratch.holesky.config.json"); - } - - /** - * @notice Deploy EigenLayer contracts from scratch for Holesky - */ - function _deployFromScratch() internal { - // Deploy ProxyAdmin, later set admins for all proxies to be executorMultisig - eigenLayerProxyAdmin = new ProxyAdmin(); - - // Set multisigs as pausers, executorMultisig as unpauser - address[] memory pausers = new address[](3); - pausers[0] = executorMultisig; - pausers[1] = operationsMultisig; - pausers[2] = pauserMultisig; - address unpauser = executorMultisig; - eigenLayerPauserReg = new PauserRegistry(pausers, unpauser); - - /** - * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are - * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code. - */ - emptyContract = new EmptyContract(); - avsDirectory = AVSDirectory( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - delegationManager = DelegationManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - strategyManager = StrategyManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - slasher = Slasher( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - eigenPodManager = EigenPodManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - // Deploy EigenPod Contracts - eigenPodImplementation = new EigenPod( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodManager, - EIGENPOD_GENESIS_TIME - ); - - eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); - avsDirectoryImplementation = new AVSDirectory(delegationManager); - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); - slasherImplementation = new Slasher(strategyManager, delegationManager); - eigenPodManagerImplementation = new EigenPodManager( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodBeacon, - strategyManager, - slasher, - delegationManager - ); - - // Third, upgrade the proxy contracts to point to the implementations - IStrategy[] memory initializeStrategiesToSetDelayBlocks = new IStrategy[](0); - uint256[] memory initializeWithdrawalDelayBlocks = new uint256[](0); - // AVSDirectory - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(avsDirectory))), - address(avsDirectoryImplementation), - abi.encodeWithSelector( - AVSDirectory.initialize.selector, - executorMultisig, // initialOwner - eigenLayerPauserReg, - AVS_DIRECTORY_INIT_PAUSED_STATUS - ) - ); - // DelegationManager - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(delegationManager))), - address(delegationManagerImplementation), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - executorMultisig, // initialOwner - eigenLayerPauserReg, - DELEGATION_MANAGER_INIT_PAUSED_STATUS, - DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS, - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ) - ); - // StrategyManager - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation), - abi.encodeWithSelector( - StrategyManager.initialize.selector, - msg.sender, //initialOwner, set to executorMultisig later after whitelisting strategies - msg.sender, //initial whitelister, set to STRATEGY_MANAGER_WHITELISTER later - eigenLayerPauserReg, - STRATEGY_MANAGER_INIT_PAUSED_STATUS - ) - ); - // Slasher - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation), - abi.encodeWithSelector( - Slasher.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - SLASHER_INIT_PAUSED_STATUS - ) - ); - // EigenPodManager - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation), - abi.encodeWithSelector( - EigenPodManager.initialize.selector, - msg.sender, // initialOwner is msg.sender for now to set forktimestamp later - eigenLayerPauserReg, - EIGENPOD_MANAGER_INIT_PAUSED_STATUS - ) - ); - - // Deploy Strategies - baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); - uint256 numStrategiesToDeploy = strategiesToDeploy.length; - // whitelist params - IStrategy[] memory strategiesToWhitelist = new IStrategy[](numStrategiesToDeploy); - bool[] memory thirdPartyTransfersForbiddenValues = new bool[](numStrategiesToDeploy); - - for (uint256 i = 0; i < numStrategiesToDeploy; i++) { - StrategyUnderlyingTokenConfig memory strategyConfig = strategiesToDeploy[i]; - - // Deploy and upgrade strategy - StrategyBaseTVLLimits strategy = StrategyBaseTVLLimits( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategy))), - address(baseStrategyImplementation), - abi.encodeWithSelector( - StrategyBaseTVLLimits.initialize.selector, - STRATEGY_MAX_PER_DEPOSIT, - STRATEGY_MAX_TOTAL_DEPOSITS, - IERC20(strategyConfig.tokenAddress), - eigenLayerPauserReg - ) - ); - - strategiesToWhitelist[i] = strategy; - thirdPartyTransfersForbiddenValues[i] = false; - - deployedStrategyArray.push(strategy); - } - - // Add strategies to whitelist and set whitelister to STRATEGY_MANAGER_WHITELISTER - strategyManager.addStrategiesToDepositWhitelist(strategiesToWhitelist, thirdPartyTransfersForbiddenValues); - strategyManager.setStrategyWhitelister(STRATEGY_MANAGER_WHITELISTER); - - // Transfer ownership - strategyManager.transferOwnership(executorMultisig); - eigenLayerProxyAdmin.transferOwnership(executorMultisig); - eigenPodManager.transferOwnership(executorMultisig); - eigenPodBeacon.transferOwnership(executorMultisig); - } -} diff --git a/script/deploy/holesky/M2_Deploy_Preprod.s.sol b/script/deploy/holesky/M2_Deploy_Preprod.s.sol deleted file mode 100644 index f5c0562f9..000000000 --- a/script/deploy/holesky/M2_Deploy_Preprod.s.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "./M2_Deploy_From_Scratch.s.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * forge script script/deploy/holesky/M2_Deploy_Preprod.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/M2_Deploy_Preprod.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv - * - * Script for dev environment, exact same as M2_Deploy_From_Scratch.s.sol but with an EOAowner - * instead of multisig addresses for permissions. - * Unused config fields: - * - init_strategy_whitelister - * - multisig_addresses(operations, pauser, executor, community) - */ -contract M2_Deploy_Holesky_Preprod is M2_Deploy_Holesky_From_Scratch { - /// @dev EOAowner is the deployer and owner of the contracts - address EOAowner; - - function run() external virtual override { - _parseInitialDeploymentParams("script/configs/holesky/M2_deploy_preprod.holesky.config.json"); - - // Overwrite multisig to be EOAowner - EOAowner = msg.sender; - executorMultisig = EOAowner; - operationsMultisig = EOAowner; - pauserMultisig = EOAowner; - communityMultisig = EOAowner; - STRATEGY_MANAGER_WHITELISTER = EOAowner; - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer and EOAowner Address", EOAowner); - - _deployFromScratch(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); // override to check contract.owner() is EOAowner instead - - logAndOutputContractAddresses("script/output/holesky/M2_deploy_preprod.holesky.config.json"); - } -} diff --git a/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol b/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol deleted file mode 100644 index bd454b90b..000000000 --- a/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts/governance/TimelockController.sol"; - -import "forge-std/Script.sol"; -import "forge-std/Test.sol"; - -import "../../../src/contracts/token/BackingEigen.sol"; -import "../../../src/contracts/token/Eigen.sol"; - -// forge script script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY -contract Preprod_Upgrade_bEIGEN_and_EIGEN is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - BackingEigen public bEIGEN_proxy = BackingEigen(0xA72942289a043874249E60469F68f08B8c6ECCe8); - BackingEigen public bEIGEN_implementation; - Eigen public EIGEN_proxy = Eigen(0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926); - Eigen public EIGEN_implementation; - ProxyAdmin public EIGEN_ProxyAdmin = ProxyAdmin(0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B); - address public proxyAdminOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - - IERC20 public bEIGEN_addressBefore; - IERC20 public EIGEN_addressBefore; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId != 17000) { - revert("Chain not supported"); - } - - bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); - require(bEIGEN_addressBefore == IERC20(0xA72942289a043874249E60469F68f08B8c6ECCe8), - "something horribly wrong"); - - EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); - require(EIGEN_addressBefore == IERC20(0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926), - "something horribly wrong"); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implmementation contracts - EIGEN_implementation = new Eigen({ - _bEIGEN: bEIGEN_addressBefore - }); - bEIGEN_implementation = new BackingEigen({ - _EIGEN: EIGEN_addressBefore - }); - - vm.stopBroadcast(); - - emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); - emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); - - // Perform upgrade - vm.startBroadcast(); - EIGEN_ProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), - address(bEIGEN_implementation) - ); - EIGEN_ProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(EIGEN_proxy))), - address(EIGEN_implementation) - ); - vm.stopBroadcast(); - - // Perform post-upgrade tests - checkUpgradeCorrectness(); - simulateWrapAndUnwrap(); - } - - function checkUpgradeCorrectness() public { - cheats.startPrank(address(proxyAdminOwner)); - require(EIGEN_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), - "implementation set incorrectly"); - require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, - "bEIGEN address changed unexpectedly"); - require(EIGEN_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), - "implementation set incorrectly"); - require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, - "EIGEN address changed unexpectedly"); - cheats.stopPrank(); - } - - function simulateWrapAndUnwrap() public { - uint256 amount = 1e18; - cheats.prank(address(EIGEN_proxy)); - bEIGEN_proxy.transfer(address(this), amount); - - bEIGEN_proxy.approve(address(EIGEN_proxy), amount); - uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.wrap(amount); - uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.unwrap(amount); - uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); - - require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); - require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); - - require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); - require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); - } -} diff --git a/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol b/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol deleted file mode 100644 index 516bdebf7..000000000 --- a/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts/governance/TimelockController.sol"; - -import "../../../src/contracts/token/BackingEigen.sol"; -import "../../../src/contracts/token/Eigen.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/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol:bEIGEN_and_EIGEN_upgrade -vvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -contract bEIGEN_and_EIGEN_upgrade is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - BackingEigen public bEIGEN_proxy = BackingEigen(0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27); - BackingEigen public bEIGEN_implementation; - Eigen public EIGEN_proxy = Eigen(0x3B78576F7D6837500bA3De27A60c7f594934027E); - Eigen public EIGEN_implementation; - ProxyAdmin public token_ProxyAdmin = ProxyAdmin(0x67482666771e82C9a73BB9e9A22B2B597f448BBf); - address public opsMultisig = 0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d; - - IERC20 public bEIGEN_addressBefore; - IERC20 public EIGEN_addressBefore; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId != 17000) { - revert("Chain not supported"); - } - - bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); - EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); - - require(bEIGEN_addressBefore == IERC20(0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27), - "something horribly wrong"); - require(EIGEN_addressBefore == IERC20(0x3B78576F7D6837500bA3De27A60c7f594934027E), - "something horribly wrong"); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implementation contracts - EIGEN_implementation = new Eigen({ - _bEIGEN: bEIGEN_addressBefore - }); - bEIGEN_implementation = new BackingEigen({ - _EIGEN: EIGEN_addressBefore - }); - vm.stopBroadcast(); - - emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); - emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); - - // Perform post-upgrade tests - simulatePerformingUpgrade(); - checkUpgradeCorrectness(); - simulateWrapAndUnwrap(); - } - - function simulatePerformingUpgrade() public { - cheats.startPrank(opsMultisig); - // Upgrade contracts - token_ProxyAdmin.upgrade(TransparentUpgradeableProxy(payable(address(EIGEN_proxy))), address(EIGEN_implementation)); - token_ProxyAdmin.upgrade(TransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), address(bEIGEN_implementation)); - cheats.stopPrank(); - } - - function checkUpgradeCorrectness() public { - vm.startPrank(opsMultisig); - require(token_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), - "implementation set incorrectly"); - require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, - "bEIGEN address changed unexpectedly"); - require(token_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), - "implementation set incorrectly"); - require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, - "EIGEN address changed unexpectedly"); - cheats.stopPrank(); - } - - function simulateWrapAndUnwrap() public { - uint256 amount = 1e18; - cheats.prank(address(EIGEN_proxy)); - bEIGEN_proxy.transfer(address(this), amount); - - bEIGEN_proxy.approve(address(EIGEN_proxy), amount); - uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.wrap(amount); - uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.unwrap(amount); - uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); - - require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); - require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); - - require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); - require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); - } -} \ No newline at end of file diff --git a/script/deploy/holesky/longtail-preprod-upgrade.s.sol b/script/deploy/holesky/longtail-preprod-upgrade.s.sol deleted file mode 100644 index 2a9b7b9cf..000000000 --- a/script/deploy/holesky/longtail-preprod-upgrade.s.sol +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * anvil --fork-url $RPC_HOLESKY - * forge script script/deploy/holesky/longtail-preprod-upgrade.s.sol:Longtail_Upgrade_Preprod --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/longtail-preprod-upgrade.s.sol:Longtail_Upgrade_Preprod --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv - */ -contract Longtail_Upgrade_Preprod is ExistingDeploymentParser { - - address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - - function run() external virtual { - _parseInitialDeploymentParams( - "script/configs/holesky/eigenlayer_preprod.config.json" - ); - _parseDeployedContracts( - "script/configs/holesky/eigenlayer_addresses_preprod.config.json" - ); - - emit log_named_address("Deployer Address", msg.sender); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - _deployLongtail(); - _upgradeLongtail(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - _sanityChecks(); - - logAndOutputContractAddresses("script/output/holesky/longtail-preprod.output.json"); - } - - function _deployLongtail() internal { - // Deploy implementations - strategyFactoryImplementation = new StrategyFactory(strategyManager); - strategyFactoryBeaconImplementation = new StrategyBase(strategyManager); - - // Deploy and initialize proxies - strategyBeacon = new UpgradeableBeacon(address(strategyFactoryBeaconImplementation)); - strategyFactory = StrategyFactory(address(new TransparentUpgradeableProxy( - address(strategyFactoryImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - StrategyFactory.initialize.selector, - initOwner, - eigenLayerPauserReg, - 0, - strategyBeacon - ) - ))); - } - - function _tokensToBlacklist() internal pure returns (IERC20[] memory) { - // pulled from preprod strategy manager events, filtering by topic: - // 0x0c35b17d91c96eb2751cd456e1252f42a386e524ef9ff26ecc9950859fdc04fe - // (https://holesky.etherscan.io/address/0xF9fbF2e35D8803273E214c99BF15174139f4E67a#events) - IERC20[] memory t = new IERC20[](12); - t[0] = IERC20(0x1aea86558d3FF59176Fe7D5BE48B59B09c96bbf7); // WETHQ2 - t[1] = IERC20(0xa63f56985F9C7F3bc9fFc5685535649e0C1a55f3); // sfrxETH - t[2] = IERC20(0x8783C9C904e1bdC87d9168AE703c8481E8a477Fd); // ankrETH - t[3] = IERC20(0xe3C063B1BEe9de02eb28352b55D49D85514C67FF); // mETH - t[4] = IERC20(0xF603c5A3F774F05d4D848A9bB139809790890864); // osETH - t[5] = IERC20(0x1d8b30cC38Dba8aBce1ac29Ea27d9cFd05379A09); // lsETH - t[6] = IERC20(0x17845EA6a9BfD2caF1b9E558948BB4999dF2656e); // frxETH - t[7] = IERC20(0x8720095Fa5739Ab051799211B146a2EEE4Dd8B37); // cbETH - t[8] = IERC20(0xB4F5fc289a778B80392b86fa70A7111E5bE0F859); // ETHx - t[9] = IERC20(0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1); // rETH - t[10] = IERC20(0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034); // stETH - t[11] = IERC20(0x94373a4919B3240D86eA41593D5eBa789FEF3848); // WETH - - return t; - } - - function _upgradeLongtail() internal { - IERC20[] memory tokensToBlacklist = _tokensToBlacklist(); - - strategyFactory.blacklistTokens(tokensToBlacklist); - strategyManager.setStrategyWhitelister(address(strategyFactory)); - } - - function _sanityChecks() internal { - // Sanity checks - - require(eigenLayerProxyAdmin.getProxyAdmin(TransparentUpgradeableProxy(payable(address(strategyFactory)))) == address(eigenLayerProxyAdmin), "proxy admin not set correctly"); - require(eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(strategyFactory)))) == address(strategyFactoryImplementation), "proxy impl not set correctly"); - - require(strategyFactory.owner() == initOwner, "owner not set correctly"); - require(strategyFactory.pauserRegistry() == eigenLayerPauserReg, "pauser not set correctly"); - require(strategyFactory.strategyBeacon() == strategyBeacon, "beacon not set correctly"); - require(strategyFactory.strategyManager() == strategyManager, "strategy manager not set correctly"); - - require(strategyManager.strategyWhitelister() == address(strategyFactory), "whitelist role not set correctly"); - - IERC20[] memory tokensToBlacklist = _tokensToBlacklist(); - for (uint i = 0; i < tokensToBlacklist.length; i++) { - require(strategyFactory.isBlacklisted(tokensToBlacklist[i]), "token not blacklisted"); - } - - // Deploy a strategy and check that it's whitelisted - IERC20 dummy = IERC20(0x89Aa2dE0beC1b85c1A73111aee7E9A3EE3CBb593); - IStrategy newStrategy = strategyFactory.deployNewStrategy(dummy); - - require(newStrategy.underlyingToken() == dummy, "underlying not set correctly"); - require(strategyManager.strategyIsWhitelistedForDeposit(newStrategy), "did not whitelist in strategymanager"); - } -} diff --git a/script/deploy/holesky/upgrade_preprod_rewardsCoordinator.s.sol b/script/deploy/holesky/upgrade_preprod_rewardsCoordinator.s.sol deleted file mode 100644 index 90e12a73f..000000000 --- a/script/deploy/holesky/upgrade_preprod_rewardsCoordinator.s.sol +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "./Deploy_Test_RewardsCoordinator.s.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/upgrade_preprod_rewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv - * - */ -contract Upgrade_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator { - function run() external virtual override { - _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_preprod.config.json"); - _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses_preprod.config.json"); - - // Overwrite testAddress and multisigs to be EOAowner - testAddress = msg.sender; - executorMultisig = testAddress; - operationsMultisig = testAddress; - pauserMultisig = testAddress; - communityMultisig = testAddress; - STRATEGY_MANAGER_WHITELISTER = testAddress; - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _upgradeRewardsCoordinator(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(false); - _verifyInitializationParams(); - - } -} diff --git a/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol b/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol deleted file mode 100644 index 108b588e9..000000000 --- a/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol +++ /dev/null @@ -1,117 +0,0 @@ -// 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(false); - _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 diff --git a/script/deploy/holesky/v040-holesky-pepe.s.sol b/script/deploy/holesky/v040-holesky-pepe.s.sol deleted file mode 100644 index 6b12ccf56..000000000 --- a/script/deploy/holesky/v040-holesky-pepe.s.sol +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * @notice Script used for upgrading EigenPod and EPM Implementation for Holesky preprod - * anvil --fork-url $RPC_HOLESKY - * forge script script/deploy/holesky/v040-holesky-pepe.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * forge script script/deploy/holesky/v040-holesky-pepe.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv - */ -contract PEPE_Deploy_Preprod is ExistingDeploymentParser { - - address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; - - function run() external virtual { - _parseInitialDeploymentParams( - "script/configs/holesky/eigenlayer_preprod.config.json" - ); - _parseDeployedContracts( - "script/configs/holesky/eigenlayer_addresses.config.json" - ); - - emit log_named_address("Deployer Address", msg.sender); - - emit log("PRIOR IMPLEMENTATION"); - emit log_named_address("current pod impl", address(eigenPodImplementation)); - emit log_named_address("- pod.ethPOS", address(eigenPodImplementation.ethPOS())); - emit log_named_address("- pod.eigenPodManager", address(eigenPodImplementation.eigenPodManager())); - emit log_named_uint("- pod.GENESIS_TIME", eigenPodImplementation.GENESIS_TIME()); - emit log_named_address("current manager impl", address(eigenPodManagerImplementation)); - emit log_named_address("- epm.ethPOS", address(eigenPodManagerImplementation.ethPOS())); - emit log_named_address("- epm.eigenPodBeacon", address(eigenPodManagerImplementation.eigenPodBeacon())); - emit log_named_address("- epm.strategyManager", address(eigenPodManagerImplementation.strategyManager())); - emit log_named_address("- epm.slasher", address(eigenPodManagerImplementation.slasher())); - emit log_named_address("- epm.delegationManager", address(eigenPodManagerImplementation.delegationManager())); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - _deployPEPE(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - logAndOutputContractAddresses("script/output/holesky/v040.output.json"); - } - - function _deployPEPE() internal { - // Deploy EigenPod - eigenPodImplementation = new EigenPod( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodManager, - EIGENPOD_GENESIS_TIME - ); - - // Deploy EigenPodManager - eigenPodManagerImplementation = new EigenPodManager( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodBeacon, - strategyManager, - slasher, - delegationManager - ); - } - - function _upgradePEPE() internal { - // upgrade UpgradeableBeacon - eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); - - // upgrade TUPS - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation) - ); - } -} diff --git a/script/deploy/local/Deploy_From_Scratch.s.sol b/script/deploy/local/Deploy_From_Scratch.s.sol index 564e43afe..365773c49 100644 --- a/script/deploy/local/Deploy_From_Scratch.s.sol +++ b/script/deploy/local/Deploy_From_Scratch.s.sol @@ -487,12 +487,12 @@ contract DeployFromScratch is Script, Test { ); require( - rewardsCoordinatorContract.delegationManager() == delegation, + rewardsCoordinatorContract.delegationManager() == delegation, "rewardsCoordinator: delegation address not set correctly" ); require( - rewardsCoordinatorContract.strategyManager() == strategyManager, + rewardsCoordinatorContract.strategyManager() == strategyManager, "rewardsCoordinator: strategyManager address not set correctly" ); } @@ -642,4 +642,4 @@ contract DeployFromScratch is Script, Test { require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly"); } } -} +} \ No newline at end of file diff --git a/script/deploy/mainnet/EIGEN_timelock_reduction.s.sol b/script/deploy/mainnet/EIGEN_timelock_reduction.s.sol deleted file mode 100644 index bbde1f302..000000000 --- a/script/deploy/mainnet/EIGEN_timelock_reduction.s.sol +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/governance/TimelockController.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/deploy/mainnet/EIGEN_timelock_reduction.s.sol:EIGEN_timelock_reduction -vvvv --rpc-url $RPC_URL -contract EIGEN_timelock_reduction is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - TimelockController public EIGEN_TimelockController = TimelockController(payable(0x2520C6b2C1FBE1813AB5c7c1018CDa39529e9FF2)); - address public EIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; - - uint256 public newDelay = 0; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId == 1) { - // rpcUrl = "RPC_MAINNET"; - } else { - revert("Chain not supported"); - } - - uint256 minDelayBefore = EIGEN_TimelockController.getMinDelay(); - - require(minDelayBefore == 10 days, - "something horribly wrong"); - - bytes memory proposalData = abi.encodeWithSelector( - TimelockController.updateDelay.selector, - newDelay - ); - emit log_named_bytes("proposalData", proposalData); - - // propose change to zero delay - vm.startPrank(EIGEN_TimelockAdmin); - EIGEN_TimelockController.schedule({ - target: address(EIGEN_TimelockController), - value: 0, - data: proposalData, - predecessor: bytes32(0), - salt: bytes32(0), - delay: minDelayBefore - }); - - // fast-forward to after current delay and execute - vm.warp(block.timestamp + minDelayBefore); - EIGEN_TimelockController.execute({ - target: address(EIGEN_TimelockController), - value: 0, - payload: proposalData, - predecessor: bytes32(0), - salt: bytes32(0) - }); - - cheats.stopPrank(); - - uint256 minDelayAfter = EIGEN_TimelockController.getMinDelay(); - - require(minDelayAfter == 0, - "min delay not set to zero"); - } -} \ No newline at end of file diff --git a/script/deploy/mainnet/EIGEN_upgrade.s.sol b/script/deploy/mainnet/EIGEN_upgrade.s.sol deleted file mode 100644 index 259cde0ce..000000000 --- a/script/deploy/mainnet/EIGEN_upgrade.s.sol +++ /dev/null @@ -1,127 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts/governance/TimelockController.sol"; - -import "../../../src/contracts/token/BackingEigen.sol"; -import "../../../src/contracts/token/Eigen.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/deploy/mainnet/EIGEN_upgrade.s.sol:EIGEN_upgrade -vvvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -contract EIGEN_upgrade is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - BackingEigen public bEIGEN_proxy = BackingEigen(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75); - BackingEigen public bEIGEN_implementation; - Eigen public EIGEN_proxy = Eigen(0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83); - Eigen public EIGEN_implementation; - ProxyAdmin public EIGEN_ProxyAdmin = ProxyAdmin(0xB8915E195121f2B5D989Ec5727fd47a5259F1CEC); - TimelockController public EIGEN_TimelockController = TimelockController(payable(0x2520C6b2C1FBE1813AB5c7c1018CDa39529e9FF2)); - address public EIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; - - IERC20 public bEIGEN_addressBefore; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId == 1) { - // rpcUrl = "RPC_MAINNET"; - } else { - revert("Chain not supported"); - } - - bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); - - require(bEIGEN_addressBefore == IERC20(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75), - "something horribly wrong"); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implmementation contract - EIGEN_implementation = new Eigen({ - _bEIGEN: bEIGEN_addressBefore - }); - - vm.stopBroadcast(); - - emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); - - // Perform post-upgrade tests - simulatePerformingUpgrade(); - checkUpgradeCorrectness(); - simulateWrapAndUnwrap(); - } - - function simulatePerformingUpgrade() public { - // Upgrade beacon - uint256 delay = EIGEN_TimelockController.getMinDelay(); - bytes memory data = abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(EIGEN_proxy))), - EIGEN_implementation - ); - emit log_named_bytes("data", data); - - vm.startPrank(EIGEN_TimelockAdmin); - EIGEN_TimelockController.schedule({ - target: address(EIGEN_ProxyAdmin), - value: 0, - data: data, - predecessor: bytes32(0), - salt: bytes32(0), - delay: delay - }); - - vm.warp(block.timestamp + delay); - EIGEN_TimelockController.execute({ - target: address(EIGEN_ProxyAdmin), - value: 0, - payload: data, - predecessor: bytes32(0), - salt: bytes32(0) - }); - - cheats.stopPrank(); - } - - function checkUpgradeCorrectness() public { - vm.prank(address(EIGEN_TimelockController)); - require(EIGEN_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), - "implementation set incorrectly"); - require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, - "bEIGEN address changed unexpectedly"); - } - - function simulateWrapAndUnwrap() public { - uint256 amount = 1e18; - cheats.prank(address(EIGEN_proxy)); - bEIGEN_proxy.transfer(address(this), amount); - - bEIGEN_proxy.approve(address(EIGEN_proxy), amount); - uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.wrap(amount); - uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); - EIGEN_proxy.unwrap(amount); - uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); - uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); - - require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); - require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); - - require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); - require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); - } -} \ No newline at end of file diff --git a/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol b/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol deleted file mode 100644 index b4ae9cc91..000000000 --- a/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol +++ /dev/null @@ -1,159 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; - -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/pods/EigenPod.sol"; -import "../../../src/contracts/pods/EigenPodManager.sol"; - -import "../../../src/contracts/permissions/PauserRegistry.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/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol:EigenPod_Minor_Upgrade_Deploy --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv -contract EigenPod_Minor_Upgrade_Deploy is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - string public m2DeploymentOutputPath; - string public freshOutputPath; - - // EigenLayer core contracts - ISlasher public slasher; - IDelegationManager public delegation; - DelegationManager public delegationImplementation; - IStrategyManager public strategyManager; - StrategyManager public strategyManagerImplementation; - IEigenPodManager public eigenPodManager; - EigenPodManager public eigenPodManagerImplementation; - IBeacon public eigenPodBeacon; - EigenPod public eigenPodImplementation; - - // Eigenlayer Proxy Admin - ProxyAdmin public eigenLayerProxyAdmin; - - // BeaconChain deposit contract - IETHPOSDeposit public ethPOS; - - // RPC url to fork from for pre-upgrade state change tests - string public rpcUrl; - - uint64 public genesisTimeBefore; - uint64 public maxRestakedBalanceBefore; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - // Update deployment path addresses if on mainnet - if (chainId == 1) { - m2DeploymentOutputPath = "script/output/mainnet/M2_mainnet_upgrade.output.json"; - freshOutputPath = "script/output/mainnet/eigenpod_minor_upgrade_deploy.json"; - rpcUrl = "RPC_MAINNET"; - } else { - revert("Chain not supported"); - } - - // Read json data - string memory deployment_data = vm.readFile(m2DeploymentOutputPath); - slasher = Slasher(stdJson.readAddress(deployment_data, ".addresses.slasher")); - delegation = DelegationManager(stdJson.readAddress(deployment_data, ".addresses.delegationManager")); - strategyManager = DelegationManager(address(delegation)).strategyManager(); - eigenPodManager = strategyManager.eigenPodManager(); - eigenPodBeacon = eigenPodManager.eigenPodBeacon(); - ethPOS = eigenPodManager.ethPOS(); - - eigenLayerProxyAdmin = ProxyAdmin(stdJson.readAddress(deployment_data, ".addresses.eigenLayerProxyAdmin")); - - genesisTimeBefore = EigenPod(payable(eigenPodBeacon.implementation())).GENESIS_TIME(); - // maxRestakedBalanceBefore = EigenPod(payable(eigenPodBeacon.implementation())).MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR(); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implmementation contracts - eigenPodImplementation = new EigenPod({ - _ethPOS: ethPOS, - _eigenPodManager: eigenPodManager, - // _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR: maxRestakedBalanceBefore, - _GENESIS_TIME: genesisTimeBefore - }); - - vm.stopBroadcast(); - - // Write json data out - string memory parent_object = "parent object"; - string memory deployed_addresses = "addresses"; - - // Add chain info - string memory chain_info = "chainInfo"; - vm.serializeUint(chain_info, "deploymentBlock", block.number); - string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); - - // Serialize new implementation addresses - string memory deployed_addresses_output = vm.serializeAddress( - deployed_addresses, - "eigenPodImplementation", - address(eigenPodImplementation) - ); - - // Save addresses - vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); - string memory finalJson = vm.serializeString(parent_object, chain_info, chain_info_output); - - // Write output to file - vm.writeJson(finalJson, freshOutputPath); - - // Perform post-upgrade tests - simulatePerformingUpgrade(); - checkUpgradeCorrectness(); - } - - function simulatePerformingUpgrade() public { - // Upgrade beacon - cheats.prank(UpgradeableBeacon(address(eigenPodBeacon)).owner()); - UpgradeableBeacon(address(eigenPodBeacon)).upgradeTo(address(eigenPodImplementation)); - } - - function checkUpgradeCorrectness() public view { - _verifyEigenPodCorrectness(); - } - - function _verifyEigenPodCorrectness() public view { - // Check that state is correct - require(eigenPodBeacon.implementation() == address(eigenPodImplementation), - "implementation set incorrectly"); - require(eigenPodImplementation.ethPOS() == ethPOS, - "ethPOS set incorrectly"); - require(eigenPodImplementation.eigenPodManager() == eigenPodManager, - "eigenPodManager set incorrectly"); - // check that values are unchanged - // require(eigenPodImplementation.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() == maxRestakedBalanceBefore, - // "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR set incorrectly"); - require(eigenPodImplementation.GENESIS_TIME() == genesisTimeBefore, - "GENESIS_TIME set incorrectly"); - // redundant checks on correct values - // require(eigenPodImplementation.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() == 32 gwei, - // "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR set incorrectly"); - require(eigenPodImplementation.GENESIS_TIME() == 1606824023, - "GENESIS_TIME set incorrectly"); - - - require(address(EigenPod(payable(eigenPodBeacon.implementation())).eigenPodManager()) == 0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338); - require(address(EigenPod(payable(eigenPodBeacon.implementation())).ethPOS()) == 0x00000000219ab540356cBB839Cbe05303d7705Fa); - } -} \ No newline at end of file diff --git a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol b/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol deleted file mode 100644 index cc35e069f..000000000 --- a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol +++ /dev/null @@ -1,335 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; -import "../../utils/TimelockEncoding.sol"; -import "../../utils/Multisend.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * anvil --fork-url $RPC_MAINNET - * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * - * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --broadcast -vvvv - * - */ -contract M2_Mainnet_Upgrade is ExistingDeploymentParser { - function run() external virtual { - _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); - _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployImplementationContracts(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Simulate upgrade of contracts to new implementations - _simulateUpgrade(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/mainnet/M2_mainnet_upgrade.output.json"); - } - - /** - * @notice Deploy EigenLayer contracts from scratch for Holesky - */ - function _deployImplementationContracts() internal { - // 1. Deploy New TUPS - avsDirectoryImplementation = new AVSDirectory(delegationManager); - avsDirectory = AVSDirectory( - address( - new TransparentUpgradeableProxy( - address(avsDirectoryImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - AVSDirectory.initialize.selector, - executorMultisig, // initialOwner - eigenLayerPauserReg, - AVS_DIRECTORY_INIT_PAUSED_STATUS - ) - ) - ) - ); - - // 2. Deploy Implementations - eigenPodImplementation = new EigenPod( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodManager, - EIGENPOD_GENESIS_TIME - ); - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); - slasherImplementation = new Slasher(strategyManager, delegationManager); - eigenPodManagerImplementation = new EigenPodManager( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodBeacon, - strategyManager, - slasher, - delegationManager - ); - } - - function _simulateUpgrade() internal { - - vm.startPrank(executorMultisig); - - // First, upgrade the proxy contracts to point to the implementations - // AVSDirectory - // eigenLayerProxyAdmin.upgrade( - // TransparentUpgradeableProxy(payable(address(avsDirectory))), - // address(avsDirectoryImplementation) - // ); - // DelegationManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(delegationManager))), - address(delegationManagerImplementation) - ); - // StrategyManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation) - ); - // Slasher - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation) - ); - // EigenPodManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation) - ); - - // Second, configure additional settings and paused statuses - delegationManager.setMinWithdrawalDelayBlocks(DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS); - delegationManager.unpause(0); - eigenPodManager.unpause(0); - - eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); - - vm.stopPrank(); - } -} - -// forge t --mt test_queueUpgrade --fork-url $RPC_MAINNET -vvvv -contract Queue_M2_Upgrade is M2_Mainnet_Upgrade, TimelockEncoding { - Vm cheats = Vm(VM_ADDRESS); - - // Thurs Apr 08 2024 12:00:00 GMT-0700 (Pacific Daylight Time) - uint256 timelockEta = 1712559600; - - function test_queueUpgrade() external { - _parseDeployedContracts("script/output/mainnet/M2_mainnet_upgrade.output.json"); - _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); - - Tx[] memory txs = new Tx[](11); - // upgrade the DelegationManager, Slasher, StrategyManager, DelayedWithdrawalRouter, EigenPodManager, & EigenPod contracts - txs[0] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(delegationManager))), - delegationManagerImplementation - ) - ); - - txs[1] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(slasher))), - slasherImplementation - ) - ); - - txs[2] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(strategyManager))), - strategyManagerImplementation - ) - ); - - // txs[3] = Tx( - // address(eigenLayerProxyAdmin), - // 0, - // abi.encodeWithSelector( - // ProxyAdmin.upgrade.selector, - // TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter))), - // delayedWithdrawalRouterImplementation - // ) - // ); - - txs[4] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - eigenPodManagerImplementation - ) - ); - - txs[5] = Tx( - address(eigenPodBeacon), - 0, - abi.encodeWithSelector( - UpgradeableBeacon.upgradeTo.selector, - eigenPodImplementation - ) - ); - - // set the min withdrawal delay blocks on the DelegationManager - txs[6] = Tx( - address(delegationManager), - 0, // value - abi.encodeWithSelector(DelegationManager.setMinWithdrawalDelayBlocks.selector, DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS) - ); - - // set beacon chain oracle on EigenPodManager - // txs[7] = Tx( - // address(eigenPodManager), - // 0, // value - // abi.encodeWithSelector(EigenPodManager.updateBeaconChainOracle.selector, beaconOracle) - // ); - - // set Deneb fork timestamp on EigenPodManager - // txs[8] = Tx( - // address(eigenPodManager), - // 0, // value - // abi.encodeWithSelector(EigenPodManager.setDenebForkTimestamp.selector, EIGENPOD_MANAGER_DENEB_FORK_TIMESTAMP) - // ); - - // unpause everything on DelegationManager - txs[9] = Tx( - address(delegationManager), - 0, // value - abi.encodeWithSelector(Pausable.unpause.selector, 0) - ); - - // unpause everything on EigenPodManager - txs[10] = Tx( - address(eigenPodManager), - 0, // value - abi.encodeWithSelector(Pausable.unpause.selector, 0) - ); - - bytes memory calldata_to_multisend_contract = abi.encodeWithSelector(MultiSendCallOnly.multiSend.selector, encodeMultisendTxs(txs)); - emit log_named_bytes("calldata_to_multisend_contract", calldata_to_multisend_contract); - - bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ - // call to executor will be from the timelock - from: timelock, - // performing many operations at the same time - to: multiSendCallOnly, - // value to send in tx - value: 0, - // calldata for the operation - data: calldata_to_multisend_contract, - // operation type (for performing many operations at the same time) - operation: ISafe.Operation.DelegateCall - }); - - (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) = encodeForTimelock({ - // address to be called from the timelock - to: executorMultisig, - // value to send in tx - value: 0, - // calldata for the operation - data: final_calldata_to_executor_multisig, - // time at which the tx will become executable - timelockEta: timelockEta - }); - - bytes32 expectedTxHash = getTxHash({ - target: executorMultisig, - _value: 0, - _data: final_calldata_to_executor_multisig, - eta: timelockEta - }); - emit log_named_bytes32("expectedTxHash", expectedTxHash); - - cheats.prank(operationsMultisig); - (bool success, ) = timelock.call(calldata_to_timelock_queuing_action); - require(success, "call to timelock queuing action failed"); - - require(ITimelock(timelock).queuedTransactions(expectedTxHash), "expectedTxHash not queued"); - - // test performing the upgrade - cheats.warp(timelockEta); - cheats.prank(operationsMultisig); - (success, ) = timelock.call(calldata_to_timelock_executing_action); - require(success, "call to timelock executing action failed"); - - // Check correctness after upgrade - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - _postUpgradeChecks(); - } - - function _postUpgradeChecks() internal { - // check that LST deposits are paused - address rETH = 0xae78736Cd615f374D3085123A210448E74Fc6393; - address rETH_Strategy = 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2; - uint256 amount = 1e18; - cheats.prank(rETH); - // this works because rETH has more than 1 ETH of its own token at its address :) - IERC20(rETH).transfer(address(this), amount); - IERC20(rETH).approve(address(strategyManager), amount); - cheats.expectRevert("Pausable: index is paused"); - strategyManager.depositIntoStrategy({ - strategy: IStrategy(rETH_Strategy), - token: IERC20(rETH), - amount: amount - }); - - // unpause LST deposits and check that a deposit works - cheats.prank(executorMultisig); - strategyManager.unpause(0); - strategyManager.depositIntoStrategy({ - strategy: IStrategy(rETH_Strategy), - token: IERC20(rETH), - amount: amount - }); - - // check that EigenPod proofs are live (although this still reverts later in the call) - EigenPod existingEigenPod = EigenPod(payable(0x0b347D5E38296277E829CE1D8C6b82e4c63C2Df3)); - BeaconChainProofs.StateRootProof memory stateRootProof; - uint40[] memory validatorIndices; - bytes[] memory validatorFieldsProofs; - bytes32[][] memory validatorFields; - cheats.startPrank(existingEigenPod.podOwner()); - existingEigenPod.startCheckpoint(false); - cheats.expectRevert("EigenPodManager.getBlockRootAtTimestamp: state root at timestamp not yet finalized"); - existingEigenPod.verifyWithdrawalCredentials( - uint64(block.timestamp), - stateRootProof, - validatorIndices, - validatorFieldsProofs, - validatorFields - ); - } - - function getTxHash(address target, uint256 _value, bytes memory _data, uint256 eta) public pure returns (bytes32) { - // empty bytes - bytes memory signature; - bytes32 txHash = keccak256(abi.encode(target, _value, signature, _data, eta)); - return txHash; - } -} diff --git a/script/deploy/mainnet/bEIGEN_timelock_reduction.s.sol b/script/deploy/mainnet/bEIGEN_timelock_reduction.s.sol deleted file mode 100644 index 9067b28f5..000000000 --- a/script/deploy/mainnet/bEIGEN_timelock_reduction.s.sol +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/governance/TimelockController.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/deploy/mainnet/bEIGEN_timelock_reduction.s.sol:bEIGEN_timelock_reduction -vvvv --rpc-url $RPC_URL -contract bEIGEN_timelock_reduction is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - TimelockController public bEIGEN_TimelockController = TimelockController(payable(0xd6EC41E453C5E7dA5494f4d51A053Ab571712E6f)); - address public bEIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; - - uint256 public newDelay = 0; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId == 1) { - // rpcUrl = "RPC_MAINNET"; - } else { - revert("Chain not supported"); - } - - uint256 minDelayBefore = bEIGEN_TimelockController.getMinDelay(); - - require(minDelayBefore == 24 days, - "something horribly wrong"); - - bytes memory proposalData = abi.encodeWithSelector( - TimelockController.updateDelay.selector, - newDelay - ); - emit log_named_bytes("proposalData", proposalData); - - // propose change to zero delay - vm.startPrank(bEIGEN_TimelockAdmin); - bEIGEN_TimelockController.schedule({ - target: address(bEIGEN_TimelockController), - value: 0, - data: proposalData, - predecessor: bytes32(0), - salt: bytes32(0), - delay: minDelayBefore - }); - - // fast-forward to after current delay and execute - vm.warp(block.timestamp + minDelayBefore); - bEIGEN_TimelockController.execute({ - target: address(bEIGEN_TimelockController), - value: 0, - payload: proposalData, - predecessor: bytes32(0), - salt: bytes32(0) - }); - - cheats.stopPrank(); - - uint256 minDelayAfter = bEIGEN_TimelockController.getMinDelay(); - - require(minDelayAfter == 0, - "min delay not set to zero"); - } -} \ No newline at end of file diff --git a/script/deploy/mainnet/bEIGEN_upgrade.s.sol b/script/deploy/mainnet/bEIGEN_upgrade.s.sol deleted file mode 100644 index 42093a68a..000000000 --- a/script/deploy/mainnet/bEIGEN_upgrade.s.sol +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import "@openzeppelin/contracts/governance/TimelockController.sol"; - -import "../../../src/contracts/token/BackingEigen.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/deploy/mainnet/bEIGEN_upgrade.s.sol:bEIGEN_upgrade -vvvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -contract bEIGEN_upgrade is Script, Test { - Vm cheats = Vm(VM_ADDRESS); - - BackingEigen public bEIGEN_proxy = BackingEigen(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75); - BackingEigen public bEIGEN_implementation; - ProxyAdmin public bEIGEN_ProxyAdmin = ProxyAdmin(0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9); - TimelockController public bEIGEN_TimelockController = TimelockController(payable(0xd6EC41E453C5E7dA5494f4d51A053Ab571712E6f)); - address public bEIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; - - // // RPC url to fork from for pre-upgrade state change tests - // string public rpcUrl; - - IERC20 public EIGEN_addressBefore; - - function run() external { - // Read and log the chain ID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId == 1) { - // rpcUrl = "RPC_MAINNET"; - } else { - revert("Chain not supported"); - } - - EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); - - require(EIGEN_addressBefore == IERC20(0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83), - "something horribly wrong"); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implmementation contract - bEIGEN_implementation = new BackingEigen({ - _EIGEN: EIGEN_addressBefore - }); - - vm.stopBroadcast(); - - emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); - - // Perform post-upgrade tests - simulatePerformingUpgrade(); - checkUpgradeCorrectness(); - } - - function simulatePerformingUpgrade() public { - // Upgrade beacon - uint256 delay = bEIGEN_TimelockController.getMinDelay(); - bytes memory data = abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), - bEIGEN_implementation - ); - emit log_named_bytes("data", data); - - vm.startPrank(bEIGEN_TimelockAdmin); - bEIGEN_TimelockController.schedule({ - target: address(bEIGEN_ProxyAdmin), - value: 0, - data: data, - predecessor: bytes32(0), - salt: bytes32(0), - delay: delay - }); - - vm.warp(block.timestamp + delay); - bEIGEN_TimelockController.execute({ - target: address(bEIGEN_ProxyAdmin), - value: 0, - payload: data, - predecessor: bytes32(0), - salt: bytes32(0) - }); - - cheats.stopPrank(); - } - - function checkUpgradeCorrectness() public { - vm.prank(address(bEIGEN_TimelockController)); - require(bEIGEN_ProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), - "implementation set incorrectly"); - require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, - "EIGEN address changed unexpectedly"); - } -} \ No newline at end of file diff --git a/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol b/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol deleted file mode 100644 index 947402fa9..000000000 --- a/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/utils/Create2.sol"; -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * FORK LOCAL - * anvil --fork-url $RPC_MAINNET - * forge script script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol:MainnetRewardsCoordinatorDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * - * MAINNET - * forge script script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol:MainnetRewardsCoordinatorDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv - * - */ -contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser { - function run() external virtual { - _parseInitialDeploymentParams( - "script/configs/mainnet/v0.3.0-mainnet-rewards.config.json" - ); - _parseDeployedContracts( - "script/configs/mainnet/v0.3.0-eigenlayer-addresses.config.json" - ); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployRewardsCoordinator(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(true); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/mainnet/v0.3.0-mainnet-rewards.output.json"); - } - - /** - * @notice Deploy RewardsCoordinator for Holesky - */ - function _deployRewardsCoordinator() internal { - - - // Deploy RewardsCoordinator proxy and implementation - 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 - ); - rewardsCoordinator = RewardsCoordinator( - address( - new TransparentUpgradeableProxy( - address(rewardsCoordinatorImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - RewardsCoordinator.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - REWARDS_COORDINATOR_INIT_PAUSED_STATUS, - REWARDS_COORDINATOR_UPDATER, - REWARDS_COORDINATOR_ACTIVATION_DELAY, - REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS - ) - ) - ) - ); - } - - /** - * @notice Deploy RewardsCoordinator Implementation for Holesky and upgrade the proxy - */ - function _upgradeRewardsCoordinator() internal { - // Deploy RewardsCoordinator proxy and implementation - 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 - ); - - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), - address(rewardsCoordinatorImplementation) - ); - } -} diff --git a/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol b/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol deleted file mode 100644 index 65873b487..000000000 --- a/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/utils/Create2.sol"; -import "../../utils/ExistingDeploymentParser.sol"; - -/** - * FORK LOCAL - * anvil --fork-url $RPC_MAINNET - * forge script script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol:MainnetPEPEDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * - * MAINNET - * forge script script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol:MainnetPEPEDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv - * - */ -contract MainnetPEPEDeploy is ExistingDeploymentParser { - function run() external virtual { - _parseInitialDeploymentParams( - "script/configs/mainnet/mainnet-config.config.json" - ); - _parseDeployedContracts( - "script/configs/mainnet/mainnet-addresses.config.json" - ); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployPEPE(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - _upgradePEPE(); - - _testDeploy(); - - // Post-upgrade sanity checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(false); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/mainnet/v0.4.2-mainnet-pepe.output.json"); - } - - function _deployPEPE() internal { - // Deploy EigenPod - eigenPodImplementation = new EigenPod( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodManager, - EIGENPOD_GENESIS_TIME - ); - - // Deploy EigenPodManager - eigenPodManagerImplementation = new EigenPodManager( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodBeacon, - strategyManager, - slasher, - delegationManager - ); - } - - function _upgradePEPE() internal { - vm.startPrank(address(executorMultisig)); - - // upgrade UpgradeableBeacon - eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); - - // upgrade TUPS - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation) - ); - - vm.stopPrank(); - } - - function _testDeploy() internal view { - require(eigenPodImplementation.activeValidatorCount() == 0, "unable to fetch activeValidatorCount"); - } -} diff --git a/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol b/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol deleted file mode 100644 index e1d961aad..000000000 --- a/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol +++ /dev/null @@ -1,197 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; -import "../../utils/Multisend.sol"; -import "script/utils/TimelockEncoding.sol"; - -/** - * - * Mainnet: Deploy/Upgrade RewardsCoordinator - * forge script script/deploy/mainnet/v0.4.3-upgrade-rewardsCoordinator.s.sol --rpc-url $MAINNET_RPC --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY - * - * Test: forge test --mc Upgrade_Mainnet_RewardsCoordinator --mt test_set_reward_for_all_submitter --rpc-url $MAINNET_RPC -vv - */ -contract Upgrade_Mainnet_RewardsCoordinator is ExistingDeploymentParser, TimelockEncoding { - - // CALLDATA FOR CALL TO TIMELOCK - // TUESDAY, SEPTEMBER 27 2024 22:00:00 GMT (6pm EST/3pm PST) - uint256 timelockEta = 1727474400; - - uint256 dayToQueueAction = 1726610400; - - // Calldatas for upgrading RC - bytes final_calldata_to_executor_multisig; - bytes calldata_to_timelock_queuing_action; - bytes calldata_to_timelock_executing_action; - - // Calldatas for setting reward for all submitter - bytes hopper_setter_final_calldata_to_ops_multisig; - - modifier parseState() { - _parseInitialDeploymentParams("script/configs/mainnet/mainnet-config.config.json"); - _parseDeployedContracts("script/configs/mainnet/mainnet-addresses.config.json"); - _; - } - - function run() public parseState { - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - if (chainId != 1) { - revert("Chain not supported"); - } - - 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 Txs via Operations Multisig to Timelock to: - // 1. Upgrade RewardsCoordinator - // 2. Set owner of RewardsCoordinator to OperationsMultisig - Tx[] memory txs = new Tx[](2); - address timelockTarget = executorMultisig; - - // 1. Upgrade Rewards Coordiantor - txs[0] = Tx({ - to: address(eigenLayerProxyAdmin), - value: 0, - data: abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), - rewardsCoordinatorImplementation - ) - }); - - // 2. Set owner of RewardsCoordinator to OperationsMultisig - txs[1] = Tx({ - to: address(rewardsCoordinator), - value: 0, - data: abi.encodeWithSelector( - Ownable.transferOwnership.selector, - address(operationsMultisig) - ) - }); - - bytes memory calldata_to_multisend_contract = abi.encodeWithSelector(MultiSendCallOnly.multiSend.selector, encodeMultisendTxs(txs)); - emit log_named_bytes("calldata_to_multisend_contract", calldata_to_multisend_contract); - - final_calldata_to_executor_multisig = encodeForExecutor({ - from: timelock, - to: multiSendCallOnly, - value: 0, - data: calldata_to_multisend_contract, - operation: ISafe.Operation.DelegateCall - }); - - calldata_to_timelock_queuing_action = abi.encodeWithSelector(ITimelock.queueTransaction.selector, - timelockTarget, - timelockValue, - timelockSignature, - final_calldata_to_executor_multisig, - timelockEta - ); - - emit log_named_bytes("calldata_to_timelock_queuing_action", calldata_to_timelock_queuing_action); - - calldata_to_timelock_executing_action = abi.encodeWithSelector(ITimelock.executeTransaction.selector, - timelockTarget, - timelockValue, - timelockSignature, - final_calldata_to_executor_multisig, - timelockEta - ); - - emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); - } - - function test_mainnet_rc_upgrade() public { - run(); - - vm.warp(dayToQueueAction); - - // Queue Transaction - vm.prank(operationsMultisig); - (bool success, ) = address(timelock).call(calldata_to_timelock_queuing_action); - require(success, "Timelock queueTransaction failed"); - - // Fast forwart to after ETA - vm.warp(timelockEta + 1); - vm.prank(operationsMultisig); - (success, ) = address(timelock).call(calldata_to_timelock_executing_action); - require(success, "Timelock executeTransaction failed"); - - // Assert owner - assertEq(address(rewardsCoordinator.owner()), address(operationsMultisig), "RewardsCoordinator owner is not OperationsMultisig"); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(false); - _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 test_set_reward_for_all_submitter(address hopper) public { - test_mainnet_rc_upgrade(); - - // Set reward for all submitters - vm.prank(operationsMultisig); - rewardsCoordinator.setRewardsForAllSubmitter(hopper, true); - - assertTrue(rewardsCoordinator.isRewardsForAllSubmitter(hopper), "Hopper not set for all submitters"); - } -} \ No newline at end of file diff --git a/script/interfaces/IUpgradeableBeacon.sol b/script/interfaces/IUpgradeableBeacon.sol new file mode 100644 index 000000000..ad35ce238 --- /dev/null +++ b/script/interfaces/IUpgradeableBeacon.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +interface IUpgradeableBeacon { + function upgradeTo( + address newImplementation + ) external; + function implementation() external returns (address); +} diff --git a/script/output/devnet/M1_MOCK_deployment_data.json b/script/output/devnet/M1_MOCK_deployment_data.json index 28ff52987..200eacc2f 100644 --- a/script/output/devnet/M1_MOCK_deployment_data.json +++ b/script/output/devnet/M1_MOCK_deployment_data.json @@ -1,36 +1,36 @@ { - "addresses": { - "baseStrategyImplementation": "0x5207CfA0166E8de0FCdFd78B4d17b68587bE306d", - "delayedWithdrawalRouter": "0xD718d5A27a29FF1cD22403426084bA0d479869a0", - "delayedWithdrawalRouterImplementation": "0x1c23A6d89F95ef3148BCDA8E242cAb145bf9c0E4", - "delegation": "0xDB8cFf278adCCF9E9b5da745B44E754fC4EE3C76", - "delegationImplementation": "0xd21060559c9beb54fC07aFd6151aDf6cFCDDCAeB", - "eigenLayerPauserReg": "0xA8452Ec99ce0C64f20701dB7dD3abDb607c00496", - "eigenLayerProxyAdmin": "0x90193C961A926261B756D1E5bb255e67ff9498A1", - "eigenPodBeacon": "0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6", - "eigenPodImplementation": "0x4f559F30f5eB88D635FDe1548C4267DB8FaB0351", - "eigenPodManager": "0xDEb1E9a6Be7Baf84208BB6E10aC9F9bbE1D70809", - "eigenPodManagerImplementation": "0x8B71b41D4dBEb2b6821d44692d3fACAAf77480Bb", - "emptyContract": "0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3", - "slasher": "0x62c20Aa1e0272312BC100b4e23B4DC1Ed96dD7D1", - "slasherImplementation": "0x978e3286EB805934215a88694d80b09aDed68D90", - "strategies": { - "WETH": "0x39Af23E00F1e662025aA01b0cEdA19542B78DF99", - "rETH": "0xd6EAF4c146261653EE059077B78ED088Add54309", - "tsETH": "0x970670459734a83899773A0fd45941B5afC1200e", - "wstETH": "0xEF179756ea6525AFade217cA5aB0b1b5CfE0fd92" + "addresses": { + "baseStrategyImplementation": "0x5207CfA0166E8de0FCdFd78B4d17b68587bE306d", + "delayedWithdrawalRouter": "0xD718d5A27a29FF1cD22403426084bA0d479869a0", + "delayedWithdrawalRouterImplementation": "0x1c23A6d89F95ef3148BCDA8E242cAb145bf9c0E4", + "delegation": "0xDB8cFf278adCCF9E9b5da745B44E754fC4EE3C76", + "delegationImplementation": "0xd21060559c9beb54fC07aFd6151aDf6cFCDDCAeB", + "eigenLayerPauserReg": "0xA8452Ec99ce0C64f20701dB7dD3abDb607c00496", + "eigenLayerProxyAdmin": "0x90193C961A926261B756D1E5bb255e67ff9498A1", + "eigenPodBeacon": "0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6", + "eigenPodImplementation": "0x4f559F30f5eB88D635FDe1548C4267DB8FaB0351", + "eigenPodManager": "0xDEb1E9a6Be7Baf84208BB6E10aC9F9bbE1D70809", + "eigenPodManagerImplementation": "0x8B71b41D4dBEb2b6821d44692d3fACAAf77480Bb", + "emptyContract": "0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3", + "slasher": "0x62c20Aa1e0272312BC100b4e23B4DC1Ed96dD7D1", + "slasherImplementation": "0x978e3286EB805934215a88694d80b09aDed68D90", + "strategies": { + "WETH": "0x39Af23E00F1e662025aA01b0cEdA19542B78DF99", + "rETH": "0xd6EAF4c146261653EE059077B78ED088Add54309", + "tsETH": "0x970670459734a83899773A0fd45941B5afC1200e", + "wstETH": "0xEF179756ea6525AFade217cA5aB0b1b5CfE0fd92" + }, + "strategyManager": "0x50EEf481cae4250d252Ae577A09bF514f224C6C4", + "strategyManagerImplementation": "0x4C52a6277b1B84121b3072C0c92b6Be0b7CC10F1" }, - "strategyManager": "0x50EEf481cae4250d252Ae577A09bF514f224C6C4", - "strategyManagerImplementation": "0x4C52a6277b1B84121b3072C0c92b6Be0b7CC10F1" - }, - "chainInfo": { - "chainId": 31337, - "deploymentBlock": 1 - }, - "parameters": { - "communityMultisig": "0x37bAFb55BC02056c5fD891DFa503ee84a97d89bF", - "operationsMultisig": "0x040353E9d057689b77DF275c07FFe1A46b98a4a6", - "executorMultisig": "0x3d9C2c2B40d890ad53E27947402e977155CD2808", - "timelock": "0xA7e72a0564ebf25Fa082Fc27020225edeAF1796E" - } -} \ No newline at end of file + "chainInfo": { + "chainId": 31337, + "deploymentBlock": 1 + }, + "parameters": { + "communityMultisig": "0x37bAFb55BC02056c5fD891DFa503ee84a97d89bF", + "operationsMultisig": "0x040353E9d057689b77DF275c07FFe1A46b98a4a6", + "executorMultisig": "0x3d9C2c2B40d890ad53E27947402e977155CD2808", + "timelock": "0xA7e72a0564ebf25Fa082Fc27020225edeAF1796E" + } + } \ No newline at end of file diff --git a/script/output/devnet/M2_from_scratch_deployment_data.json b/script/output/devnet/M2_from_scratch_deployment_data.json index 5c47c3720..fa53f216a 100644 --- a/script/output/devnet/M2_from_scratch_deployment_data.json +++ b/script/output/devnet/M2_from_scratch_deployment_data.json @@ -1,33 +1,33 @@ { - "addresses": { - "avsDirectory": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", - "avsDirectoryImplementation": "0x9A676e781A523b5d0C0e43731313A708CB607508", - "baseStrategyImplementation": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F", - "delayedWithdrawalRouter": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", - "delayedWithdrawalRouterImplementation": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE", - "delegation": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", - "delegationImplementation": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", - "eigenLayerPauserReg": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", - "eigenLayerProxyAdmin": "0x5FbDB2315678afecb367f032d93F642f64180aa3", - "eigenPodBeacon": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", - "eigenPodImplementation": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", - "eigenPodManager": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", - "eigenPodManagerImplementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", - "emptyContract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", - "rewardsCoordinator": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", - "rewardsCoordinatorImplementation": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed", - "slasher": "0x0165878A594ca255338adfa4d48449f69242Eb8F", - "slasherImplementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016", - "strategies": "", - "strategyManager": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", - "strategyManagerImplementation": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" - }, - "chainInfo": { - "chainId": 31337, - "deploymentBlock": 0 - }, - "parameters": { - "executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" - } -} \ No newline at end of file + "addresses": { + "avsDirectory": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", + "avsDirectoryImplementation": "0x9A676e781A523b5d0C0e43731313A708CB607508", + "baseStrategyImplementation": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F", + "delayedWithdrawalRouter": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", + "delayedWithdrawalRouterImplementation": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE", + "delegation": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", + "delegationImplementation": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", + "eigenLayerPauserReg": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", + "eigenLayerProxyAdmin": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "eigenPodBeacon": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", + "eigenPodImplementation": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", + "eigenPodManager": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", + "eigenPodManagerImplementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", + "emptyContract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", + "rewardsCoordinator": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", + "rewardsCoordinatorImplementation": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed", + "slasher": "0x0165878A594ca255338adfa4d48449f69242Eb8F", + "slasherImplementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016", + "strategies": "", + "strategyManager": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + "strategyManagerImplementation": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" + }, + "chainInfo": { + "chainId": 31337, + "deploymentBlock": 0 + }, + "parameters": { + "executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + } + } \ No newline at end of file diff --git a/script/output/devnet/local_from_scratch_deployment_data.json b/script/output/devnet/local_from_scratch_deployment_data.json new file mode 100644 index 000000000..e69de29bb diff --git a/script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json b/script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json deleted file mode 100644 index dc8ec758f..000000000 --- a/script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", - "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", - "baseStrategyImplementation": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", - "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - "delegationManagerImplementation": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", - "eigenLayerPauserReg": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", - "eigenLayerProxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", - "eigenPodBeacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", - "eigenPodImplementation": "0x10ad7e30e3F52076C8462D573530f4461377319c", - "eigenPodManager": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", - "eigenPodManagerImplementation": "0x91A6525a4a843F5a5B633905300c33F79413CCc5", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", - "rewardsCoordinatorImplementation": "0x1A17df4170099577b79038Fd310f3ff62F79752E", - "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", - "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", - "strategies": "", - "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "strategyManagerImplementation": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 2148310 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json b/script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json deleted file mode 100644 index 6525a38ec..000000000 --- a/script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", - "delayedWithdrawalRouterImplementation": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x2D6c7f9862BD80Cf0d9d93FC6b513D69E7Db7869", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0xc5B857A92245f64e9D90cCc5b096Db82eB77eB5c", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x76d4D84c90a2AFf213F7D859d2a288685A1a2Ede", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1628654 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/M2_deploy_from_scratch.holesky.config.json b/script/output/holesky/M2_deploy_from_scratch.holesky.config.json deleted file mode 100644 index ab93f31d1..000000000 --- a/script/output/holesky/M2_deploy_from_scratch.holesky.config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", - "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", - "baseStrategyImplementation": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0x642c646053eaf2254f088e9019ACD73d9AE0FA32", - "delayedWithdrawalRouterImplementation": "0xcE8b8D99773a718423F8040a6e52c06a4ce63407", - "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - "delegationManagerImplementation": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", - "eigenLayerPauserReg": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", - "eigenLayerProxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", - "eigenPodBeacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", - "eigenPodImplementation": "0xa6AF55234A9A2B4d4A78d6952cf1Bb216857bE18", - "eigenPodManager": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", - "eigenPodManagerImplementation": "0x5265C162f7d5F3fE3175a78828ab16bf5E324a7B", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", - "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", - "strategies": { - "WETH": "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", - "rETH": "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", - "stETH": "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3" - }, - "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "strategyManagerImplementation": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1167041 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7" - } -} \ No newline at end of file diff --git a/script/output/holesky/M2_deploy_from_scratch.output.json b/script/output/holesky/M2_deploy_from_scratch.output.json deleted file mode 100644 index b1409c010..000000000 --- a/script/output/holesky/M2_deploy_from_scratch.output.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", - "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", - "baseStrategyImplementation": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0x642c646053eaf2254f088e9019ACD73d9AE0FA32", - "delayedWithdrawalRouterImplementation": "0xcE8b8D99773a718423F8040a6e52c06a4ce63407", - "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - "delegationManagerImplementation": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", - "eigenLayerPauserReg": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", - "eigenLayerProxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", - "eigenPodBeacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", - "eigenPodImplementation": "0xe98f9298344527608A1BCC23907B8145F9Cb641c", - "eigenPodManager": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", - "eigenPodManagerImplementation": "0x5265C162f7d5F3fE3175a78828ab16bf5E324a7B", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", - "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", - "numStrategiesDeployed": 10, - "strategies": { - "WETH": "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", - "rETH": "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", - "stETH": "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", - "ETHx": "0x31B6F59e1627cEfC9fA174aD03859fC337666af7", - "cbETH": "0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6", - "sfrxETH": "0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c", - "lsETH": "0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943", - "osETH": "0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef", - "mETH": "0xaccc5A86732BE85b5012e8614AF237801636F8e5", - "ankrETH" :"0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac" - }, - "strategyAddresses": [ - "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", - "0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0", - "0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3", - "0x31B6F59e1627cEfC9fA174aD03859fC337666af7", - "0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6", - "0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c", - "0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943", - "0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef", - "0xaccc5A86732BE85b5012e8614AF237801636F8e5", - "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac" - ], - "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "strategyManagerImplementation": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18", - "rewardsCoordinator": "0x0000000000000000000000000000000000000000", - "rewardsCoordinatorImplementation": "0x0000000000000000000000000000000000000000", - "token": { - "tokenProxyAdmin": "0x67482666771e82C9a73BB9e9A22B2B597f448BBf", - "EIGEN": "0x3B78576F7D6837500bA3De27A60c7f594934027E", - "bEIGEN": "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27", - "EIGENImpl": "0x083bC9e0DCF2C3e13E24686e5202232995578c5a", - "bEIGENImpl": "0x4500927874Ad41538c1bEF2F5278E7a86DF6bce8", - "eigenStrategy": "0x43252609bff8a13dFe5e057097f2f45A24387a84", - "eigenStrategyImpl": "0x94650e09a471CEF96e7966cabf26718FBf352697" - } - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1195642 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} diff --git a/script/output/holesky/M2_deploy_preprod.output.json b/script/output/holesky/M2_deploy_preprod.output.json deleted file mode 100644 index 8428e31ee..000000000 --- a/script/output/holesky/M2_deploy_preprod.output.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", - "delayedWithdrawalRouterImplementation": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x2D6c7f9862BD80Cf0d9d93FC6b513D69E7Db7869", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0xc5B857A92245f64e9D90cCc5b096Db82eB77eB5c", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "numStrategiesDeployed": 0, - "strategies": {}, - "strategyAddresses": [], - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0xC9366ab4A299e0937EC15A6C256C4481C05A24fD", - "token": { - "tokenProxyAdmin": "0x0000000000000000000000000000000000000000", - "EIGEN": "0x0000000000000000000000000000000000000000", - "bEIGEN": "0x0000000000000000000000000000000000000000", - "EIGENImpl": "0x0000000000000000000000000000000000000000", - "bEIGENImpl": "0x0000000000000000000000000000000000000000", - "eigenStrategy": "0x0000000000000000000000000000000000000000", - "eigenStrategyImpl": "0x0000000000000000000000000000000000000000" - } - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1195642 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} diff --git a/script/output/holesky/v040-rc0.output.json b/script/output/holesky/v040-rc0.output.json deleted file mode 100644 index a43d651b2..000000000 --- a/script/output/holesky/v040-rc0.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x537A9Ce71928C9377823ef72C7F898b8d092f520", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x378C459ea6F026D8BF045404d2f3e3451682c6a2", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1805992 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040-rc1.output.json b/script/output/holesky/v040-rc1.output.json deleted file mode 100644 index 283b214ab..000000000 --- a/script/output/holesky/v040-rc1.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0xcd327c3f4C866dA3F3F83218ebA7c478567E7a9E", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x378C459ea6F026D8BF045404d2f3e3451682c6a2", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1851043 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040-rc2.output.json b/script/output/holesky/v040-rc2.output.json deleted file mode 100644 index 1aa28e587..000000000 --- a/script/output/holesky/v040-rc2.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0xd4bbD235e25B44856927aD845611808040EfAb1c", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x378C459ea6F026D8BF045404d2f3e3451682c6a2", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1851632 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040-rc3.output.json b/script/output/holesky/v040-rc3.output.json deleted file mode 100644 index a57217440..000000000 --- a/script/output/holesky/v040-rc3.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x703de9e45801a93bB1Da6DF0865e6B178c438daE", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x378C459ea6F026D8BF045404d2f3e3451682c6a2", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 1987496 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040-rc4.output.json b/script/output/holesky/v040-rc4.output.json deleted file mode 100644 index 2ebaf0c24..000000000 --- a/script/output/holesky/v040-rc4.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0xcB0858aA14d27FE8D255CF0Fa0b8e8977785169a", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0xE59f0a991600788E2bc08c31817124be00520F48", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 2027960 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040-rc5.output.json b/script/output/holesky/v040-rc5.output.json deleted file mode 100644 index 22835e972..000000000 --- a/script/output/holesky/v040-rc5.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", - "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", - "strategies": "", - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 2100862 - }, - "parameters": { - "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/holesky/v040.output.json b/script/output/holesky/v040.output.json deleted file mode 100644 index 47a20c740..000000000 --- a/script/output/holesky/v040.output.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf", - "avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a", - "baseStrategyImplementation": "0xFb83e1D133D0157775eC4F19Ff81478Df1103305", - "delegationManager": "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - "delegationManagerImplementation": "0x83f8F8f0BB125F7870F6bfCf76853f874C330D76", - "eigenLayerPauserReg": "0x85Ef7299F8311B25642679edBF02B62FA2212F06", - "eigenLayerProxyAdmin": "0xDB023566064246399b4AE851197a97729C93A6cf", - "eigenPodBeacon": "0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D", - "eigenPodImplementation": "0x10ad7e30e3F52076C8462D573530f4461377319c", - "eigenPodManager": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", - "eigenPodManagerImplementation": "0x91A6525a4a843F5a5B633905300c33F79413CCc5", - "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", - "rewardsCoordinatorImplementation": "0xe54625095656206AC1B42819875343453c447f97", - "slasher": "0xcAe751b75833ef09627549868A04E32679386e7C", - "slasherImplementation": "0x99715D255E34a39bE9943b82F281CA734bcF345A", - "strategies": "", - "strategyManager": "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6", - "strategyManagerImplementation": "0x59f766A603C53f3AC8Be43bBe158c1519b193a18" - }, - "chainInfo": { - "chainId": 17000, - "deploymentBlock": 2101150 - }, - "parameters": { - "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", - "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", - "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", - "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" - } -} \ No newline at end of file diff --git a/script/output/mainnet/eigenpod_minor_upgrade_deploy.json b/script/output/mainnet/eigenpod_minor_upgrade_deploy.json deleted file mode 100644 index 2d314ab8d..000000000 --- a/script/output/mainnet/eigenpod_minor_upgrade_deploy.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "addresses": { - "eigenPodImplementation": "0x28144C53bA98B4e909Df5bC7cA33eAf0404cFfcc" - }, - "chainInfo": { - "chainId": 1, - "deploymentBlock": 19878127 - } -} \ No newline at end of file diff --git a/script/output/mainnet/v0.3.0-mainnet-rewards.output.json b/script/output/mainnet/v0.3.0-mainnet-rewards.output.json deleted file mode 100644 index f95e5a3a0..000000000 --- a/script/output/mainnet/v0.3.0-mainnet-rewards.output.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "addresses": { - "avsDirectory": "0x135DDa560e946695d6f155dACaFC6f1F25C1F5AF", - "avsDirectoryImplementation": "0xdAbdB3Cd346B7D5F5779b0B614EdE1CC9DcBA5b7", - "baseStrategyImplementation": "0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3", - "beaconOracle": "0x343907185b71aDF0eBa9567538314396aa985442", - "delayedWithdrawalRouter": "0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8", - "delayedWithdrawalRouterImplementation": "0x4bB6731B02314d40aBbfFBC4540f508874014226", - "delegationManager": "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", - "delegationManagerImplementation": "0x1784BE6401339Fc0Fedf7E9379409f5c1BfE9dda", - "eigenLayerPauserReg": "0x0c431C66F4dE941d089625E5B423D00707977060", - "eigenLayerProxyAdmin": "0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444", - "eigenPodBeacon": "0x5a2a4F2F3C18f09179B6703e63D9eDD165909073", - "eigenPodImplementation": "0x28144C53bA98B4e909Df5bC7cA33eAf0404cFfcc", - "eigenPodManager": "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338", - "eigenPodManagerImplementation": "0xe4297e3DaDBc7D99e26a2954820f514CB50C5762", - "emptyContract": "0x1f96861fEFa1065a5A96F20Deb6D8DC3ff48F7f9", - "rewardsCoordinator": "0x7750d328b314EfFa365A0402CcfD489B80B0adda", - "rewardsCoordinatorImplementation": "0x5bf7c13D5FAdba224ECB3D5C0a67A231D1628785", - "slasher": "0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd", - "slasherImplementation": "0xF3234220163a757edf1E11a8a085638D9B236614", - "strategies": "", - "strategyManager": "0x858646372CC42E1A627fcE94aa7A7033e7CF075A", - "strategyManagerImplementation": "0x70f44C13944d49a236E3cD7a94f48f5daB6C619b" - }, - "chainInfo": { - "chainId": 1, - "deploymentBlock": 20341789 - }, - "parameters": { - "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", - "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", - "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", - "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", - "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" - } -} diff --git a/script/releases/release-template/1-eoa.s.sol b/script/releases/release-template/1-eoa.s.sol new file mode 100644 index 000000000..912aa9278 --- /dev/null +++ b/script/releases/release-template/1-eoa.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import {EOADeployer} from "zeus-templates/templates/EOADeployer.sol"; + +contract Deploy is EOADeployer { + Deployment[] private _deployments; + + function _deploy() internal override returns (Deployment[] memory) { + vm.startBroadcast(); + + ////////////////////////// + // deploy your contracts here + ////////////////////////// + + vm.stopBroadcast(); + + return _deployments; + } + + function zeusTest() public override { + // Test function implementation + } +} diff --git a/script/releases/release-template/2-multisig.s.sol b/script/releases/release-template/2-multisig.s.sol new file mode 100644 index 000000000..8b0b88788 --- /dev/null +++ b/script/releases/release-template/2-multisig.s.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import {MultisigCall, MultisigCallUtils, MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol"; +import {ITimelock} from "zeus-templates/interfaces/ITimelock.sol"; + +contract Queue is MultisigBuilder { + using MultisigCallUtils for MultisigCall[]; + + MultisigCall[] private _executorCalls; + MultisigCall[] private _opsCalls; + + function _queue() internal returns (MultisigCall[] memory) { + ////////////////////////// + // construct executor data here + ////////////////////////// + + return _executorCalls; + } + + /** + * @dev Can be overridden so that executing script can inherit this contract. + */ + function _execute() internal virtual override returns (MultisigCall[] memory) { + // get the queue data + MultisigCall[] memory calls = _queue(); + + address multiSendCallOnly = zeusAddress("MultiSendCallOnly"); + address timelock = zeusAddress("Timelock"); + + // encode calls for executor + bytes memory executorCalldata = calls.makeExecutorCalldata(multiSendCallOnly, timelock); + + address executorMultisig = zeusAddress("ExecutorMultisig"); + + // encode executor data for timelock + bytes memory timelockCalldata = abi.encodeWithSelector( + ITimelock.queueTransaction.selector, executorMultisig, 0, "", executorCalldata, type(uint256).max + ); + + _opsCalls.append(timelock, timelockCalldata); + + // encode timelock data for ops multisig + return _opsCalls; + } + + function zeusTest() public override { + // Test function implementation + } +} diff --git a/script/releases/release-template/3-multisig.s.sol b/script/releases/release-template/3-multisig.s.sol new file mode 100644 index 000000000..a77f4df6c --- /dev/null +++ b/script/releases/release-template/3-multisig.s.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import {MultisigCall, MultisigCallUtils, MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol"; +import {SafeTx, SafeTxUtils} from "zeus-templates/utils/SafeTxUtils.sol"; +import {ITimelock} from "zeus-templates/interfaces/ITimelock.sol"; +import {Queue} from "./2-multisig.s.sol"; + +contract Execute is Queue { + using MultisigCallUtils for MultisigCall[]; + using SafeTxUtils for SafeTx; + + MultisigCall[] private _opsCalls; + + /** + * @dev Overrides the previous _execute function to execute the queued transactions. + */ + function _execute() internal override returns (MultisigCall[] memory) { + MultisigCall[] memory _executorCalls = _queue(); + + address multiSendCallOnly = zeusAddress("MultiSendCallOnly"); + address timelock = zeusAddress("Timelock"); + + bytes memory executorCalldata = _executorCalls.makeExecutorCalldata(multiSendCallOnly, timelock); + + // execute queued transaction + _opsCalls.append({ + to: timelock, + value: 0, + data: abi.encodeWithSelector(ITimelock.executeTransaction.selector, executorCalldata) + }); + + ////////////////////////// + // add more opsCalls here + ////////////////////////// + + return _opsCalls; + } +} diff --git a/script/releases/release-template/README.md b/script/releases/release-template/README.md new file mode 100644 index 000000000..1e1575c37 --- /dev/null +++ b/script/releases/release-template/README.md @@ -0,0 +1,19 @@ +# Release Template + +This template is an example of the deploy-queue-upgrade structure that can be used for executing EigenLayer upgrades via the Ops Timelock Multisig, as described [here](https://docs.eigenlayer.xyz/eigenlayer/security/multisig-governance). + +Zeus can take this template and instantiate a new release template, allowing for quick setup of a common upgrade process. + +Note that the names follow the syntax `#-`, where `#` is the sequence number within the release (i.e. the order in which actions are taken), and `` is the signing strategy to be used for that script. + +## 1-eoa.s.sol + +This contract allows for deployments to be broadcast. An EOA is expected to take these actions. + +## 2-multisig.s.sol + +This contract allows for actions to be written from the perspective of the Executor Multisig, which will then be wrapped for the Timelock, then for the Ops Multisig to execute. + +## 3-multisig.s.sol + +The final execution step can be written in this contract. It will reuse the logic from the previous step by importing the contract, then allow for additional calls to be appended from the perspective of the Ops Multisig. \ No newline at end of file diff --git a/script/releases/v0.1-eigenpod-example/.env.example b/script/releases/v0.1-eigenpod-example/.env.example new file mode 100644 index 000000000..2cd181039 --- /dev/null +++ b/script/releases/v0.1-eigenpod-example/.env.example @@ -0,0 +1,13 @@ +ZEUS_DEPLOYED_ethPOS="0x4242424242424242424242424242424242424242" +ZEUS_ENV_EIGENPOD_GENESIS_TIME="1695902400" + +ZEUS_DEPLOYED_EigenPodManager_pendingImpl="0x10EBa780CCd9E5e9FFBe529C25046c076Be91048" +ZEUS_DEPLOYED_OperationsMultisig="0xDA29BB71669f46F2a779b4b62f03644A84eE3479" +ZEUS_DEPLOYED_PauserRegistry="0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1" +ZEUS_DEPLOYED_ProxyAdmin="0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" +ZEUS_DEPLOYED_EigenPodManager_proxy="0xB8d8952f572e67B11e43bC21250967772fa883Ff" +ZEUS_DEPLOYED_EigenPod_beacon="0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC" +ZEUS_DEPLOYED_EigenPod_pendingImpl="0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38" +ZEUS_DEPLOYED_MultiSendCallOnly="0x40A2aCCbd92BCA938b02010E17A5b8929b49130D" +ZEUS_DEPLOYED_Timelock="0x0000000000000000000000000000000000000000" +ZEUS_DEPLOYED_ExecutorMultisig="0xDA29BB71669f46F2a779b4b62f03644A84eE3479" \ No newline at end of file diff --git a/script/releases/v0.1-eigenpod-example/1-eoa.s.sol b/script/releases/v0.1-eigenpod-example/1-eoa.s.sol new file mode 100644 index 000000000..0e7c59244 --- /dev/null +++ b/script/releases/v0.1-eigenpod-example/1-eoa.s.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "zeus-templates/templates/EOADeployer.sol"; + +import "src/contracts/pods/EigenPod.sol"; +import "src/contracts/pods/EigenPodManager.sol"; +import "src/contracts/interfaces/IEigenPodManager.sol"; + +import "zeus-templates/utils/StringUtils.sol"; + +contract DeployEigenPodAndManager is EOADeployer { + using StringUtils for string; + + Deployment[] private _deployments; + + /// @notice deploys an EigenPod and returns the deployed address + function _deploy() internal override returns (Deployment[] memory) { + vm.startBroadcast(); + + // create a defunct EigenPodManager + address newEigenPodManager = address( + new EigenPodManager( + IETHPOSDeposit(address(1)), + IBeacon(address(2)), + IStrategyManager(address(3)), + ISlasher(address(4)), + IDelegationManager(address(5)) + ) + ); + + _deployments.push(singleton(newEigenPodManager)); + + address newEigenPod = address( + new EigenPod( + IETHPOSDeposit(_ethPos()), + IEigenPodManager(newEigenPodManager), // update EigenPodManager address + getUint64("EIGENPOD_GENESIS_TIME") // set genesis time + ) + ); + + // create and record new EigenPod pointing to defunct EigenPodManager + _deployments.push(singleton(newEigenPod)); + + vm.stopBroadcast(); + + return _deployments; + } + + function zeusTest() public override { + _deploy(); + + Deployment memory eigenPodManager = _deployments[0]; + Deployment memory eigenPod = _deployments[1]; + + require(eigenPodManager.deployedTo != address(0), "EigenPodManager deployment failed"); + + require(eigenPod.deployedTo != address(0), "EigenPod deployment failed"); + } +} diff --git a/script/releases/v0.1-eigenpod-example/2-multisig.s.sol b/script/releases/v0.1-eigenpod-example/2-multisig.s.sol new file mode 100644 index 000000000..54450ea6e --- /dev/null +++ b/script/releases/v0.1-eigenpod-example/2-multisig.s.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import {MultisigCall, MultisigCallUtils, MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol"; +import {SafeTx, SafeTxUtils} from "zeus-templates/utils/SafeTxUtils.sol"; + +import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import {IUpgradeableBeacon} from "script/interfaces/IUpgradeableBeacon.sol"; +import {ITimelock} from "zeus-templates/interfaces/ITimelock.sol"; +import "src/contracts/pods/EigenPodManager.sol"; + +contract QueueEigenPodAndManager is MultisigBuilder { + using MultisigCallUtils for MultisigCall[]; + using SafeTxUtils for SafeTx; + + MultisigCall[] private _executorCalls; + MultisigCall[] private _opsCalls; + + function _queue() internal returns (MultisigCall[] memory) { + // construct initialization data for eigenPodManager + bytes memory eigenPodManagerData = abi.encodeWithSelector( + EigenPodManager.initialize.selector, + _operationsMultisig(), // set opsMultisig as new direct owner + _pauserRegistry(), // set pauser registry + uint256(0) // set all 0 bits, nothing paused + ); + + // upgrade eigenPodManager + _executorCalls.append({ + to: _proxyAdmin(), + data: abi.encodeWithSelector( + ProxyAdmin.upgradeAndCall.selector, + _eigenPodManagerProxy(), + _eigenPodManagerPendingImpl(), + eigenPodManagerData // initialize impl here + ) + }); + + // upgrade eigenPod beacon implementation + _executorCalls.append({ + to: _eigenPodBeacon(), + data: abi.encodeWithSelector(IUpgradeableBeacon.upgradeTo.selector, _eigenPodPendingImpl()) + }); + + return _executorCalls; + } + + function _execute() internal virtual override returns (MultisigCall[] memory) { + // get the queue data + MultisigCall[] memory calls = _queue(); + + // encode calls for executor + bytes memory executorCalldata = calls.makeExecutorCalldata(_multiSendCallOnly(), _timelock()); + + // encode executor data for timelock + bytes memory timelockCalldata = abi.encodeWithSelector( + ITimelock.queueTransaction.selector, _executorMultisig(), 0, "", executorCalldata, type(uint256).max + ); + + _opsCalls.append(_timelock(), timelockCalldata); + + // encode timelock data for ops multisig + return _opsCalls; + } + + function zeusTest() public virtual override { + // Test function implementation + } +} diff --git a/script/releases/v0.1-eigenpod-example/3-multisig.s.sol b/script/releases/v0.1-eigenpod-example/3-multisig.s.sol new file mode 100644 index 000000000..028fa669f --- /dev/null +++ b/script/releases/v0.1-eigenpod-example/3-multisig.s.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import {MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol"; + +import "src/contracts/pods/EigenPodManager.sol"; + +import "./2-multisig.s.sol"; + +contract ExecuteEigenPodAndManager is QueueEigenPodAndManager { + using MultisigCallUtils for MultisigCall[]; + using SafeTxUtils for *; + + MultisigCall[] private _multisigCalls; + + function _execute() internal override returns (MultisigCall[] memory) { + MultisigCall[] memory _executorCalls = _queue(); + + // steals logic from queue() to perform execute() + // likely the first step of any _execute() after a _queue() + bytes memory executorCalldata = _executorCalls.makeExecutorCalldata(_multiSendCallOnly(), _timelock()); + + // execute queued transaction upgrading eigenPodManager and eigenPod + _multisigCalls.append({ + to: _timelock(), + value: 0, + data: abi.encodeWithSelector(ITimelock.executeTransaction.selector, executorCalldata) + }); + + // after queued transaction, renounce ownership from eigenPodManager + _multisigCalls.append({ + to: _eigenPodManagerProxy(), + value: 0, + data: abi.encodeWithSelector(EigenPodManager(_eigenPodManagerProxy()).renounceOwnership.selector) + }); + + return _multisigCalls; + } + + function zeusTest() public override { + // Test function implementation + } +} diff --git a/script/releases/v0.1-eigenpod-example/README.md b/script/releases/v0.1-eigenpod-example/README.md new file mode 100644 index 000000000..250e3b74b --- /dev/null +++ b/script/releases/v0.1-eigenpod-example/README.md @@ -0,0 +1,65 @@ +# v0.1-eigenpod-example + +This is an example of how to write a deploy-queue-upgrade series of scripts using [Zeus](https://github.com/Layr-Labs/zeus). **THIS IS PURELY DEMONSTRATIVE. DO NOT USE THIS FOR PRODUCTION PURPOSES.** + +## How to Run + +To begin, run the following command from this directory: + +```sh +export $(cat .env.example | xargs) +``` + +This will populate your environment with example environment variables. + +If running with Zeus, then Zeus should auto-populate your environment for you, and this step is not necessary. + +### Commands + +For the deploy script (the first script), run: + +```sh +forge script 1-eoa.s.sol -s "deploy()" +``` + +You can expect an output similar to: + +```txt +Script ran successfully. +Gas used: 6407912 + +== Return == +0: struct EOADeployer.Deployment[] [Deployment({ deployedTo: 0x90193C961A926261B756D1E5bb255e67ff9498A1, overrideName: "", singleton: true }), Deployment({ deployedTo: 0xA8452Ec99ce0C64f20701dB7dD3abDb607c00496, overrideName: "", singleton: true })] +``` + +To run the queue script (the second script), run: + +```sh +forge script script/releases/v0.1-eigenpod-example/2-multisig.s.sol -s "execute()" +``` + +Example output: + +```txt +Script ran successfully. +Gas used: 1005076 + +== Return == +0: struct SafeTx SafeTx({ to: 0x40A2aCCbd92BCA938b02010E17A5b8929b49130D, value: 0, data: 0x8d80ff0a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000419000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c43a66f901000000000000000000000000da29bb71669f46f2a779b4b62f03644a84ee3479000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c48d80ff0a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000040a2accbd92bca938b02010e17a5b8929b49130d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002248d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001d2001bef05c7303d44e0e2fcd2a19d993eded4c51b5b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001049623609d000000000000000000000000b8d8952f572e67b11e43bc21250967772fa883ff00000000000000000000000010eba780ccd9e5e9ffbe529c25046c076be91048000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000641794bb3c000000000000000000000000da29bb71669f46f2a779b4b62f03644a84ee34790000000000000000000000009ab2feaf0465f0ed51fc2b663ef228b418c9dad10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092cc4a800a1513e85c481dddf3a06c6921211eac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000008da4b953cbfb715624d98c0d2b4a7978462efd380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, op: 1 }) +``` + +For the execute step (the third step), run: + +```sh +forge script script/releases/v0.1-eigenpod-example/3-multisig.s.sol -s "execute()" +``` + +Example output: + +```txt +Script ran successfully. +Gas used: 984745 + +== Return == +0: struct SafeTx SafeTx({ to: 0x40A2aCCbd92BCA938b02010E17A5b8929b49130D, value: 0, data: 0x8d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003d2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003240825f38f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002c48d80ff0a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000040a2accbd92bca938b02010e17a5b8929b49130d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002248d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001d2001bef05c7303d44e0e2fcd2a19d993eded4c51b5b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001049623609d000000000000000000000000b8d8952f572e67b11e43bc21250967772fa883ff00000000000000000000000010eba780ccd9e5e9ffbe529c25046c076be91048000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000641794bb3c000000000000000000000000da29bb71669f46f2a779b4b62f03644a84ee34790000000000000000000000009ab2feaf0465f0ed51fc2b663ef228b418c9dad10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092cc4a800a1513e85c481dddf3a06c6921211eac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243659cfe60000000000000000000000008da4b953cbfb715624d98c0d2b4a7978462efd380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b8d8952f572e67b11e43bc21250967772fa883ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004715018a60000000000000000000000000000, op: 1 }) +``` \ No newline at end of file diff --git a/script/utils/ExistingDeploymentParser.sol b/script/utils/ExistingDeploymentParser.sol index c0b2c71f3..af725f030 100644 --- a/script/utils/ExistingDeploymentParser.sol +++ b/script/utils/ExistingDeploymentParser.sol @@ -129,7 +129,9 @@ contract ExistingDeploymentParser is Script, Test { uint256 STRATEGY_MAX_TOTAL_DEPOSITS; /// @notice use for parsing already deployed EigenLayer contracts - function _parseDeployedContracts(string memory existingDeploymentInfoPath) internal virtual { + function _parseDeployedContracts( + string memory existingDeploymentInfoPath + ) internal virtual { // read and log the chainID uint256 currentChainId = block.chainid; emit log_named_uint("You are parsing on ChainID", currentChainId); @@ -151,51 +153,38 @@ contract ExistingDeploymentParser is Script, Test { pauserMultisig = stdJson.readAddress(existingDeploymentData, ".parameters.pauserMultisig"); timelock = stdJson.readAddress(existingDeploymentData, ".parameters.timelock"); - eigenLayerProxyAdmin = ProxyAdmin( - stdJson.readAddress(existingDeploymentData, ".addresses.eigenLayerProxyAdmin") - ); - eigenLayerPauserReg = PauserRegistry( - stdJson.readAddress(existingDeploymentData, ".addresses.eigenLayerPauserReg") - ); + eigenLayerProxyAdmin = + ProxyAdmin(stdJson.readAddress(existingDeploymentData, ".addresses.eigenLayerProxyAdmin")); + eigenLayerPauserReg = + PauserRegistry(stdJson.readAddress(existingDeploymentData, ".addresses.eigenLayerPauserReg")); slasher = Slasher(stdJson.readAddress(existingDeploymentData, ".addresses.slasher")); - slasherImplementation = Slasher( - stdJson.readAddress(existingDeploymentData, ".addresses.slasherImplementation") - ); - delegationManager = DelegationManager( - stdJson.readAddress(existingDeploymentData, ".addresses.delegationManager") - ); - delegationManagerImplementation = DelegationManager( - stdJson.readAddress(existingDeploymentData, ".addresses.delegationManagerImplementation") - ); + slasherImplementation = Slasher(stdJson.readAddress(existingDeploymentData, ".addresses.slasherImplementation")); + delegationManager = + DelegationManager(stdJson.readAddress(existingDeploymentData, ".addresses.delegationManager")); + delegationManagerImplementation = + DelegationManager(stdJson.readAddress(existingDeploymentData, ".addresses.delegationManagerImplementation")); avsDirectory = AVSDirectory(stdJson.readAddress(existingDeploymentData, ".addresses.avsDirectory")); - avsDirectoryImplementation = AVSDirectory( - stdJson.readAddress(existingDeploymentData, ".addresses.avsDirectoryImplementation") - ); - rewardsCoordinator = RewardsCoordinator( - stdJson.readAddress(existingDeploymentData, ".addresses.rewardsCoordinator") - ); + avsDirectoryImplementation = + AVSDirectory(stdJson.readAddress(existingDeploymentData, ".addresses.avsDirectoryImplementation")); + rewardsCoordinator = + RewardsCoordinator(stdJson.readAddress(existingDeploymentData, ".addresses.rewardsCoordinator")); rewardsCoordinatorImplementation = RewardsCoordinator( stdJson.readAddress(existingDeploymentData, ".addresses.rewardsCoordinatorImplementation") ); strategyManager = StrategyManager(stdJson.readAddress(existingDeploymentData, ".addresses.strategyManager")); - strategyManagerImplementation = StrategyManager( - stdJson.readAddress(existingDeploymentData, ".addresses.strategyManagerImplementation") - ); + strategyManagerImplementation = + StrategyManager(stdJson.readAddress(existingDeploymentData, ".addresses.strategyManagerImplementation")); strategyFactory = StrategyFactory(stdJson.readAddress(existingDeploymentData, ".addresses.strategyFactory")); - strategyFactoryImplementation = StrategyFactory( - stdJson.readAddress(existingDeploymentData, ".addresses.strategyFactoryImplementation") - ); + strategyFactoryImplementation = + StrategyFactory(stdJson.readAddress(existingDeploymentData, ".addresses.strategyFactoryImplementation")); eigenPodManager = EigenPodManager(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodManager")); - eigenPodManagerImplementation = EigenPodManager( - stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodManagerImplementation") - ); + eigenPodManagerImplementation = + EigenPodManager(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodManagerImplementation")); eigenPodBeacon = UpgradeableBeacon(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodBeacon")); - eigenPodImplementation = EigenPod( - payable(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodImplementation")) - ); - baseStrategyImplementation = StrategyBase( - stdJson.readAddress(existingDeploymentData, ".addresses.baseStrategyImplementation") - ); + eigenPodImplementation = + EigenPod(payable(stdJson.readAddress(existingDeploymentData, ".addresses.eigenPodImplementation"))); + baseStrategyImplementation = + StrategyBase(stdJson.readAddress(existingDeploymentData, ".addresses.baseStrategyImplementation")); emptyContract = EmptyContract(stdJson.readAddress(existingDeploymentData, ".addresses.emptyContract")); // Strategies Deployed, load strategy list @@ -216,10 +205,13 @@ contract ExistingDeploymentParser is Script, Test { bEIGEN = IBackingEigen(stdJson.readAddress(existingDeploymentData, ".addresses.token.bEIGEN")); bEIGENImpl = IBackingEigen(stdJson.readAddress(existingDeploymentData, ".addresses.token.bEIGENImpl")); eigenStrategy = EigenStrategy(stdJson.readAddress(existingDeploymentData, ".addresses.token.eigenStrategy")); - eigenStrategyImpl = EigenStrategy(stdJson.readAddress(existingDeploymentData, ".addresses.token.eigenStrategyImpl")); + eigenStrategyImpl = + EigenStrategy(stdJson.readAddress(existingDeploymentData, ".addresses.token.eigenStrategyImpl")); } - function _parseDeployedEigenPods(string memory existingDeploymentInfoPath) internal returns (DeployedEigenPods memory) { + function _parseDeployedEigenPods( + string memory existingDeploymentInfoPath + ) internal returns (DeployedEigenPods memory) { uint256 currentChainId = block.chainid; // READ JSON CONFIG DATA @@ -242,7 +234,9 @@ contract ExistingDeploymentParser is Script, Test { /// @notice use for deploying a new set of EigenLayer contracts /// Note that this does require multisigs to already be deployed - function _parseInitialDeploymentParams(string memory initialDeploymentParamsPath) internal virtual { + function _parseInitialDeploymentParams( + string memory initialDeploymentParamsPath + ) internal virtual { // read and log the chainID uint256 currentChainId = block.chainid; emit log_named_uint("You are parsing on ChainID", currentChainId); @@ -275,56 +269,47 @@ contract ExistingDeploymentParser is Script, Test { bytes memory tokenInfoBytes = stdJson.parseRaw(initialDeploymentData, key); // Decode the token information into the Token struct - StrategyUnderlyingTokenConfig memory tokenInfo = abi.decode( - tokenInfoBytes, - (StrategyUnderlyingTokenConfig) - ); + StrategyUnderlyingTokenConfig memory tokenInfo = abi.decode(tokenInfoBytes, (StrategyUnderlyingTokenConfig)); strategiesToDeploy.push(tokenInfo); } // Read initialize params for upgradeable contracts - STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint( - initialDeploymentData, - ".strategyManager.init_paused_status" - ); - STRATEGY_MANAGER_WHITELISTER = stdJson.readAddress( - initialDeploymentData, - ".strategyManager.init_strategy_whitelister" - ); + STRATEGY_MANAGER_INIT_PAUSED_STATUS = + stdJson.readUint(initialDeploymentData, ".strategyManager.init_paused_status"); + STRATEGY_MANAGER_WHITELISTER = + stdJson.readAddress(initialDeploymentData, ".strategyManager.init_strategy_whitelister"); // Slasher SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(initialDeploymentData, ".slasher.init_paused_status"); // DelegationManager - DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS = stdJson.readUint( - initialDeploymentData, - ".delegationManager.init_minWithdrawalDelayBlocks" - ); - DELEGATION_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint( - initialDeploymentData, - ".delegationManager.init_paused_status" - ); + DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS = + stdJson.readUint(initialDeploymentData, ".delegationManager.init_minWithdrawalDelayBlocks"); + DELEGATION_MANAGER_INIT_PAUSED_STATUS = + stdJson.readUint(initialDeploymentData, ".delegationManager.init_paused_status"); // RewardsCoordinator - REWARDS_COORDINATOR_INIT_PAUSED_STATUS = stdJson.readUint( - initialDeploymentData, - ".rewardsCoordinator.init_paused_status" - ); - REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.CALCULATION_INTERVAL_SECONDS")); - REWARDS_COORDINATOR_MAX_REWARDS_DURATION = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_REWARDS_DURATION")); - REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_RETROACTIVE_LENGTH")); - REWARDS_COORDINATOR_MAX_FUTURE_LENGTH = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_FUTURE_LENGTH")); - REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP")); - REWARDS_COORDINATOR_UPDATER = stdJson.readAddress(initialDeploymentData, ".rewardsCoordinator.rewards_updater_address"); - REWARDS_COORDINATOR_ACTIVATION_DELAY = uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.activation_delay")); - REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32( - stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.global_operator_commission_bips") - ); + REWARDS_COORDINATOR_INIT_PAUSED_STATUS = + stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.init_paused_status"); + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.CALCULATION_INTERVAL_SECONDS")); + REWARDS_COORDINATOR_MAX_REWARDS_DURATION = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_REWARDS_DURATION")); + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_RETROACTIVE_LENGTH")); + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.MAX_FUTURE_LENGTH")); + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP")); + REWARDS_COORDINATOR_UPDATER = + stdJson.readAddress(initialDeploymentData, ".rewardsCoordinator.rewards_updater_address"); + REWARDS_COORDINATOR_ACTIVATION_DELAY = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.activation_delay")); + REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = + uint32(stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.global_operator_commission_bips")); // AVSDirectory AVS_DIRECTORY_INIT_PAUSED_STATUS = stdJson.readUint(initialDeploymentData, ".avsDirectory.init_paused_status"); // EigenPodManager - EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint( - initialDeploymentData, - ".eigenPodManager.init_paused_status" - ); + EIGENPOD_MANAGER_INIT_PAUSED_STATUS = + stdJson.readUint(initialDeploymentData, ".eigenPodManager.init_paused_status"); // EigenPod EIGENPOD_GENESIS_TIME = uint64(stdJson.readUint(initialDeploymentData, ".eigenPod.GENESIS_TIME")); ETHPOSDepositAddress = stdJson.readAddress(initialDeploymentData, ".ethPOSDepositAddress"); @@ -336,8 +321,7 @@ contract ExistingDeploymentParser is Script, Test { function _verifyContractPointers() internal view virtual { // AVSDirectory require( - avsDirectory.delegation() == delegationManager, - "avsDirectory: delegationManager address not set correctly" + avsDirectory.delegation() == delegationManager, "avsDirectory: delegationManager address not set correctly" ); // RewardsCoordinator require( @@ -391,8 +375,8 @@ contract ExistingDeploymentParser is Script, Test { /// @notice verify implementations for Transparent Upgradeable Proxies function _verifyImplementations() internal view virtual { require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(avsDirectory)))) == - address(avsDirectoryImplementation), + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(avsDirectory)))) + == address(avsDirectoryImplementation), "avsDirectory: implementation set incorrectly" ); require( @@ -408,20 +392,18 @@ contract ExistingDeploymentParser is Script, Test { "delegationManager: implementation set incorrectly" ); require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(strategyManager))) - ) == address(strategyManagerImplementation), + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(strategyManager)))) + == address(strategyManagerImplementation), "strategyManager: implementation set incorrectly" ); require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) == - address(slasherImplementation), + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) + == address(slasherImplementation), "slasher: implementation set incorrectly" ); require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(eigenPodManager))) - ) == address(eigenPodManagerImplementation), + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(eigenPodManager)))) + == address(eigenPodManagerImplementation), "eigenPodManager: implementation set incorrectly" ); @@ -445,7 +427,15 @@ contract ExistingDeploymentParser is Script, Test { * initialization params if this is the first deployment. * @dev isInitialDeployment True if this is the first deployment of contracts from scratch */ - function _verifyContractsInitialized(bool /** isInitialDeployment **/) internal virtual { + function _verifyContractsInitialized( + bool + ) + /** + * isInitialDeployment * + */ + internal + virtual + { // AVSDirectory vm.expectRevert(bytes("Initializable: contract is already initialized")); avsDirectory.initialize(address(0), eigenLayerPauserReg, AVS_DIRECTORY_INIT_PAUSED_STATUS); @@ -476,19 +466,12 @@ contract ExistingDeploymentParser is Script, Test { strategyManager.initialize(address(0), address(0), eigenLayerPauserReg, STRATEGY_MANAGER_INIT_PAUSED_STATUS); // EigenPodManager vm.expectRevert(bytes("Initializable: contract is already initialized")); - eigenPodManager.initialize( - address(0), - eigenLayerPauserReg, - EIGENPOD_MANAGER_INIT_PAUSED_STATUS - ); + eigenPodManager.initialize(address(0), eigenLayerPauserReg, EIGENPOD_MANAGER_INIT_PAUSED_STATUS); // Strategies for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { vm.expectRevert(bytes("Initializable: contract is already initialized")); StrategyBaseTVLLimits(address(deployedStrategyArray[i])).initialize( - 0, - 0, - IERC20(address(0)), - eigenLayerPauserReg + 0, 0, IERC20(address(0)), eigenLayerPauserReg ); } } @@ -496,10 +479,7 @@ contract ExistingDeploymentParser is Script, Test { /// @notice Verify params based on config constants that are updated from calling `_parseInitialDeploymentParams` function _verifyInitializationParams() internal view virtual { // AVSDirectory - require( - avsDirectory.pauserRegistry() == eigenLayerPauserReg, - "avsdirectory: pauser registry not set correctly" - ); + require(avsDirectory.pauserRegistry() == eigenLayerPauserReg, "avsdirectory: pauser registry not set correctly"); require(avsDirectory.owner() == executorMultisig, "avsdirectory: owner not set correctly"); require( avsDirectory.paused() == AVS_DIRECTORY_INIT_PAUSED_STATUS, @@ -579,12 +559,12 @@ contract ExistingDeploymentParser is Script, Test { strategyManager.strategyWhitelister() == address(strategyFactory), "strategyManager: strategyWhitelister not set correctly" ); - } else if (block.chainid == 17000) { + } else if (block.chainid == 17_000) { // On holesky, for ease of whitelisting we set to executorMultisig // require( // strategyManager.strategyWhitelister() == executorMultisig, // "strategyManager: strategyWhitelister not set correctly" - // ); + // ); } // EigenPodManager require( @@ -617,10 +597,7 @@ contract ExistingDeploymentParser is Script, Test { deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, "StrategyBaseTVLLimits: pauser registry not set correctly" ); - require( - deployedStrategyArray[i].paused() == 0, - "StrategyBaseTVLLimits: init paused status set incorrectly" - ); + require(deployedStrategyArray[i].paused() == 0, "StrategyBaseTVLLimits: init paused status set incorrectly"); require( strategyManager.strategyIsWhitelistedForDeposit(deployedStrategyArray[i]), "StrategyBaseTVLLimits: strategy should be whitelisted" @@ -646,8 +623,7 @@ contract ExistingDeploymentParser is Script, Test { emit log_named_address("STRATEGY_MANAGER_WHITELISTER", STRATEGY_MANAGER_WHITELISTER); emit log_named_uint("SLASHER_INIT_PAUSED_STATUS", SLASHER_INIT_PAUSED_STATUS); emit log_named_uint( - "DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS", - DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS + "DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS", DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS ); emit log_named_uint("DELEGATION_MANAGER_INIT_PAUSED_STATUS", DELEGATION_MANAGER_INIT_PAUSED_STATUS); emit log_named_uint("AVS_DIRECTORY_INIT_PAUSED_STATUS", AVS_DIRECTORY_INIT_PAUSED_STATUS); @@ -672,16 +648,16 @@ contract ExistingDeploymentParser is Script, Test { /** * @notice Log contract addresses and write to output json file */ - function logAndOutputContractAddresses(string memory outputPath) public { + function logAndOutputContractAddresses( + string memory outputPath + ) public { // WRITE JSON DATA string memory parent_object = "parent object"; string memory deployed_strategies = "strategies"; for (uint256 i = 0; i < numStrategiesToDeploy; ++i) { vm.serializeAddress( - deployed_strategies, - strategiesToDeploy[i].tokenSymbol, - address(deployedStrategyArray[i]) + deployed_strategies, strategiesToDeploy[i].tokenSymbol, address(deployedStrategyArray[i]) ); } string memory deployed_strategies_output = numStrategiesToDeploy == 0 @@ -701,37 +677,22 @@ contract ExistingDeploymentParser is Script, Test { vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); vm.serializeAddress(deployed_addresses, "delegationManager", address(delegationManager)); vm.serializeAddress( - deployed_addresses, - "delegationManagerImplementation", - address(delegationManagerImplementation) + deployed_addresses, "delegationManagerImplementation", address(delegationManagerImplementation) ); vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); - vm.serializeAddress( - deployed_addresses, - "strategyManagerImplementation", - address(strategyManagerImplementation) - ); + vm.serializeAddress(deployed_addresses, "strategyManagerImplementation", address(strategyManagerImplementation)); vm.serializeAddress(deployed_addresses, "rewardsCoordinator", address(rewardsCoordinator)); vm.serializeAddress( - deployed_addresses, - "rewardsCoordinatorImplementation", - address(rewardsCoordinatorImplementation) + deployed_addresses, "rewardsCoordinatorImplementation", address(rewardsCoordinatorImplementation) ); vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); - vm.serializeAddress( - deployed_addresses, - "eigenPodManagerImplementation", - address(eigenPodManagerImplementation) - ); + vm.serializeAddress(deployed_addresses, "eigenPodManagerImplementation", address(eigenPodManagerImplementation)); vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); vm.serializeAddress(deployed_addresses, "eigenPodImplementation", address(eigenPodImplementation)); vm.serializeAddress(deployed_addresses, "baseStrategyImplementation", address(baseStrategyImplementation)); vm.serializeAddress(deployed_addresses, "emptyContract", address(emptyContract)); - string memory deployed_addresses_output = vm.serializeString( - deployed_addresses, - "strategies", - deployed_strategies_output - ); + string memory deployed_addresses_output = + vm.serializeString(deployed_addresses, "strategies", deployed_strategies_output); string memory parameters = "parameters"; vm.serializeAddress(parameters, "executorMultisig", executorMultisig); diff --git a/script/utils/Multisend.sol b/script/utils/Multisend.sol deleted file mode 100644 index 72637959a..000000000 --- a/script/utils/Multisend.sol +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-only -pragma solidity >=0.7.0 <0.9.0; - -/// @title Multi Send Call Only - Allows to batch multiple transactions into one, but only calls -/// @author Stefan George - -/// @author Richard Meissner - -/// @notice The guard logic is not required here as this contract doesn't support nested delegate calls -contract MultiSendCallOnly { - /// @dev Sends multiple transactions and reverts all if one fails. - /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of - /// operation has to be uint8(0) in this version (=> 1 byte), - /// to as a address (=> 20 bytes), - /// value as a uint256 (=> 32 bytes), - /// data length as a uint256 (=> 32 bytes), - /// data as bytes. - /// see abi.encodePacked for more information on packed encoding - /// @notice The code is for most part the same as the normal MultiSend (to keep compatibility), - /// but reverts if a transaction tries to use a delegatecall. - /// @notice This method is payable as delegatecalls keep the msg.value from the previous call - /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise - function multiSend(bytes memory transactions) public payable { - // solhint-disable-next-line no-inline-assembly - assembly { - let length := mload(transactions) - let i := 0x20 - for { - // Pre block is not used in "while mode" - } lt(i, length) { - // Post block is not used in "while mode" - } { - // First byte of the data is the operation. - // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word). - // This will also zero out unused data. - let operation := shr(0xf8, mload(add(transactions, i))) - // We offset the load address by 1 byte (operation byte) - // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data. - let to := shr(0x60, mload(add(transactions, add(i, 0x01)))) - // We offset the load address by 21 byte (operation byte + 20 address bytes) - let value := mload(add(transactions, add(i, 0x15))) - // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes) - let dataLength := mload(add(transactions, add(i, 0x35))) - // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes) - let data := add(transactions, add(i, 0x55)) - let success := 0 - switch operation - case 0 { - success := call(gas(), to, value, data, dataLength, 0, 0) - } - // This version does not allow delegatecalls - case 1 { - revert(0, 0) - } - if eq(success, 0) { - revert(0, 0) - } - // Next entry starts at 85 byte + data length - i := add(i, add(0x55, dataLength)) - } - } - } -} \ No newline at end of file diff --git a/script/utils/TimelockEncoding.sol b/script/utils/TimelockEncoding.sol deleted file mode 100644 index cbb0c8da3..000000000 --- a/script/utils/TimelockEncoding.sol +++ /dev/null @@ -1,108 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "forge-std/Script.sol"; -import "forge-std/Test.sol"; - -import "./TxEncodingInterfaces.sol"; - -contract TimelockEncoding is Test { - // CALLDATA FOR CALL FROM TIMELOCK TO EXECUTOR MULTISIG - uint256 safeTxGas = 0; - uint256 baseGas = 0; - uint256 gasPrice = 0; - address gasToken = address(uint160(0)); - address payable refundReceiver = payable(address(uint160(0))); - - // CALDATA FOR CALL TO TIMELOCK - uint256 timelockValue = 0; - // empty string, just encode all the data in 'timelockData' - string timelockSignature; - - // appropriate address on mainnet, Holesky, and many other chains - address multiSendCallOnly = 0x40A2aCCbd92BCA938b02010E17A5b8929b49130D; - - function encodeForTimelock( - address to, - uint256 value, - bytes memory data, - uint256 timelockEta - ) public returns (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) { - calldata_to_timelock_queuing_action = abi.encodeWithSelector(ITimelock.queueTransaction.selector, - to, - value, - timelockSignature, - data, - timelockEta - ); - - emit log_named_bytes("calldata_to_timelock_queuing_action", calldata_to_timelock_queuing_action); - - calldata_to_timelock_executing_action = abi.encodeWithSelector(ITimelock.executeTransaction.selector, - to, - value, - timelockSignature, - data, - timelockEta - ); - - emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); - - return (calldata_to_timelock_queuing_action, calldata_to_timelock_executing_action); - } - - function encodeForExecutor( - address from, - address to, - uint256 value, - bytes memory data, - ISafe.Operation operation - ) public returns (bytes memory) { - // encode the "signature" required by the Safe - bytes1 v = bytes1(uint8(1)); - bytes32 r = bytes32(uint256(uint160(from))); - bytes32 s; - bytes memory sig = abi.encodePacked(r,s,v); - emit log_named_bytes("sig", sig); - - bytes memory final_calldata_to_executor_multisig = abi.encodeWithSelector(ISafe.execTransaction.selector, - to, - value, - data, - operation, - safeTxGas, - baseGas, - gasPrice, - gasToken, - refundReceiver, - sig - ); - - emit log_named_bytes("final_calldata_to_executor_multisig", final_calldata_to_executor_multisig); - - return final_calldata_to_executor_multisig; - } - - struct Tx { - address to; - uint256 value; - bytes data; - } - - function encodeMultisendTxs(Tx[] memory txs) public pure returns (bytes memory) { - bytes memory ret = new bytes(0); - for (uint256 i = 0; i < txs.length; i++) { - ret = abi.encodePacked( - ret, - abi.encodePacked( - uint8(0), - txs[i].to, - txs[i].value, - uint256(txs[i].data.length), - txs[i].data - ) - ); - } - return ret; - } -} diff --git a/script/utils/TxEncodingInterfaces.sol b/script/utils/TxEncodingInterfaces.sol deleted file mode 100644 index a967da943..000000000 --- a/script/utils/TxEncodingInterfaces.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LGPL AND BSD 3-Clause -pragma solidity >=0.5.0; - -// based on https://github.com/safe-global/safe-smart-account/blob/v1.3.0/contracts/GnosisSafe.sol -interface ISafe { - function execTransaction( - address to, - uint256 value, - bytes calldata data, - uint8 operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address payable refundReceiver, - bytes memory signatures - ) external; - - enum Operation {Call, DelegateCall} -} - -// based on https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol -interface ITimelock { - function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) external returns (bytes32); - function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) external payable returns (bytes memory); - function queuedTransactions(bytes32) external view returns (bool); -} - diff --git a/script/whitelist/ERC20PresetMinterPauser.sol b/script/whitelist/ERC20PresetMinterPauser.sol deleted file mode 100644 index 9aa3fb4b1..000000000 --- a/script/whitelist/ERC20PresetMinterPauser.sol +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/presets/ERC20PresetMinterPauser.sol) - -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; -import "@openzeppelin/contracts/utils/Context.sol"; -import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; - - -/** - * @dev {ERC20} token, including: - * - * - ability for holders to burn (destroy) their tokens - * - a minter role that allows for token minting (creation) - * - a pauser role that allows to stop all token transfers - * - * This contract uses {AccessControl} to lock permissioned functions using the - * different roles - head to its documentation for details. - * - * The account that deploys the contract will be granted the minter and pauser - * roles, as well as the default admin role, which will let it grant both minter - * and pauser roles to other accounts. - * - * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._ - */ -contract ERC20PresetMinterPauser is Context, AccessControlEnumerable, ERC20Burnable { - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); - - /** - * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the - * account that deploys the contract. - * - * See {ERC20-constructor}. - */ - constructor(string memory name, string memory symbol) ERC20(name, symbol) { - _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); - - _setupRole(MINTER_ROLE, _msgSender()); - _setupRole(PAUSER_ROLE, _msgSender()); - } - - /** - * @dev Creates `amount` new tokens for `to`. - * - * See {ERC20-_mint}. - * - * Requirements: - * - * - the caller must have the `MINTER_ROLE`. - */ - function mint(address to, uint256 amount) public virtual { - require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint"); - _mint(to, amount); - } - - /** - * @dev Pauses all token transfers. - * - * See {ERC20Pausable} and {Pausable-_pause}. - * - * Requirements: - * - * - the caller must have the `PAUSER_ROLE`. - */ - function pause() public virtual { - require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to pause"); - - } - - /** - * @dev Unpauses all token transfers. - * - * See {ERC20Pausable} and {Pausable-_unpause}. - * - * Requirements: - * - * - the caller must have the `PAUSER_ROLE`. - */ - function unpause() public virtual { - require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause"); - } - - function _beforeTokenTransfer( - address from, - address to, - uint256 amount - ) internal virtual override(ERC20) { - super._beforeTokenTransfer(from, to, amount); - } -} \ No newline at end of file diff --git a/script/whitelist/Staker.sol b/script/whitelist/Staker.sol deleted file mode 100644 index f353610ce..000000000 --- a/script/whitelist/Staker.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../src/contracts/interfaces/IStrategyManager.sol"; -import "../../src/contracts/interfaces/IStrategy.sol"; -import "../../src/contracts/interfaces/IDelegationManager.sol"; -import "../../src/contracts/interfaces/ISignatureUtils.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "forge-std/Test.sol"; - -contract Staker is Ownable { - - constructor( - IStrategy strategy, - IStrategyManager strategyManager, - IDelegationManager delegation, - IERC20 token, - uint256 amount, - address operator - ) Ownable() { - token.approve(address(strategyManager), type(uint256).max); - strategyManager.depositIntoStrategy(strategy, token, amount); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; - delegation.delegateTo(operator, signatureWithExpiry, bytes32(0)); - } - - function callAddress(address implementation, bytes memory data) external onlyOwner returns(bytes memory) { - uint256 length = data.length; - bytes memory returndata; - assembly{ - let result := call( - gas(), - implementation, - callvalue(), - add(data, 32), - length, - 0, - 0 - ) - mstore(returndata, returndatasize()) - returndatacopy(add(returndata, 32), 0, returndatasize()) - } - - - return returndata; - - } - -} diff --git a/script/whitelist/delegationFaucet/DelegationFaucet.sol b/script/whitelist/delegationFaucet/DelegationFaucet.sol deleted file mode 100644 index 327e8e678..000000000 --- a/script/whitelist/delegationFaucet/DelegationFaucet.sol +++ /dev/null @@ -1,216 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IStrategyManager.sol"; -import "src/contracts/interfaces/IStrategy.sol"; -import "src/contracts/interfaces/IDelegationManager.sol"; -import "src/contracts/interfaces/IDelegationFaucet.sol"; -import "script/whitelist/delegationFaucet/DelegationFaucetStaker.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/utils/Create2.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; - -import "../ERC20PresetMinterPauser.sol"; - -/** - * @title DelegationFaucet for M2 - * @author Layr Labs, Inc. - * @notice Faucet contract setup with a dummy ERC20 token and strategy for M2 testnet release. - * Each operator address gets a staker contract assigned to them deterministically. - * This contract assumes minting role of the ERC20 token and that the ERC20 token has a whitelisted strategy. - */ -contract DelegationFaucet is IDelegationFaucet, Ownable { - IStrategyManager immutable strategyManager; - ERC20PresetMinterPauser immutable stakeToken; - IStrategy immutable stakeStrategy; - IDelegationManager immutable delegation; - - uint256 public constant DEFAULT_AMOUNT = 100e18; - - constructor( - IStrategyManager _strategyManager, - IDelegationManager _delegation, - ERC20PresetMinterPauser _token, - IStrategy _strategy - ) { - strategyManager = _strategyManager; - delegation = _delegation; - stakeToken = _token; - stakeStrategy = _strategy; - } - - /** - * Deploys a DelegationFaucetStaker contract if not already deployed for operator. DelegationFaucetStaker gets minted _depositAmount or - * DEFAULT_AMOUNT if _depositAmount is 0. Then DelegationFaucetStaker contract deposits into the strategy and delegates to operator. - * @param _operator The operator to delegate to - * @param _approverSignatureAndExpiry Verifies the operator approves of this delegation - * @param _approverSalt A unique single use value tied to an individual signature. - * @param _depositAmount The amount to deposit into the strategy - */ - function mintDepositAndDelegate( - address _operator, - IDelegationManager.SignatureWithExpiry memory _approverSignatureAndExpiry, - bytes32 _approverSalt, - uint256 _depositAmount - ) public onlyOwner { - // Operator must be registered - require(delegation.isOperator(_operator), "DelegationFaucet: Operator not registered"); - address staker = getStaker(_operator); - // Set deposit amount - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - - // Deploy staker address if not already deployed, staker constructor will approve the StrategyManager to spend the stakeToken - if (!Address.isContract(staker)) { - Create2.deploy( - 0, - bytes32(uint256(uint160(_operator))), - abi.encodePacked(type(DelegationFaucetStaker).creationCode, abi.encode(strategyManager, stakeToken)) - ); - } - - // mint stakeToken to staker - stakeToken.mint(staker, _depositAmount); - // deposit into stakeToken strategy, which will increase delegated shares to operator if already delegated - _depositIntoStrategy(staker, stakeStrategy, stakeToken, _depositAmount); - // delegateTo operator if not delegated - if (!delegation.isDelegated(staker)) { - delegateTo(_operator, _approverSignatureAndExpiry, _approverSalt); - } - } - - /** - * Calls staker contract to deposit into designated strategy, mints staked token if stakeToken and stakeStrategy - * are specified. - * @param _staker address of staker contract for operator - * @param _strategy StakeToken strategy contract - * @param _token StakeToken - * @param _amount amount to get minted and to deposit - */ - function depositIntoStrategy( - address _staker, - IStrategy _strategy, - IERC20 _token, - uint256 _amount - ) public onlyOwner returns (bytes memory) { - // mint stakeToken to staker - if (_token == stakeToken && _strategy == stakeStrategy) { - stakeToken.mint(_staker, _amount); - } - return _depositIntoStrategy(_staker, _strategy, _token, _amount); - } - - /** - * Call staker to delegate to operator - * @param _operator operator to get staker address from and delegate to - * @param _approverSignatureAndExpiry Verifies the operator approves of this delegation - * @param _approverSalt A unique single use value tied to an individual signature. - */ - function delegateTo( - address _operator, - IDelegationManager.SignatureWithExpiry memory _approverSignatureAndExpiry, - bytes32 _approverSalt - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.delegateTo.selector, - _operator, - _approverSignatureAndExpiry, - _approverSalt - ); - return DelegationFaucetStaker(getStaker(_operator)).callAddress(address(delegation), data); - } - - /** - * Call queueWithdrawal through staker contract - */ - function queueWithdrawal( - address staker, - IDelegationManager.QueuedWithdrawalParams[] calldata queuedWithdrawalParams - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.queueWithdrawals.selector, - queuedWithdrawalParams - ); - return DelegationFaucetStaker(staker).callAddress(address(delegation), data); - } - - /** - * Call completeQueuedWithdrawal through staker contract - */ - function completeQueuedWithdrawal( - address staker, - IDelegationManager.Withdrawal calldata queuedWithdrawal, - IERC20[] calldata tokens, - uint256 middlewareTimesIndex, - bool receiveAsTokens - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.completeQueuedWithdrawal.selector, - queuedWithdrawal, - tokens, - middlewareTimesIndex, - receiveAsTokens - ); - return DelegationFaucetStaker(staker).callAddress(address(delegation), data); - } - - /** - * Transfers tokens from staker contract to designated address - * @param staker staker contract to transfer from - * @param token ERC20 token - * @param to the to address - * @param amount transfer amount - */ - function transfer( - address staker, - address token, - address to, - uint256 amount - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector(IERC20.transfer.selector, to, amount); - return DelegationFaucetStaker(staker).callAddress(token, data); - } - - function callAddress(address to, bytes memory data) public payable onlyOwner returns (bytes memory) { - (bool ok, bytes memory res) = payable(to).call{value: msg.value}(data); - if (!ok) { - revert(string(res)); - } - return res; - } - - /** - * @notice Returns the deterministic staker contract address for the operator - * @param _operator The operator to get the staker contract address for - */ - function getStaker(address _operator) public view returns (address) { - return - Create2.computeAddress( - bytes32(uint256(uint160(_operator))), //salt - keccak256( - abi.encodePacked(type(DelegationFaucetStaker).creationCode, abi.encode(strategyManager, stakeToken)) - ) - ); - } - - /** - * @notice Internal function to deposit into a strategy, has same function signature as StrategyManager.depositIntoStrategy - */ - function _depositIntoStrategy( - address _staker, - IStrategy _strategy, - IERC20 _token, - uint256 _amount - ) internal returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IStrategyManager.depositIntoStrategy.selector, - _strategy, - _token, - _amount - ); - return DelegationFaucetStaker(_staker).callAddress(address(strategyManager), data); - } -} diff --git a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol b/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol deleted file mode 100644 index fac0e543c..000000000 --- a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IStrategyManager.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "forge-std/Test.sol"; - -contract DelegationFaucetStaker is Ownable { - constructor(IStrategyManager strategyManager, IERC20 token) Ownable() { - token.approve(address(strategyManager), type(uint256).max); - } - - function callAddress(address implementation, bytes memory data) external onlyOwner returns (bytes memory) { - uint256 length = data.length; - bytes memory returndata; - assembly { - let result := call(gas(), implementation, callvalue(), add(data, 32), length, 0, 0) - mstore(returndata, returndatasize()) - returndatacopy(add(returndata, 32), 0, returndatasize()) - } - - return returndata; - } -} diff --git a/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol b/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol deleted file mode 100644 index 601297a06..000000000 --- a/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IDelegationManager.sol"; -import "src/contracts/interfaces/IStrategyManager.sol"; -import "src/contracts/strategies/StrategyBase.sol"; -import "src/contracts/permissions/PauserRegistry.sol"; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; - -import "./DelegationFaucet.sol"; - -import "forge-std/Script.sol"; -import "forge-std/StdJson.sol"; - -/** - * @notice Deploys the following contracts: - * - ERC20 Dummy token for testing - * - StrategyBase to be added to the StrategyManager whitelist - * - DelegationFaucet contract - */ -contract DeployDelegationFaucet is Script, Test { - // EigenLayer contracts - ProxyAdmin public eigenLayerProxyAdmin; - PauserRegistry public eigenLayerPauserReg; - IDelegationManager public delegation; - IStrategyManager public strategyManager; - - DelegationFaucet public delegationFaucet; - - // M2 testing/mock contracts - ERC20PresetMinterPauser public stakeToken; - StrategyBase public stakeTokenStrat; - StrategyBase public baseStrategyImplementation; - - address eigenLayerProxyAdminAddress; - address eigenLayerPauserRegAddress; - address delegationAddress; - address strategyManagerAddress; - address operationsMultisig; - address executorMultisig; - - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - - function run() external { - string memory goerliDeploymentConfig = vm.readFile("script/output/M1_deployment_goerli_2023_3_23.json"); - _setAddresses(goerliDeploymentConfig); - - vm.startBroadcast(); - // Deploy ERC20 stakeToken - stakeToken = new ERC20PresetMinterPauser("StakeToken", "STK"); - - // Deploy StrategyBase for stakeToken & whitelist it - baseStrategyImplementation = new StrategyBase(strategyManager); - stakeTokenStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - eigenLayerProxyAdminAddress, - abi.encodeWithSelector(StrategyBase.initialize.selector, stakeToken, eigenLayerPauserRegAddress) - ) - ) - ); - - // Needs to be strategyManager.strategyWhitelister() to add STK strategy - // IStrategy[] memory _strategy = new IStrategy[](1); - // _strategy[0] = stakeTokenStrat; - // strategyManager.addStrategiesToDepositWhitelist(_strategy); - - // Deploy DelegationFaucet, grant it admin/mint/pauser roles, etc. - delegationFaucet = new DelegationFaucet(strategyManager, delegation, stakeToken, stakeTokenStrat); - stakeToken.grantRole(MINTER_ROLE, address(delegationFaucet)); - vm.stopBroadcast(); - } - - function _setAddresses(string memory config) internal { - eigenLayerProxyAdminAddress = stdJson.readAddress(config, ".addresses.eigenLayerProxyAdmin"); - eigenLayerPauserRegAddress = stdJson.readAddress(config, ".addresses.eigenLayerPauserReg"); - delegationAddress = stdJson.readAddress(config, ".addresses.delegation"); - strategyManagerAddress = stdJson.readAddress(config, ".addresses.strategyManager"); - operationsMultisig = stdJson.readAddress(config, ".parameters.operationsMultisig"); - executorMultisig = stdJson.readAddress(config, ".parameters.executorMultisig"); - } -} diff --git a/src/contracts/interfaces/IWhitelister.sol b/src/contracts/interfaces/IWhitelister.sol deleted file mode 100644 index da68992c8..000000000 --- a/src/contracts/interfaces/IWhitelister.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity >=0.5.0; - -import "../../contracts/interfaces/IStrategyManager.sol"; -import "../../contracts/interfaces/IStrategy.sol"; -import "../../contracts/interfaces/IDelegationManager.sol"; -import "../../../script/whitelist/Staker.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/utils/Create2.sol"; - -interface IWhitelister { - function whitelist(address operator) external; - - function getStaker(address operator) external returns (address); - - function depositIntoStrategy( - address staker, - IStrategy strategy, - IERC20 token, - uint256 amount - ) external returns (bytes memory); - - function queueWithdrawal( - address staker, - IDelegationManager.QueuedWithdrawalParams[] calldata queuedWithdrawalParams - ) external returns (bytes memory); - - function completeQueuedWithdrawal( - address staker, - IDelegationManager.Withdrawal calldata queuedWithdrawal, - IERC20[] calldata tokens, - uint256 middlewareTimesIndex, - bool receiveAsTokens - ) external returns (bytes memory); - - function transfer(address staker, address token, address to, uint256 amount) external returns (bytes memory); - - function callAddress(address to, bytes memory data) external payable returns (bytes memory); -} diff --git a/src/test/DelegationFaucet.t.sol b/src/test/DelegationFaucet.t.sol deleted file mode 100644 index c611b8669..000000000 --- a/src/test/DelegationFaucet.t.sol +++ /dev/null @@ -1,513 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "script/whitelist/delegationFaucet/DelegationFaucet.sol"; -import "script/whitelist/ERC20PresetMinterPauser.sol"; - -import "src/test/EigenLayerTestHelper.t.sol"; - -contract DelegationFaucetTests is EigenLayerTestHelper { - // EigenLayer contracts - DelegationFaucet delegationFaucet; - - // M2 testing/mock contracts - ERC20PresetMinterPauser public stakeToken; - StrategyBase public stakeTokenStrat; - - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - uint256 public constant DEFAULT_AMOUNT = 100e18; - address owner = cheats.addr(1000); - - /// @notice Emitted when a queued withdrawal is completed - event WithdrawalCompleted(bytes32 withdrawalRoot); - - function setUp() public virtual override { - EigenLayerDeployer.setUp(); - - // Deploy ERC20 stakeToken, StrategyBase, and add StrategyBase to whitelist - stakeToken = new ERC20PresetMinterPauser("StakeToken", "STK"); - stakeTokenStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, stakeToken, eigenLayerPauserReg) - ) - ) - ); - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = stakeTokenStrat; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - // Deploy DelegationFaucet, grant it admin/mint/pauser roles, etc. - delegationFaucet = new DelegationFaucet(strategyManager, delegation, stakeToken, stakeTokenStrat); - targetContract(address(delegationFaucet)); - stakeToken.grantRole(MINTER_ROLE, address(delegationFaucet)); - } - - /** - * @notice Assertions in test - * - Checks staker contract is deployed - * - Checks token supply before/after minting - * - Checks token balances are updated correctly for staker and strategy contracts - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - * @param _depositAmount is the amount of stakeToken to mint to the staker and deposit into the strategy - */ - function test_mintDepositAndDelegate_CheckBalancesAndDeploys(uint8 _operatorIndex, uint256 _depositAmount) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - // Passing 0 as amount param defaults the amount to DEFAULT_AMOUNT constant - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 supplyBefore = stakeToken.totalSupply(); - uint256 stratBalanceBefore = stakeToken.balanceOf(address(stakeTokenStrat)); - assertTrue( - !Address.isContract(stakerContract), - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker contract shouldn't be deployed" - ); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), _depositAmount); - assertTrue( - Address.isContract(stakerContract), - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker contract not deployed" - ); - uint256 supplyAfter = stakeToken.totalSupply(); - uint256 stratBalanceAfter = stakeToken.balanceOf(address(stakeTokenStrat)); - // Check token supply and balances - assertEq( - supplyAfter, - supplyBefore + _depositAmount, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: token supply not updated correctly" - ); - assertEq( - stratBalanceAfter, - stratBalanceBefore + _depositAmount, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: strategy balance not updated correctly" - ); - assertEq( - stakeToken.balanceOf(stakerContract), - 0, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker balance should be 0" - ); - } - - /** - * @notice Check the before/after values for strategy shares and operator shares - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - * @param _depositAmount is the amount of stakeToken to mint to the staker and deposit into the strategy - */ - function test_mintDepositAndDelegate_StrategyAndOperatorShares( - uint8 _operatorIndex, - uint256 _depositAmount - ) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), _depositAmount); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: operator shares not updated correctly" - ); - } - - /** - * @notice Invariant test the before/after values for strategy shares and operator shares from multiple runs - */ - /// forge-config: default.invariant.runs = 5 - /// forge-config: default.invariant.depth = 20 - function invariant_test_mintDepositAndDelegate_StrategyAndOperatorShares() public { - // Setup Operator - address operator = getOperatorAddress(0); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - cheats.prank(delegationFaucet.owner()); - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: operator shares not updated correctly" - ); - } - - /** - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - */ - function test_mintDepositAndDelegate_RevertsIf_UnregisteredOperator(uint8 _operatorIndex) public { - cheats.assume(_operatorIndex < 15); - address operator = getOperatorAddress(_operatorIndex); - // Unregistered operator should revert - cheats.expectRevert("DelegationFaucet: Operator not registered"); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - } - - function test_depositIntoStrategy_IncreaseShares(uint8 _operatorIndex, uint256 _depositAmount) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_IncreaseShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_IncreaseShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_IncreaseShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_IncreaseShares: operator shares not updated correctly" - ); - - // Deposit more into strategy - stakerSharesBefore = stakerSharesAfter; - operatorSharesBefore = operatorSharesAfter; - delegationFaucet.depositIntoStrategy(stakerContract, stakeTokenStrat, stakeToken, _depositAmount); - stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - - assertEq( - stakerSharesAfter, - stakerSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_IncreasesShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_IncreasesShares: operator shares not updated correctly" - ); - } - - function test_queueWithdrawal_StakeTokenWithdraw(uint8 _operatorIndex, uint256 _withdrawAmount) public { - cheats.assume(_operatorIndex < 15 && 0 < _withdrawAmount && _withdrawAmount < DEFAULT_AMOUNT); - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 nonceBefore = delegation.cumulativeWithdrawalsQueued(/*staker*/ stakerContract); - - // Queue withdrawal - ( - IDelegationManager.Withdrawal memory queuedWithdrawal, - , /*tokensArray is unused in this test*/ - /*withdrawalRoot is unused in this test*/ - ) = _setUpQueuedWithdrawalStructSingleStrat( - /*staker*/ stakerContract, - /*withdrawer*/ stakerContract, - stakeToken, - stakeTokenStrat, - _withdrawAmount - ); - IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); - - params[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: queuedWithdrawal.strategies, - shares: queuedWithdrawal.shares, - withdrawer: stakerContract - }); - - delegationFaucet.queueWithdrawal( - stakerContract, - params - ); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 nonceAfter = delegation.cumulativeWithdrawalsQueued(/*staker*/ stakerContract); - - assertEq( - operatorSharesBefore, - operatorSharesAfter + _withdrawAmount, - "test_queueWithdrawal_WithdrawStakeToken: operator shares not updated correctly" - ); - // Withdrawal queued, but not withdrawn as of yet - assertEq( - stakerSharesBefore, - stakerSharesAfter + _withdrawAmount, - "test_queueWithdrawal_WithdrawStakeToken: staker shares not updated correctly" - ); - assertEq( - nonceBefore, - nonceAfter - 1, - "test_queueWithdrawal_WithdrawStakeToken: staker withdrawal nonce not updated" - ); - } - - function test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse( - uint8 _operatorIndex, - uint256 _withdrawAmount - ) public { - test_queueWithdrawal_StakeTokenWithdraw(_operatorIndex, _withdrawAmount); - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - // assertion before values - uint256 sharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceBefore = stakeToken.balanceOf(address(stakerContract)); - - // Set completeQueuedWithdrawal params - IStrategy[] memory strategyArray = new IStrategy[](1); - IERC20[] memory tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - { - strategyArray[0] = stakeTokenStrat; - shareAmounts[0] = _withdrawAmount; - tokensArray[0] = stakeToken; - } - - IDelegationManager.Withdrawal memory queuedWithdrawal; - { - uint256 nonce = delegation.cumulativeWithdrawalsQueued(stakerContract); - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: stakerContract, - withdrawer: stakerContract, - nonce: (nonce - 1), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(stakerContract) - }); - } - cheats.expectEmit(true, true, true, true, address(delegation)); - emit WithdrawalCompleted(delegation.calculateWithdrawalRoot(queuedWithdrawal)); - uint256 middlewareTimesIndex = 0; - bool receiveAsTokens = false; - delegationFaucet.completeQueuedWithdrawal( - stakerContract, - queuedWithdrawal, - tokensArray, - middlewareTimesIndex, - receiveAsTokens - ); - // assertion after values - uint256 sharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceAfter = stakeToken.balanceOf(address(stakerContract)); - assertEq( - sharesBefore + _withdrawAmount, - sharesAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse: staker shares not updated correctly" - ); - assertEq( - balanceBefore, - balanceAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse: stakerContract balance not updated correctly" - ); - } - - function test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue( - uint8 _operatorIndex, - uint256 _withdrawAmount - ) public { - test_queueWithdrawal_StakeTokenWithdraw(_operatorIndex, _withdrawAmount); - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - // assertion before values - uint256 sharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceBefore = stakeToken.balanceOf(address(stakerContract)); - - // Set completeQueuedWithdrawal params - IStrategy[] memory strategyArray = new IStrategy[](1); - IERC20[] memory tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - { - strategyArray[0] = stakeTokenStrat; - shareAmounts[0] = _withdrawAmount; - tokensArray[0] = stakeToken; - } - - IDelegationManager.Withdrawal memory queuedWithdrawal; - { - uint256 nonce = delegation.cumulativeWithdrawalsQueued(stakerContract); - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: stakerContract, - withdrawer: stakerContract, - nonce: (nonce - 1), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(stakerContract) - }); - } - cheats.expectEmit(true, true, true, true, address(delegation)); - emit WithdrawalCompleted(delegation.calculateWithdrawalRoot(queuedWithdrawal)); - uint256 middlewareTimesIndex = 0; - bool receiveAsTokens = true; - delegationFaucet.completeQueuedWithdrawal( - stakerContract, - queuedWithdrawal, - tokensArray, - middlewareTimesIndex, - receiveAsTokens - ); - // assertion after values - uint256 sharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceAfter = stakeToken.balanceOf(address(stakerContract)); - assertEq( - sharesBefore, - sharesAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue: staker shares not updated correctly" - ); - assertEq( - balanceBefore + _withdrawAmount, - balanceAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue: stakerContract balance not updated correctly" - ); - } - - function test_transfer_TransfersERC20(uint8 _operatorIndex, address _to, uint256 _transferAmount) public { - cheats.assume(_operatorIndex < 15); - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - ERC20PresetMinterPauser mockToken = new ERC20PresetMinterPauser("MockToken", "MTK"); - mockToken.mint(stakerContract, _transferAmount); - - uint256 stakerBalanceBefore = mockToken.balanceOf(stakerContract); - uint256 toBalanceBefore = mockToken.balanceOf(_to); - delegationFaucet.transfer(stakerContract, address(mockToken), _to, _transferAmount); - uint256 stakerBalanceAfter = mockToken.balanceOf(stakerContract); - uint256 toBalanceAfter = mockToken.balanceOf(_to); - assertEq( - stakerBalanceBefore, - stakerBalanceAfter + _transferAmount, - "test_transfer_TransfersERC20: staker balance not updated correctly" - ); - assertEq( - toBalanceBefore + _transferAmount, - toBalanceAfter, - "test_transfer_TransfersERC20: to balance not updated correctly" - ); - } - - function _registerOperator(address _operator) internal { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: _operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(_operator, operatorDetails); - } - - function _setUpQueuedWithdrawalStructSingleStrat( - address staker, - address withdrawer, - IERC20 token, - IStrategy strategy, - uint256 shareAmount - ) - internal - view - returns ( - IDelegationManager.Withdrawal memory queuedWithdrawal, - IERC20[] memory tokensArray, - bytes32 withdrawalRoot - ) - { - IStrategy[] memory strategyArray = new IStrategy[](1); - tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - strategyArray[0] = strategy; - tokensArray[0] = token; - shareAmounts[0] = shareAmount; - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: staker, - withdrawer: withdrawer, - nonce: delegation.cumulativeWithdrawalsQueued(staker), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(staker) - }); - // calculate the withdrawal root - withdrawalRoot = delegation.calculateWithdrawalRoot(queuedWithdrawal); - return (queuedWithdrawal, tokensArray, withdrawalRoot); - } -}