diff --git a/script/HoleskyTimelock.sol b/script/HoleskyTimelock.sol new file mode 100644 index 000000000..7fc49636b --- /dev/null +++ b/script/HoleskyTimelock.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +/// @notice Modified version of our mainnet timelock for use on Holesky +/// Specifically, this removes SafeMath and changes `MINIMUM_DELAY` to `0 days` +/// +/// See original version here: https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol +contract HoleskyTimelock { + + event NewAdmin(address indexed newAdmin); + event NewPendingAdmin(address indexed newPendingAdmin); + event NewDelay(uint indexed newDelay); + event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); + event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); + event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); + + uint public constant GRACE_PERIOD = 14 days; + uint public constant MINIMUM_DELAY = 0; + uint public constant MAXIMUM_DELAY = 30 days; + + address public admin; + address public pendingAdmin; + uint public delay; + + mapping (bytes32 => bool) public queuedTransactions; + + + constructor(address admin_, uint delay_) public { + require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); + require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); + + admin = admin_; + delay = delay_; + } + + fallback() external payable { } + + function setDelay(uint delay_) public { + require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); + require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); + require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); + delay = delay_; + + emit NewDelay(delay); + } + + function acceptAdmin() public { + require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); + admin = msg.sender; + pendingAdmin = address(0); + + emit NewAdmin(admin); + } + + function setPendingAdmin(address pendingAdmin_) public { + require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); + pendingAdmin = pendingAdmin_; + + emit NewPendingAdmin(pendingAdmin); + } + + function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { + require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); + require(eta >= getBlockTimestamp() + delay, "Timelock::queueTransaction: Estimated execution block must satisfy delay."); + + bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); + queuedTransactions[txHash] = true; + + emit QueueTransaction(txHash, target, value, signature, data, eta); + return txHash; + } + + function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { + require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); + + bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); + queuedTransactions[txHash] = false; + + emit CancelTransaction(txHash, target, value, signature, data, eta); + } + + function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { + require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); + + bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); + require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); + require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); + require(getBlockTimestamp() <= eta + GRACE_PERIOD, "Timelock::executeTransaction: Transaction is stale."); + + queuedTransactions[txHash] = false; + + bytes memory callData; + + if (bytes(signature).length == 0) { + callData = data; + } else { + callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); + } + + // solium-disable-next-line security/no-call-value + (bool success, bytes memory returnData) = target.call{value: value}(callData); + require(success, "Timelock::executeTransaction: Transaction execution reverted."); + + emit ExecuteTransaction(txHash, target, value, signature, data, eta); + + return returnData; + } + + function getBlockTimestamp() internal view returns (uint) { + // solium-disable-next-line security/no-block-members + return block.timestamp; + } +} diff --git a/script/README.md b/script/README.md new file mode 100644 index 000000000..119dc2b1f --- /dev/null +++ b/script/README.md @@ -0,0 +1,157 @@ +## Release Scripting + +Desired usecases: +* Creating a new release script from a template (e.g. `zeus new v0.4.2-pepe`) +* Being able to see whether a release script has been run for a given environment (`zeus status v0.4.2-pepe`) + * Since release scripts are split into 3 parts (`deploy`, `queue`, `execute`), being able to see + +`zeus run deploy pepe --sender "0x1234"` + +`zeus run deploy pepe --live --ledger` + +`zeus run queue pepe --live --ledger` +* https://docs.safe.global/sdk/api-kit +* For proposing txns to the Safe UI + +`zeus status pepe` + +### Creating a New Release Script + +``` +zeus new $VERSION $RELEASE_NAME +``` + +This command will generate a new release script based on `Release_Template.s.sol`. The new script is placed in the `/releases` folder and named accordingly (e.g. `zeus new v0.4.2-pepe` will create `releases/v0.4.2-pepe/script.s.sol`). + +Release scripts look like this: + +```solidity +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./utils/Releasoor.s.sol"; + +contract Release_TEMPLATE is Releasoor { + + using TxBuilder for *; + using AddressUtils for *; + + function deploy(Addresses memory addrs) internal override { + // If you're deploying contracts, do that here + } + + function queueUpgrade(Addresses memory addrs) internal override { + // If you're queueing an upgrade via the timelock, you can + // define and encode those transactions here + } + + function executeUpgrade(Addresses memory addrs) internal override { + // Whether you are using the timelock or just making transactions + // from the ops multisig, you can define/encode those transactions here + } +} +``` + +### Implementing Your Release Script + +Release scripts have three functions which may or may not be used, depending on your needs. Generally, a release consists of three steps: +1. Deploying new implementation contracts +2. Queueing an upgrade to these contracts in the timelock +3. Executing the queued timelock upgrade after the timelock delay has passed + +However, your release may not require deploying or queueing an upgrade in the timelock. For example, if all you want to do is have the ops multisig call `StrategyFactory.whitelistStrategies`, you don't need to deploy any contracts or queue a timelock transaction. In this case, you don't need to fill in the `deploy` or `queueUpgrade` methods - all you need to implement is `executeUpgrade`. + +#### Deploying a New Contract + +Typically, we deploy new contracts via EOA. As such, deploying new contracts can be done directly in the `deploy` method of your release script by invoking `vm.startBroadcast()`, deploying your contract(s), then invoking `vm.stopBroadcast()`. + +**Important**: In order to keep our configs up to date, ensure your deploy scripts call `addrs.X.setPending(newImpl)`! As you run this script for various environments, this will automatically update each environment's config to track these new deployments as "pending" upgrades to the contract in question. + +```solidity +function deploy(Addresses memory addrs) public override { + vm.startBroadcast(); + + // Deploy new implementation + EigenPod newEigenPodImpl = new EigenPod( + IETHPOSDeposit(params.ethPOS), + IEigenPodManager(addrs.eigenPodManager.proxy), + params.EIGENPOD_GENESIS_TIME + ); + + vm.stopBroadcast(); + + // Update the current environment's config + // (sets eigenPod.pendingImpl = newEigenPodImpl) + addrs.eigenPod.setPending(address(newEigenPodImpl)); +} +``` + +You can run your deploy script on a forked version of an existing environment with the following command: +* `make deploy ` + +e.g. `make deploy pepe preprod` will: +* Read `preprod.config` and populate [your script helpers](#script-helpers) +* Spin up an anvil fork of the preprod environment +* Deploy your contract(s) to the anvil fork +* Update `preprod.config` with the `pendingImpl` addresses (via `setPending`) + + +After you've tested the script using a forked environment, you can run it on a live network with the following command: +* `make deploy --live` + +e.g. `make deploy pepe preprod --live` will: +* Read `preprod.config` and populate [your script helpers](#script-helpers) +* Deploy your contracts to `preprod` using the configured RPC endpoint and a ledger connection +* Verify the deployed contracts on etherscan +* Update `preprod.config` with the `pendingImpl` addresses (via `setPending`) + +#### Queueing a Timelock Transaction + +The most common thing you'll need to do when deploying a release is using the ops multisig to queue transactions via the timelock. Defining transactions for this stage of the process can involve multiple contracts. Ultimately, the goal is to *define one or more contract calls that the executor multisig will carry out*. + +However, the actual output of this part of the process will be the contract call made by the ops multisig to the timelock queueing a transaction that (when the delay has elapsed) can be executed to trigger the executor multisig to make the aforementioned calls. Whew. + +Instead of trying to keep track of all of this, `queueUpgrade` can take care of this for you. All you need to define (and return) is: +1. The ETA (TODO different ETA between environments) +2. The contract calls you want the executor multisig to execute + +```solidity +function queueUpgrade(Addresses memory addrs) public override returns (Tx[] memory executorTxns, uint eta) { + Txs storage txs = _newTxs(); + eta = env.isMainnet() ? 12351235 : 0; + + txs.append({ + to: addrs.eigenPod.beacon, + data: EncBeacon.upgradeTo(addrs.eigenPod.getPending()) + }); + + txs.append({ + to: addrs.eigenPodManager.proxy, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.getPending()) + }); + + return (txs.toArray(), eta); +} +``` + +The above function defines two transactions for the executor multisig: +* A call to `eigenPod.beacon.upgradeTo()`, upgrading the `eigenPod` beacon +* A call to `proxyAdmin.upgrade()`, upgrading the `eigenPodManager` proxy + +**Important**: Note that the implementation addresses for the `eigenPod` and `eigenPodManager` are fetched using `getPending()`, which gets the `pendingImpl` for both addresses (recall that this `pendingImpl` was set during the `deploy` part of this release script). If `getPending()` finds that no `pendingImpl` address has been set, it will revert. This prevents `queueUpgrade` from running if it has a dependency on `deploy`. + +You can run the `queueUpgrade` script on a forked version of an existing environment with the following command: +* `make queue ` + +e.g. `make queue pepe preprod` will: +* Read `preprod.config` and populate [your script helpers](#script-helpers) +* Spin up an anvil fork of the preprod environment +* +* Update `preprod.config` with the `pendingImpl` addresses (via `setPending`) + +### Script Helpers diff --git a/script/README_OLD.md b/script/README_OLD.md new file mode 100644 index 000000000..71c0b89a4 --- /dev/null +++ b/script/README_OLD.md @@ -0,0 +1,119 @@ +Use Cases: +1. Fork a current deployment on any network, given a config file + * Use - simulating upgrades/changes to a current deployment +2. Deploy entire system from the current branch to any network + * Use - integration tests (mainly want to deploy locally) +3. Easily deploy/upgrade _specific_ contracts on any ENV + * Use - writing deploy/upgrade scripts + * Note: this should also update that env's config with new addresses + +## Mock Command - Release/Upgrade Scripting + +``` +make release preprod +``` + +* Generates a script file (`preprod-.s.sol`) that automatically loads the config for the `preprod` environment +* `make release preprod --test preprod-.s.sol`: + * Run the script in "test mode", forking preprod locally via anvil and simulating the deploy and upgrade steps specified in the script. + * Aside from helpful console output, this should generate an output file (to a `.gitignored` directory) that shows what the new config values will be after running for real. +* `make release preprod --run preprod-.s.sol`: + * Run the script for real, submitting both deploy and upgrade transactions to preprod, then updating the preprod config with the new addresses + * If `holesky` or `mainnet` environments are used here, the `upgrade` step should generate multisig transactions that can be signed + +## Mock Command - Deploying + +``` +make deploy preprod +``` + +* Deploys the entire system to `preprod` using the `DeployAll` script +* Generates an output file that gives the config for this new system. This is generated to a `.gitignored` directory, but if moved into the `config` folder, it can become a named, usable environment + +--- + +## Preprod Release Workflow + +#### Deploying New Contracts + +``` +$ make release pepe + +Generated release script: `./scripts/v0_4_5_pepe.s.sol` +``` + + + +``` +$ make deploy pepe --preprod --dry-run + +Launching anvil using $RPC... done +Running `v0_4_5_pepe.s.sol:deploy`... done + +Results ("preprod.json"): + +{ + "eigenPod": { + "pendingImpl": "0xDEADBEEF" + }, + "eigenPodManager": { + "pendingImpl": "0xABADDEED" + } +} +``` + + + +``` +$ make deploy pepe --preprod + +Launching anvil using $RPC... done +Running `v0_4_5_pepe.s.sol:deploy`... done + +Results ("preprod.json"): + +{ + "eigenPod": { + "pendingImpl": "0xDEADBEEF" + }, + "eigenPodManager": { + "pendingImpl": "0xABADDEED" + } +} + +Is this correct? Press (y/n) to update config: y +Updating `config/preprod.json`... done +``` + +Contracts should be successfully deployed, and config updated. + +#### Perform Upgrade + + + +``` +$ make execute pepe --preprod --dry-run + +Launching anvil using $RPC... done +Running `v0_4_5_pepe.s.sol:execute`... done + +Actions: + +[ + "executorMultisig": [ + "eigenPodBeacon.proxy.upgradeTo(pendingImpl)", + "proxyAdmin.upgrade(eigenPodManager.proxy, pendingImpl)" + ] +] + +Results ("preprod.json"): + +{ + "eigenPod": { + "impl": "0xDEADBEEF" + }, + "eigenPodManager": { + "impl": "0xABADDEED" + } +} +``` \ No newline at end of file diff --git a/script/Release.s.sol b/script/Release.s.sol new file mode 100644 index 000000000..ff9e8bd1b --- /dev/null +++ b/script/Release.s.sol @@ -0,0 +1,240 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./utils/Releasoor.s.sol"; +import "./utils/Encoders.sol"; + +contract Release is Releasoor { + + using TxBuilder for *; + using AddressUtils for *; + + struct ReleaseStep { + function () external step; + } + + // Public, standard release: + // - EOA deploy + // - queue/execute via ops multisig/timelock + function manifest() public returns (ReleaseStep[] memory steps) { + return _newRelease(ReleaseType.OPS_TIMELOCK) + .append(this.deploy) + .append(this.queueUpgrade) + .wait(10 days) + .append(this.executeUpgrade); + } + + // Private, emergency release: + // - EOA deploy + // - execute instantly via community msig + function manifest() public returns (ReleaseStep[] memory steps) { + return _newRelease(ReleaseType.COMMUNITY_MSIG) + .append(this.deploy) + .append(this.executeUpgrade); + } + + function deploy(Addresses memory addrs) internal override { + vm.startBroadcast(); + + EigenPod newEigenPodImpl = new EigenPod( + IETHPOSDeposit(params.ethPOS), + IEigenPodManager(addrs.eigenPodManager.proxy), + params.EIGENPOD_GENESIS_TIME + ); + + EigenPodManager newEPMImpl = new EigenPodManager( + IETHPOSDeposit(params.ethPOS), + IUpgradeableBeacon(addrs.eigenPod.beacon), + IStrategyManager(addrs.strategyManager.proxy), + ISlasher(addrs.slasher.proxy), + IDelegationManager(addrs.delegationManager.proxy) + ); + + vm.stopBroadcast(); + + addrs.eigenPod.setPending(address(newEigenPodImpl)); + addrs.eigenPodManager.setPending(address(newEPMImpl)); + } + + function queueUpgrade(Addresses memory addrs) internal override { + Txs storage txns = _newTxs(); + eta = env.isMainnet() ? 12351235 : 0; + + txns.append({ + to: addrs.eigenPod.beacon, + data: EncBeacon.upgradeTo(addrs.eigenPod.getPending()) + }); + + txns.append({ + to: addrs.proxyAdmin, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.getPending()) + }); + + ( + bytes memory calldata_to_timelock_queueing_action, + bytes memory calldata_to_timelock_executing_action, + bytes memory final_calldata_to_executor_multisig + ) = EncTimelock.queueTransaction({ + timelock: addrs.timelock, + multisend: params.multiSendCallOnly, + executor: addrs.executorMultisig, + executorTxns: txns, + eta: eta + }); + + _log("calldata_to_timelock_queueing_action", calldata_to_timelock_queueing_action); + _log("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); + _log("final_calldata_to_executor_multisig", final_calldata_to_executor_multisig); + + vm.startBroadcast(addrs.operationsMultisig); + + (success, ) = addrs.timelock.call(calldata_to_timelock_queueing_action); + require(success, "queueing transaction in timelock failed"); + + vm.stopBroadcast(); + } + + function executeUpgrade(Addresses memory addrs) internal override { + Txs storage txs = _newTxs(); + + txs.append({ + to: addrs.eigenPod.beacon, + data: EncUpgradeableBeacon.upgradeTo(addrs.eigenPod.getPending()) + }); + + txs.append({ + to: addrs.eigenPodManager.proxy, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.getPending()) + }); + + bytes memory calldata_to_multisend_contract = EncMultiSendCallOnly.multiSend(txs); + + bytes memory final_calldata_to_executor_multisig = EncGnosisSafe.execTransaction({ + from: addrs.timelock, + to: params.multiSendCallOnly, + data: calldata_to_multisend_contract, + op: EncGnosisSafe.Operation.DelegateCall + }); + + bytes memory calldata_to_timelock_executing_action = EncTimelock.executeTransaction({ + target: addrs.executorMultisig, + data: final_calldata_to_executor_multisig, + eta: 0 + }); + + emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); + + Txs storage txns = _newTxs(); + + txns.append({ + to: addrs.timelock, + data: calldata_to_timelock_executing_action + }); + + txns.append({ + to: addrs.strategyFactory.proxy, + data: EncStrategyFactory.whitelistStrategies(strats) + }); + + txns.broadcastFrom(addrs.opsMultisig); + + // Update config + addrs.eigenPod.updateFromPending(); + addrs.eigenPodManager.updateFromPending(); + } + + function queueUpgrade(Addresses memory addrs) internal override returns (Txns storage) { + Txns storage txns = addrs.opsMultisig.queueTimelock({ + timelock: addrs.timelock, + eta: 0, + _txns: addrs.executorMultisig + .append({ + to: addrs.strategyManager.proxy, + data: EncStrategyManager.setStrategyWhitelister(addrs.opsMultisig) + }) + .append({ + to: addrs.eigenPod.beacon, + data: EncBeacon.upgradeTo(addrs.eigenPod.getPending()) + }) + .append({ + to: addrs.proxyAdmin, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.getPending()) + }) + .asSafeExecTxn(); + }); + + txns.printSummary(); + + return txns; + } + + function executeUpgrade(Addresses memory addrs) internal override returns (Txns storage) { + Txns storage txns = addrs.opsMultisig.executeTimelock({ + timelock: addrs.timelock, + eta: 0, + to: addrs.executorMultisig, + data: addrs.executorMultisig + .append({ + to: addrs.strategyManager.proxy, + data: EncStrategyManager.setStrategyWhitelister(addrs.opsMultisig) + }) + .append({ + to: addrs.eigenPod.beacon, + data: EncBeacon.upgradeTo(addrs.eigenPod.pendingImpl) + }) + .append({ + to: addrs.proxyAdmin, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.pendingImpl) + }) + }) + .append({ + to: addrs.strategyManager.proxy, + data: EncStrategyManager.addStrategiesToDepositWhitelist(strats, bools) + }); + + txns.printSummary(); + + // Update config + addrs.eigenPod.updateFromPending(); + addrs.eigenPodManager.updateFromPending(); + + return txns; + } + + // function _deployPEPE(Addresses memory addrs) internal returns (EigenPod, EigenPodManager) { + // // Deploy EigenPod + // eigenPodImplementation = new EigenPod( + // IETHPOSDeposit(cfg.ETHPOSDepositAddress), + // IEigenPodManager(addrs.eigenPodManager.proxy), + // cfg.EIGENPOD_GENESIS_TIME + // ); + + // // Deploy EigenPodManager + // eigenPodManagerImplementation = new EigenPodManager( + // IETHPOSDeposit(cfg.ETHPOSDepositAddress), + // IBeacon(addrs.eigenPodBeacon.beacon), + // IStrategyManager(addrs.strategyManager.proxy), + // ISlasher(addrs.slasher.proxy), + // IDelegationManager(addrs.delegationManager.proxy) + // ); + + // return (eigenPodImplementation, eigenPodManagerImplementation); + // } + + // function test_Release() public { + // _readEnvironment(ENV_MAINNET); + + // _printAddrs(); + // emit log("====="); + + // _readEnvironment(ENV_HOLESKY); + + // _printAddrs(); + // emit log("====="); + + // _readEnvironment(ENV_PREPROD); + + // _printAddrs(); + // emit log("====="); + // } +} diff --git a/script/Release_Template.s.sol b/script/Release_Template.s.sol new file mode 100644 index 000000000..13d4d2ce7 --- /dev/null +++ b/script/Release_Template.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./utils/Releasoor.s.sol"; + +contract Release_TEMPLATE is Releasoor { + + using TxBuilder for *; + using AddressUtils for *; + + function deploy(Addresses memory addrs) internal override { + // If you're deploying contracts, do that here + } + + function queueUpgrade(Addresses memory addrs) internal override returns (Tx[] memory executorTxns, uint eta) { + // If you're queueing an upgrade via the timelock, you can + // define and encode those transactions here + } + + function executeUpgrade(Addresses memory addrs) internal override { + // Whether you are using the timelock or just making transactions + // from the ops multisig, you can define/encode those transactions here + } +} \ 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 8384613db..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(HEVM_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 fef339cb0..000000000 --- a/script/configs/holesky/eigenlayer_addresses_preprod.config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "lastUpdated": "v0.4.2-preprod-longtail", - "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": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "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 deleted file mode 100644 index 96df127e1..000000000 --- a/script/configs/local/deploy_from_scratch.anvil.config.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "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-addresses.config.json b/script/configs/mainnet/mainnet-addresses.config.json deleted file mode 100644 index f47b5d949..000000000 --- a/script/configs/mainnet/mainnet-addresses.config.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "lastUpdated": "v0.4.3-mainnet-foundation-incentives", - "addresses": { - "avsDirectory": "0x135dda560e946695d6f155dacafc6f1f25c1f5af", - "avsDirectoryImplementation": "0xdabdb3cd346b7d5f5779b0b614ede1cc9dcba5b7", - "beaconOracle": "0x343907185b71aDF0eBa9567538314396aa985442", - "baseStrategyImplementation": "0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3", - "delayedWithdrawalRouter": "0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8", - "delayedWithdrawalRouterImplementation": "0x4bb6731b02314d40abbffbc4540f508874014226", - "delegationManager": "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", - "delegationManagerImplementation": "0x1784be6401339fc0fedf7e9379409f5c1bfe9dda", - "eigenLayerPauserReg": "0x0c431C66F4dE941d089625E5B423D00707977060", - "eigenLayerProxyAdmin": "0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444", - "eigenPodBeacon": "0x5a2a4F2F3C18f09179B6703e63D9eDD165909073", - "eigenPodImplementation": "0x6D225e974Fa404D25Ffb84eD6E242Ffa18eF6430", - "eigenPodManager": "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338", - "eigenPodManagerImplementation": "0x731A0aD160e407393Ff662231Add6Dd145AD3FEa", - "emptyContract": "0x1f96861fEFa1065a5A96F20Deb6D8DC3ff48F7f9", - "rewardsCoordinator": "0x7750d328b314EfFa365A0402CcfD489B80B0adda", - "rewardsCoordinatorImplementation": "0xb6738A8E7793D44c5895B6A6F2a62F6bF86Ba8d2", - "slasher": "0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd", - "slasherImplementation": "0xf3234220163a757edf1e11a8a085638d9b236614", - "strategyManager": "0x858646372CC42E1A627fcE94aa7A7033e7CF075A", - "strategyManagerImplementation": "0x70f44c13944d49a236e3cd7a94f48f5dab6c619b", - "strategyFactory": "0x5e4C39Ad7A3E881585e383dB9827EB4811f6F647", - "strategyFactoryImplementation": "0x3e07cc2D34C8E0965f5BA45Ac1E960e535155c74", - "strategyFactoryBeacon": "0x0ed6703C298d28aE0878d1b28e88cA87F9662fE9", - "strategyFactoryBeaconImplementation": "0xe9FA8F904d97854C7389b68923262ADCC6C27827", - "numStrategiesDeployed": 12, - "strategies": { - "stETH": "0x93c4b944D05dfe6df7645A86cd2206016c51564D", - "rETH": "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", - "cbETH": "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", - "ETHx": "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", - "ankrETH": "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", - "oETH": "0xa4C637e0F704745D182e4D38cAb7E7485321d059", - "osETH": "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", - "swETH": "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", - "wBETH": "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", - "sfrxETH": "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", - "lsETH": "0xAe60d8180437b5C34bB956822ac2710972584473", - "mETH": "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" - }, - "strategyAddresses": [ - "0x93c4b944D05dfe6df7645A86cd2206016c51564D", - "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", - "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", - "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", - "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", - "0xa4C637e0F704745D182e4D38cAb7E7485321d059", - "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", - "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", - "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", - "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", - "0xAe60d8180437b5C34bB956822ac2710972584473", - "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" - ], - "token": { - "tokenProxyAdmin": "0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9", - "EIGEN": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83", - "bEIGEN": "0x83E9115d334D248Ce39a6f36144aEaB5b3456e75", - "EIGENImpl": "0x17f56E911C279bad67eDC08acbC9cf3DC4eF26A0", - "bEIGENImpl": "0xF2b225815F70c9b327DC9db758A36c92A4279b17", - "eigenStrategy": "0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7", - "eigenStrategyImpl": "0x27e7a3a81741b9fcc5ad7edcbf9f8a72a5c00428" - } - }, - "numStrategies": 12, - "chainInfo": { - "chainId": 1, - "deploymentBlock": 20571838 - }, - "parameters": { - "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", - "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", - "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", - "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", - "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" - } -} \ No newline at end of file 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 fa077f934..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(); - _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 480123d70..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(); - _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 1e7e371ea..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(); - _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 8dde5dde7..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(); - _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 b8d7484a9..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(HEVM_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 f63c8e25c..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(HEVM_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/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 aeed0cc37..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(); - _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 deleted file mode 100644 index a6e56b723..000000000 --- a/script/deploy/local/Deploy_From_Scratch.s.sol +++ /dev/null @@ -1,645 +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/core/AVSDirectory.sol"; -import "../../../src/contracts/core/RewardsCoordinator.sol"; - -import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; - -import "../../../src/contracts/pods/EigenPod.sol"; -import "../../../src/contracts/pods/EigenPodManager.sol"; - -import "../../../src/contracts/permissions/PauserRegistry.sol"; - -import "../../../src/test/mocks/EmptyContract.sol"; -import "../../../src/test/mocks/ETHDepositMock.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 -// RUST_LOG=forge,foundry=trace forge script script/deploy/local/Deploy_From_Scratch.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --sig "run(string memory configFile)" -- local/deploy_from_scratch.anvil.config.json -contract DeployFromScratch is Script, Test { - Vm cheats = Vm(HEVM_ADDRESS); - - // struct used to encode token info in config file - struct StrategyConfig { - uint256 maxDeposits; - uint256 maxPerDeposit; - address tokenAddress; - string tokenSymbol; - } - - string public deployConfigPath; - - // EigenLayer Contracts - ProxyAdmin public eigenLayerProxyAdmin; - PauserRegistry public eigenLayerPauserReg; - Slasher public slasher; - Slasher public slasherImplementation; - DelegationManager public delegation; - DelegationManager public delegationImplementation; - StrategyManager public strategyManager; - StrategyManager public strategyManagerImplementation; - RewardsCoordinator public rewardsCoordinator; - RewardsCoordinator public rewardsCoordinatorImplementation; - AVSDirectory public avsDirectory; - AVSDirectory public avsDirectoryImplementation; - EigenPodManager public eigenPodManager; - EigenPodManager public eigenPodManagerImplementation; - UpgradeableBeacon public eigenPodBeacon; - EigenPod public eigenPodImplementation; - StrategyBase public baseStrategyImplementation; - - EmptyContract public emptyContract; - - address executorMultisig; - address operationsMultisig; - address pauserMultisig; - - // the ETH2 deposit contract -- if not on mainnet, we deploy a mock as stand-in - IETHPOSDeposit public ethPOSDeposit; - - // strategies deployed - StrategyBaseTVLLimits[] public deployedStrategyArray; - - // IMMUTABLES TO SET - uint64 GOERLI_GENESIS_TIME = 1616508000; - - // OTHER DEPLOYMENT PARAMETERS - uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS; - uint256 SLASHER_INIT_PAUSED_STATUS; - uint256 DELEGATION_INIT_PAUSED_STATUS; - uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; - uint256 REWARDS_COORDINATOR_INIT_PAUSED_STATUS; - - // RewardsCoordinator - uint32 REWARDS_COORDINATOR_MAX_REWARDS_DURATION; - uint32 REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH; - uint32 REWARDS_COORDINATOR_MAX_FUTURE_LENGTH; - uint32 REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP; - address REWARDS_COORDINATOR_UPDATER; - uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY; - uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS; - uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS; - uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; - uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH; - - // one week in blocks -- 50400 - uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; - uint256 DELEGATION_WITHDRAWAL_DELAY_BLOCKS; - - function run(string memory configFileName) public { - // read and log the chainID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - // READ JSON CONFIG DATA - deployConfigPath = string(bytes(string.concat("script/configs/", configFileName))); - string memory config_data = vm.readFile(deployConfigPath); - // bytes memory parsedData = vm.parseJson(config_data); - - STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".strategyManager.init_paused_status"); - SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status"); - DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status"); - DELEGATION_WITHDRAWAL_DELAY_BLOCKS = stdJson.readUint(config_data, ".delegation.init_withdrawal_delay_blocks"); - EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status"); - REWARDS_COORDINATOR_INIT_PAUSED_STATUS = stdJson.readUint( - config_data, - ".rewardsCoordinator.init_paused_status" - ); - REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = uint32( - stdJson.readUint(config_data, ".rewardsCoordinator.CALCULATION_INTERVAL_SECONDS") - ); - REWARDS_COORDINATOR_MAX_REWARDS_DURATION = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_REWARDS_DURATION")); - REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_RETROACTIVE_LENGTH")); - REWARDS_COORDINATOR_MAX_FUTURE_LENGTH = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_FUTURE_LENGTH")); - REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP")); - REWARDS_COORDINATOR_UPDATER = stdJson.readAddress(config_data, ".rewardsCoordinator.rewards_updater_address"); - REWARDS_COORDINATOR_ACTIVATION_DELAY = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.activation_delay")); - REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = uint32( - stdJson.readUint(config_data, ".rewardsCoordinator.calculation_interval_seconds") - ); - REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32( - stdJson.readUint(config_data, ".rewardsCoordinator.global_operator_commission_bips") - ); - REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32( - stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") - ); - REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32( - stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH") - ); - - STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32( - stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks") - ); - - // tokens to deploy strategies for - StrategyConfig[] memory strategyConfigs; - - executorMultisig = stdJson.readAddress(config_data, ".multisig_addresses.executorMultisig"); - operationsMultisig = stdJson.readAddress(config_data, ".multisig_addresses.operationsMultisig"); - pauserMultisig = stdJson.readAddress(config_data, ".multisig_addresses.pauserMultisig"); - // load token list - bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategies"); - strategyConfigs = abi.decode(strategyConfigsRaw, (StrategyConfig[])); - - require(executorMultisig != address(0), "executorMultisig address not configured correctly!"); - require(operationsMultisig != address(0), "operationsMultisig address not configured correctly!"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - // deploy proxy admin for ability to upgrade proxy contracts - eigenLayerProxyAdmin = new ProxyAdmin(); - - //deploy pauser registry - { - address[] memory pausers = new address[](3); - pausers[0] = executorMultisig; - pausers[1] = operationsMultisig; - pausers[2] = pauserMultisig; - eigenLayerPauserReg = new PauserRegistry(pausers, executorMultisig); - } - - /** - * 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(); - delegation = DelegationManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - strategyManager = StrategyManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - avsDirectory = AVSDirectory( - 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), "")) - ); - rewardsCoordinator = RewardsCoordinator( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - - // if on mainnet, use the ETH2 deposit contract address - if (chainId == 1) { - ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa); - // if not on mainnet, deploy a mock - } else { - ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress")); - } - eigenPodImplementation = new EigenPod( - ethPOSDeposit, - eigenPodManager, - GOERLI_GENESIS_TIME - ); - - eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); - - // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); - avsDirectoryImplementation = new AVSDirectory(delegation); - slasherImplementation = new Slasher(strategyManager, delegation); - eigenPodManagerImplementation = new EigenPodManager( - ethPOSDeposit, - eigenPodBeacon, - strategyManager, - slasher, - delegation - ); - rewardsCoordinatorImplementation = new RewardsCoordinator( - delegation, - 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 - ); - - // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. - { - IStrategy[] memory _strategies; - uint256[] memory _withdrawalDelayBlocks; - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(delegation))), - address(delegationImplementation), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - DELEGATION_INIT_PAUSED_STATUS, - DELEGATION_WITHDRAWAL_DELAY_BLOCKS, - _strategies, - _withdrawalDelayBlocks - ) - ); - } - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation), - abi.encodeWithSelector( - StrategyManager.initialize.selector, - executorMultisig, - operationsMultisig, - eigenLayerPauserReg, - STRATEGY_MANAGER_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation), - abi.encodeWithSelector( - Slasher.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - SLASHER_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(avsDirectory))), - address(avsDirectoryImplementation), - abi.encodeWithSelector(AVSDirectory.initialize.selector, executorMultisig, eigenLayerPauserReg, 0) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation), - abi.encodeWithSelector( - EigenPodManager.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - EIGENPOD_MANAGER_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), - address(rewardsCoordinatorImplementation), - 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 - ) - ); - - // deploy StrategyBaseTVLLimits contract implementation - baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); - // create upgradeable proxies that each point to the implementation and initialize them - for (uint256 i = 0; i < strategyConfigs.length; ++i) { - if (strategyConfigs[i].tokenAddress == address(0)) { - strategyConfigs[i].tokenAddress = address(new ERC20PresetFixedSupply("TestToken", "TEST", uint256(type(uint128).max), executorMultisig)); - } - deployedStrategyArray.push( - StrategyBaseTVLLimits( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - StrategyBaseTVLLimits.initialize.selector, - strategyConfigs[i].maxPerDeposit, - strategyConfigs[i].maxDeposits, - IERC20(strategyConfigs[i].tokenAddress), - eigenLayerPauserReg - ) - ) - ) - ) - ); - } - - eigenLayerProxyAdmin.transferOwnership(executorMultisig); - eigenPodBeacon.transferOwnership(executorMultisig); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // CHECK CORRECTNESS OF DEPLOYMENT - _verifyContractsPointAtOneAnother( - delegationImplementation, - strategyManagerImplementation, - slasherImplementation, - eigenPodManagerImplementation, - rewardsCoordinatorImplementation - ); - _verifyContractsPointAtOneAnother( - delegation, - strategyManager, - slasher, - eigenPodManager, - rewardsCoordinator - ); - _verifyImplementationsSetCorrectly(); - _verifyInitialOwners(); - _checkPauserInitializations(); - _verifyInitializationParams(); - - // WRITE JSON DATA - string memory parent_object = "parent object"; - - string memory deployed_strategies = "strategies"; - for (uint256 i = 0; i < strategyConfigs.length; ++i) { - vm.serializeAddress(deployed_strategies, strategyConfigs[i].tokenSymbol, address(deployedStrategyArray[i])); - } - string memory deployed_strategies_output = strategyConfigs.length == 0 - ? "" - : vm.serializeAddress( - deployed_strategies, - strategyConfigs[strategyConfigs.length - 1].tokenSymbol, - address(deployedStrategyArray[strategyConfigs.length - 1]) - ); - - string memory deployed_addresses = "addresses"; - vm.serializeUint(deployed_addresses, "numStrategiesDeployed", 0); // for compatibility with other scripts - vm.serializeAddress(deployed_addresses, "eigenLayerProxyAdmin", address(eigenLayerProxyAdmin)); - vm.serializeAddress(deployed_addresses, "eigenLayerPauserReg", address(eigenLayerPauserReg)); - vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); - vm.serializeAddress(deployed_addresses, "slasherImplementation", address(slasherImplementation)); - vm.serializeAddress(deployed_addresses, "delegationManager", address(delegation)); - vm.serializeAddress(deployed_addresses, "delegationManagerImplementation", address(delegationImplementation)); - vm.serializeAddress(deployed_addresses, "avsDirectory", address(avsDirectory)); - vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); - vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); - vm.serializeAddress( - deployed_addresses, - "strategyManagerImplementation", - address(strategyManagerImplementation) - ); - vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); - vm.serializeAddress( - deployed_addresses, - "eigenPodManagerImplementation", - address(eigenPodManagerImplementation) - ); - vm.serializeAddress(deployed_addresses, "rewardsCoordinator", address(rewardsCoordinator)); - vm.serializeAddress( - deployed_addresses, - "rewardsCoordinatorImplementation", - address(rewardsCoordinatorImplementation) - ); - 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 - ); - - { - // dummy token data - string memory token = '{"tokenProxyAdmin": "0x0000000000000000000000000000000000000000", "EIGEN": "0x0000000000000000000000000000000000000000","bEIGEN": "0x0000000000000000000000000000000000000000","EIGENImpl": "0x0000000000000000000000000000000000000000","bEIGENImpl": "0x0000000000000000000000000000000000000000","eigenStrategy": "0x0000000000000000000000000000000000000000","eigenStrategyImpl": "0x0000000000000000000000000000000000000000"}'; - deployed_addresses_output = vm.serializeString(deployed_addresses, "token", token); - } - - string memory parameters = "parameters"; - vm.serializeAddress(parameters, "executorMultisig", executorMultisig); - vm.serializeAddress(parameters, "communityMultisig", operationsMultisig); - vm.serializeAddress(parameters, "pauserMultisig", pauserMultisig); - vm.serializeAddress(parameters, "timelock", address(0)); - string memory parameters_output = vm.serializeAddress(parameters, "operationsMultisig", operationsMultisig); - - string memory chain_info = "chainInfo"; - vm.serializeUint(chain_info, "deploymentBlock", block.number); - string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); - - // serialize all the data - vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); - vm.serializeString(parent_object, chain_info, chain_info_output); - string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output); - // TODO: should output to different file depending on configFile passed to run() - // so that we don't override mainnet output by deploying to goerli for eg. - vm.writeJson(finalJson, "script/output/devnet/local_from_scratch_deployment_data.json"); - - // generate + write eigenpods to file - address podAddress = eigenPodManager.createPod(); - string memory eigenpodStruct = "eigenpodStruct"; - string memory json = vm.serializeAddress(eigenpodStruct, "podAddress", podAddress); - vm.writeJson(json, "script/output/eigenpods.json"); - } - - function _verifyContractsPointAtOneAnother( - DelegationManager delegationContract, - StrategyManager strategyManagerContract, - Slasher /*slasherContract*/, - EigenPodManager eigenPodManagerContract, - RewardsCoordinator rewardsCoordinatorContract - ) internal view { - require(delegationContract.slasher() == slasher, "delegation: slasher address not set correctly"); - require( - delegationContract.strategyManager() == strategyManager, - "delegation: strategyManager address not set correctly" - ); - - require(strategyManagerContract.slasher() == slasher, "strategyManager: slasher address not set correctly"); - require( - strategyManagerContract.delegation() == delegation, - "strategyManager: delegation address not set correctly" - ); - require( - strategyManagerContract.eigenPodManager() == eigenPodManager, - "strategyManager: eigenPodManager address not set correctly" - ); - - // removing slasher requirements because there is no slasher as part of m2-mainnet release - // require(slasherContract.strategyManager() == strategyManager, "slasher: strategyManager not set correctly"); - // require(slasherContract.delegation() == delegation, "slasher: delegation not set correctly"); - - require( - eigenPodManagerContract.ethPOS() == ethPOSDeposit, - " eigenPodManager: ethPOSDeposit contract address not set correctly" - ); - require( - eigenPodManagerContract.eigenPodBeacon() == eigenPodBeacon, - "eigenPodManager: eigenPodBeacon contract address not set correctly" - ); - require( - eigenPodManagerContract.strategyManager() == strategyManager, - "eigenPodManager: strategyManager contract address not set correctly" - ); - require( - eigenPodManagerContract.slasher() == slasher, - "eigenPodManager: slasher contract address not set correctly" - ); - - require( - rewardsCoordinatorContract.delegationManager() == delegation, - "rewardsCoordinator: delegation address not set correctly" - ); - - require( - rewardsCoordinatorContract.strategyManager() == strategyManager, - "rewardsCoordinator: strategyManager address not set correctly" - ); - } - - function _verifyImplementationsSetCorrectly() internal view { - require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(delegation)))) == - address(delegationImplementation), - "delegation: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(strategyManager))) - ) == address(strategyManagerImplementation), - "strategyManager: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) == - address(slasherImplementation), - "slasher: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(eigenPodManager))) - ) == address(eigenPodManagerImplementation), - "eigenPodManager: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(rewardsCoordinator))) - ) == address(rewardsCoordinatorImplementation), - "rewardsCoordinator: implementation set incorrectly" - ); - - for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(deployedStrategyArray[i]))) - ) == address(baseStrategyImplementation), - "strategy: implementation set incorrectly" - ); - } - - require( - eigenPodBeacon.implementation() == address(eigenPodImplementation), - "eigenPodBeacon: implementation set incorrectly" - ); - } - - function _verifyInitialOwners() internal view { - require(strategyManager.owner() == executorMultisig, "strategyManager: owner not set correctly"); - require(delegation.owner() == executorMultisig, "delegation: owner not set correctly"); - // removing slasher requirements because there is no slasher as part of m2-mainnet release - // require(slasher.owner() == executorMultisig, "slasher: owner not set correctly"); - require(eigenPodManager.owner() == executorMultisig, "eigenPodManager: owner not set correctly"); - - require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly"); - require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly"); - } - - function _checkPauserInitializations() internal view { - require(delegation.pauserRegistry() == eigenLayerPauserReg, "delegation: pauser registry not set correctly"); - require( - strategyManager.pauserRegistry() == eigenLayerPauserReg, - "strategyManager: pauser registry not set correctly" - ); - // removing slasher requirements because there is no slasher as part of m2-mainnet release - // require(slasher.pauserRegistry() == eigenLayerPauserReg, "slasher: pauser registry not set correctly"); - require( - eigenPodManager.pauserRegistry() == eigenLayerPauserReg, - "eigenPodManager: pauser registry not set correctly" - ); - require( - rewardsCoordinator.pauserRegistry() == eigenLayerPauserReg, - "rewardsCoordinator: pauser registry not set correctly" - ); - - require(eigenLayerPauserReg.isPauser(operationsMultisig), "pauserRegistry: operationsMultisig is not pauser"); - require(eigenLayerPauserReg.isPauser(executorMultisig), "pauserRegistry: executorMultisig is not pauser"); - require(eigenLayerPauserReg.isPauser(pauserMultisig), "pauserRegistry: pauserMultisig is not pauser"); - require(eigenLayerPauserReg.unpauser() == executorMultisig, "pauserRegistry: unpauser not set correctly"); - - for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { - require( - deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, - "StrategyBaseTVLLimits: pauser registry not set correctly" - ); - require( - deployedStrategyArray[i].paused() == 0, - "StrategyBaseTVLLimits: init paused status set incorrectly" - ); - } - - // // pause *nothing* - // uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS = 0; - // // pause *everything* - // uint256 SLASHER_INIT_PAUSED_STATUS = type(uint256).max; - // // pause *everything* - // uint256 DELEGATION_INIT_PAUSED_STATUS = type(uint256).max; - // // pause *all of the proof-related functionality* (everything that can be paused other than creation of EigenPods) - // uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS = (2**1) + (2**2) + (2**3) + (2**4); /* = 30 */ - // // pause *nothing* - // require(strategyManager.paused() == 0, "strategyManager: init paused status set incorrectly"); - // require(slasher.paused() == type(uint256).max, "slasher: init paused status set incorrectly"); - // require(delegation.paused() == type(uint256).max, "delegation: init paused status set incorrectly"); - // require(eigenPodManager.paused() == 30, "eigenPodManager: init paused status set incorrectly"); - } - - function _verifyInitializationParams() internal { - // // one week in blocks -- 50400 - // uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds; - // require(strategyManager.withdrawalDelayBlocks() == 7 days / 12 seconds, - // "strategyManager: withdrawalDelayBlocks initialized incorrectly"); - // uint256 MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = 32 ether; - - require( - strategyManager.strategyWhitelister() == operationsMultisig, - "strategyManager: strategyWhitelister address not set correctly" - ); - - require( - baseStrategyImplementation.strategyManager() == strategyManager, - "baseStrategyImplementation: strategyManager set incorrectly" - ); - - require( - eigenPodImplementation.ethPOS() == ethPOSDeposit, - "eigenPodImplementation: ethPOSDeposit contract address not set correctly" - ); - require( - eigenPodImplementation.eigenPodManager() == eigenPodManager, - " eigenPodImplementation: eigenPodManager contract address not set correctly" - ); - - string memory config_data = vm.readFile(deployConfigPath); - for (uint i = 0; i < deployedStrategyArray.length; i++) { - uint256 maxPerDeposit = stdJson.readUint( - config_data, - string.concat(".strategies[", vm.toString(i), "].max_per_deposit") - ); - uint256 maxDeposits = stdJson.readUint( - config_data, - string.concat(".strategies[", vm.toString(i), "].max_deposits") - ); - (uint256 setMaxPerDeposit, uint256 setMaxDeposits) = deployedStrategyArray[i].getTVLLimits(); - require(setMaxPerDeposit == maxPerDeposit, "setMaxPerDeposit not set correctly"); - require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly"); - } - } -} 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 279d23e5c..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(HEVM_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 7c1adabf7..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(HEVM_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 774e85dc8..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(HEVM_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 c69bbe108..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(); - _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(HEVM_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(); - _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 d4d0b4813..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(HEVM_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 b4eabdbc2..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(HEVM_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 1fe59bed4..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(); - _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 9d3447e07..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(); - _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 { - 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 5513b1ee3..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(); - _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/output/devnet/M1_MOCK_deployment_data.json b/script/output/devnet/M1_MOCK_deployment_data.json deleted file mode 100644 index 28ff52987..000000000 --- a/script/output/devnet/M1_MOCK_deployment_data.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "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" - }, - "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 deleted file mode 100644 index 5c47c3720..000000000 --- a/script/output/devnet/M2_from_scratch_deployment_data.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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/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/v0.4.2-pepe/Script.s.sol b/script/releases/v0.4.2-pepe/Script.s.sol new file mode 100644 index 000000000..326c99a34 --- /dev/null +++ b/script/releases/v0.4.2-pepe/Script.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./utils/Releasoor.s.sol"; + +contract v0_4_2_ is Releasoor { + + using TxBuilder for *; + using AddressUtils for *; + + function deploy(Addresses memory addrs) internal override { + // If you're deploying contracts, do that here + } + + function queueUpgrade(Addresses memory addrs) internal override returns (Tx[] memory executorTxns, uint eta) { + // If you're queueing an upgrade via the timelock, you can + // define and encode those transactions here + } + + function executeUpgrade(Addresses memory addrs) internal override { + // Whether you are using the timelock or just making transactions + // from the ops multisig, you can define/encode those transactions here + } +} \ No newline at end of file diff --git a/script/releases/v0.4.2-pepe/manifest.json b/script/releases/v0.4.2-pepe/manifest.json new file mode 100644 index 000000000..e69de29bb diff --git a/script/utils/AddressUtils.sol b/script/utils/AddressUtils.sol new file mode 100644 index 000000000..018c056a5 --- /dev/null +++ b/script/utils/AddressUtils.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +struct TUPInfo { + address proxy; + address impl; + address pendingImpl; +} + +struct BeaconInfo { + address beacon; + address impl; + address pendingImpl; +} + +struct TokenInfo { + address proxy; + address impl; + address pendingImpl; + address proxyAdmin; +} + +struct Addresses { + // admin + address communityMultisig; + address executorMultisig; + address operationsMultisig; + address pauserMultisig; + address pauserRegistry; + address proxyAdmin; + address timelock; + // core + TUPInfo avsDirectory; + TUPInfo delegationManager; + TUPInfo rewardsCoordinator; + TUPInfo slasher; + TUPInfo strategyManager; + // pods + BeaconInfo eigenPod; + TUPInfo eigenPodManager; + TUPInfo delayedWithdrawalRouter; + // strategies + TUPInfo strategyFactory; + BeaconInfo strategyBeacon; + TUPInfo[] preLongtailStrats; + // token + TokenInfo EIGEN; + TokenInfo bEIGEN; + TUPInfo eigenStrategy; +} + +library AddressUtils { + + function setPending(TUPInfo memory info, address pendingAddress) internal pure { + info.pendingImpl = pendingAddress; + } + + function setPending(BeaconInfo memory info, address pendingAddress) internal pure { + info.pendingImpl = pendingAddress; + } + + function setPending(TokenInfo memory info, address pendingAddress) internal pure { + info.pendingImpl = pendingAddress; + } + + function updateFromPending(TUPInfo memory info) internal pure { + info.impl = getPending(info); + info.pendingImpl = address(0); + } + + function updateFromPending(BeaconInfo memory info) internal pure { + info.impl = getPending(info); + info.pendingImpl = address(0); + } + + function updateFromPending(TokenInfo memory info) internal pure { + info.impl = getPending(info); + info.pendingImpl = address(0); + } + + function getPending(TUPInfo memory info) internal pure returns (address) { + if (info.pendingImpl == address(0)) { + revert("no pending implementation found"); + } + + return info.pendingImpl; + } + + function getPending(BeaconInfo memory info) internal pure returns (address) { + if (info.pendingImpl == address(0)) { + revert("no pending implementation found"); + } + + return info.pendingImpl; + } + + function getPending(TokenInfo memory info) internal pure returns (address) { + if (info.pendingImpl == address(0)) { + revert("no pending implementation found"); + } + + return info.pendingImpl; + } +} \ No newline at end of file diff --git a/script/utils/ConfigParser.sol b/script/utils/ConfigParser.sol new file mode 100644 index 000000000..09a41855a --- /dev/null +++ b/script/utils/ConfigParser.sol @@ -0,0 +1,339 @@ +pragma solidity ^0.8.12; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +import "./StringUtils.sol"; +import {TUPInfo, BeaconInfo, TokenInfo, Addresses} from "./AddressUtils.sol"; + +// Admin/Proxies +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; +import "../../src/contracts/permissions/PauserRegistry.sol"; +import "../../src/test/mocks/EmptyContract.sol"; + +// Core +import "../../src/contracts/core/AVSDirectory.sol"; +import "../../src/contracts/core/DelegationManager.sol"; +import "../../src/contracts/core/RewardsCoordinator.sol"; +import "../../src/contracts/core/Slasher.sol"; +import "../../src/contracts/core/StrategyManager.sol"; + +// Pods +import "../../src/contracts/pods/EigenPod.sol"; +import "../../src/contracts/pods/EigenPodManager.sol"; + +// Strategies +import "../../src/contracts/strategies/EigenStrategy.sol"; +import "../../src/contracts/strategies/StrategyBase.sol"; +import "../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; +import "../../src/contracts/strategies/StrategyFactory.sol"; + +// Token +import "../../src/contracts/interfaces/IBackingEigen.sol"; +import "../../src/contracts/interfaces/IEigen.sol"; + +struct Environment { + uint chainid; + string name; + string lastUpdated; +} + +struct Params { + // admin + address multiSendCallOnly; + // pods + address ethPOS; + uint64 EIGENPOD_GENESIS_TIME; + // rewards + uint32 CALCULATION_INTERVAL_SECONDS; + uint32 MAX_REWARDS_DURATION; + uint32 MAX_RETROACTIVE_LENGTH; + uint32 MAX_FUTURE_LENGTH; + uint32 GENESIS_REWARDS_TIMESTAMP; + address REWARDS_UPDATER_ADDRESS; + uint32 ACTIVATION_DELAY; + uint16 GLOBAL_OPERATOR_COMMISSION_BIPS; +} + +contract ConfigParser is Script, Test { + + using StringUtils for *; + + // Yes, you can use either one + Vm cheats = Vm(HEVM_ADDRESS); + Vm vm = Vm(HEVM_ADDRESS); + + string configPath; + string configData; + + function _readConfigFile(string memory filePath) internal returns (Addresses memory, Environment memory, Params memory) { + configPath = filePath; + configData = vm.readFile(configPath); + emit log_named_string("Reading from config file", configPath); + + Environment memory env = _readEnvironment(); + Params memory params = _readParams(); + Addresses memory addrs = _readAddresses(); + + return (addrs, env, params); + } + + function _writeConfigFile(Addresses memory addrs, Environment memory env, Params memory params) internal { + emit log_named_string("Writing to config file", configPath); + + (string memory configKey, string memory configObject) = _writeConfig(env, params); + (string memory deploymentKey, string memory deploymentObject) = _writeDeployment(addrs); + + string memory parentObjectKey = "root"; + vm.serializeString(parentObjectKey, deploymentKey, deploymentObject); + string memory parentObject = vm.serializeString(parentObjectKey, configKey, configObject); + + vm.writeJson(parentObject, configPath); + } + + function _printEnv(Environment memory env) internal { + emit log("Config Environment Info:"); + emit log_named_string("- name", env.name); + emit log_named_uint("- chainid", env.chainid); + emit log_named_string("- last updated", env.lastUpdated); + } + + /** + * + * READS + * + */ + + function _readEnvironment() private returns (Environment memory) { + return Environment({ + chainid: _readUint(".config.environment.chainid"), + name: _readString(".config.environment.name"), + lastUpdated: _readString(".config.environment.lastUpdated") + }); + } + + function _readParams() private returns (Params memory) { + return Params({ + multiSendCallOnly: _readAddress(".config.params.multiSendCallOnly"), + ethPOS: _readAddress(".config.params.ethPOS"), + EIGENPOD_GENESIS_TIME: uint64(_readUint(".config.params.EIGENPOD_GENESIS_TIME")), + CALCULATION_INTERVAL_SECONDS: uint32(_readUint(".config.params.CALCULATION_INTERVAL_SECONDS")), + MAX_REWARDS_DURATION: uint32(_readUint(".config.params.MAX_REWARDS_DURATION")), + MAX_RETROACTIVE_LENGTH: uint32(_readUint(".config.params.MAX_RETROACTIVE_LENGTH")), + MAX_FUTURE_LENGTH: uint32(_readUint(".config.params.MAX_FUTURE_LENGTH")), + GENESIS_REWARDS_TIMESTAMP: uint32(_readUint(".config.params.GENESIS_REWARDS_TIMESTAMP")), + REWARDS_UPDATER_ADDRESS: _readAddress(".config.params.REWARDS_UPDATER_ADDRESS"), + ACTIVATION_DELAY: uint32(_readUint(".config.params.ACTIVATION_DELAY")), + GLOBAL_OPERATOR_COMMISSION_BIPS: uint16(_readUint(".config.params.GLOBAL_OPERATOR_COMMISSION_BIPS")) + }); + } + + function _readAddresses() private returns (Addresses memory) { + return Addresses({ + // Admin + communityMultisig: _readAddress(".deployment.admin.communityMultisig"), + executorMultisig: _readAddress(".deployment.admin.executorMultisig"), + operationsMultisig: _readAddress(".deployment.admin.operationsMultisig"), + pauserMultisig: _readAddress(".deployment.admin.pauserMultisig"), + pauserRegistry: _readAddress(".deployment.admin.pauserRegistry"), + proxyAdmin: _readAddress(".deployment.admin.proxyAdmin"), + timelock: _readAddress(".deployment.admin.timelock"), + // Core + avsDirectory: _readTUP(".deployment.core.avsDirectory"), + delegationManager: _readTUP(".deployment.core.delegationManager"), + rewardsCoordinator: _readTUP(".deployment.core.rewardsCoordinator"), + slasher: _readTUP(".deployment.core.slasher"), + strategyManager: _readTUP(".deployment.core.strategyManager"), + // Pods + eigenPod: _readBeacon(".deployment.pods.eigenPod"), + eigenPodManager: _readTUP(".deployment.pods.eigenPodManager"), + delayedWithdrawalRouter: _readTUP(".deployment.pods.delayedWithdrawalRouter"), + // Strategies + strategyFactory: _readTUP(".deployment.strategies.strategyFactory"), + strategyBeacon: _readBeacon(".deployment.strategies.strategyBeacon"), + preLongtailStrats: _readStrategies(".deployment.strategies.preLongtailStrats"), + // Token + EIGEN: _readToken(".deployment.token.EIGEN"), + bEIGEN: _readToken(".deployment.token.bEIGEN"), + eigenStrategy: _readTUP(".deployment.token.eigenStrategy") + }); + } + + function _readTUP(string memory jsonLocation) private returns (TUPInfo memory) { + return TUPInfo({ + proxy: _readAddress(jsonLocation.concat(".proxy")), + impl: _readAddress(jsonLocation.concat(".impl")), + pendingImpl: _readAddress(jsonLocation.concat(".pendingImpl")) + }); + } + + function _readBeacon(string memory jsonLocation) private returns (BeaconInfo memory) { + return BeaconInfo({ + beacon: _readAddress(jsonLocation.concat(".beacon")), + impl: _readAddress(jsonLocation.concat(".impl")), + pendingImpl: _readAddress(jsonLocation.concat(".pendingImpl")) + }); + } + + function _readStrategies(string memory jsonLocation) private returns (TUPInfo[] memory) { + address[] memory strategyProxies = stdJson.readAddressArray(configData, jsonLocation.concat(".addrs")); + address strategyImpl = _readAddress(jsonLocation.concat(".impl")); + + TUPInfo[] memory strategyInfos = new TUPInfo[](strategyProxies.length); + + for (uint i = 0; i < strategyInfos.length; i++) { + strategyInfos[i] = TUPInfo({ + proxy: strategyProxies[i], + impl: strategyImpl, + pendingImpl: address(0) + }); + } + + return strategyInfos; + } + + function _readToken(string memory jsonLocation) private returns (TokenInfo memory) { + return TokenInfo({ + proxy: _readAddress(jsonLocation.concat(".proxy")), + impl: _readAddress(jsonLocation.concat(".impl")), + pendingImpl: _readAddress(jsonLocation.concat(".pendingImpl")), + proxyAdmin: _readAddress(jsonLocation.concat(".proxyAdmin")) + }); + } + + function _readAddress(string memory jsonLocation) private returns (address) { + return stdJson.readAddress(configData, jsonLocation); + } + + function _readUint(string memory jsonLocation) private returns (uint) { + return stdJson.readUint(configData, jsonLocation); + } + + function _readString(string memory jsonLocation) private returns (string memory) { + return stdJson.readString(configData, jsonLocation); + } + + /** + * + * WRITES + * + */ + + function _writeDeployment(Addresses memory addrs) private returns (string memory, string memory) { + // Admin + string memory adminKey = "admin"; + vm.serializeAddress(adminKey, "communityMultisig", addrs.communityMultisig); + vm.serializeAddress(adminKey, "executorMultisig", addrs.executorMultisig); + vm.serializeAddress(adminKey, "operationsMultisig", addrs.operationsMultisig); + vm.serializeAddress(adminKey, "pauserMultisig", addrs.pauserMultisig); + vm.serializeAddress(adminKey, "pauserRegistry", addrs.pauserRegistry); + vm.serializeAddress(adminKey, "proxyAdmin", addrs.proxyAdmin); + string memory adminObject = vm.serializeAddress(adminKey, "timelock", addrs.timelock); + + // Core + string memory coreKey = "core"; + _writeTUP(coreKey, "avsDirectory", addrs.avsDirectory); + _writeTUP(coreKey, "delegationManager", addrs.delegationManager); + _writeTUP(coreKey, "rewardsCoordinator", addrs.rewardsCoordinator); + _writeTUP(coreKey, "slasher", addrs.slasher); + string memory coreObject = _writeTUP(coreKey, "strategyManager", addrs.strategyManager); + + // Pods + string memory podsKey = "pods"; + _writeBeacon(podsKey, "eigenPod", addrs.eigenPod); + _writeTUP(podsKey, "eigenPodManager", addrs.eigenPodManager); + string memory podsObject = _writeTUP(podsKey, "delayedWithdrawalRouter", addrs.delayedWithdrawalRouter); + + // Strategies + string memory strategiesKey = "strategies"; + _writeTUP(strategiesKey, "strategyFactory", addrs.strategyFactory); + _writeBeacon(strategiesKey, "strategyBeacon", addrs.strategyBeacon); + string memory strategiesObject = _writeStrategies(strategiesKey, "preLongtailStrats", addrs.preLongtailStrats); + + // Token + string memory tokenKey = "token"; + _writeToken(tokenKey, "EIGEN", addrs.EIGEN); + _writeToken(tokenKey, "bEIGEN", addrs.bEIGEN); + string memory tokenObject = _writeTUP(tokenKey, "eigenStrategy", addrs.eigenStrategy); + + // Deployment + string memory deploymentKey = "deployment"; + vm.serializeString(deploymentKey, adminKey, adminObject); + vm.serializeString(deploymentKey, coreKey, coreObject); + vm.serializeString(deploymentKey, podsKey, podsObject); + vm.serializeString(deploymentKey, strategiesKey, strategiesObject); + string memory deploymentObject = vm.serializeString(deploymentKey, tokenKey, tokenObject); + + return (deploymentKey, deploymentObject); + } + + function _writeConfig(Environment memory env, Params memory params) private returns (string memory, string memory) { + // Environment + string memory environmentKey = "environment"; + vm.serializeUint(environmentKey, "chainid", env.chainid); + vm.serializeString(environmentKey, "name", env.name); + string memory environmentObject = vm.serializeString(environmentKey, "lastUpdated", env.lastUpdated); + + // Params + string memory paramsKey = "params"; + vm.serializeAddress(paramsKey, "multiSendCallOnly", params.multiSendCallOnly); + vm.serializeAddress(paramsKey, "ethPOS", params.ethPOS); + vm.serializeUint(paramsKey, "EIGENPOD_GENESIS_TIME", params.EIGENPOD_GENESIS_TIME); + vm.serializeUint(paramsKey, "CALCULATION_INTERVAL_SECONDS", params.CALCULATION_INTERVAL_SECONDS); + vm.serializeUint(paramsKey, "MAX_REWARDS_DURATION", params.MAX_REWARDS_DURATION); + vm.serializeUint(paramsKey, "MAX_RETROACTIVE_LENGTH", params.MAX_RETROACTIVE_LENGTH); + vm.serializeUint(paramsKey, "MAX_FUTURE_LENGTH", params.MAX_FUTURE_LENGTH); + vm.serializeUint(paramsKey, "GENESIS_REWARDS_TIMESTAMP", params.GENESIS_REWARDS_TIMESTAMP); + vm.serializeAddress(paramsKey, "REWARDS_UPDATER_ADDRESS", params.REWARDS_UPDATER_ADDRESS); + vm.serializeUint(paramsKey, "ACTIVATION_DELAY", params.ACTIVATION_DELAY); + string memory paramsObject = vm.serializeUint(paramsKey, "GLOBAL_OPERATOR_COMMISSION_BIPS", params.GLOBAL_OPERATOR_COMMISSION_BIPS); + + // Config + string memory configKey = "config"; + vm.serializeString(configKey, environmentKey, environmentObject); + string memory configObject = vm.serializeString(configKey, paramsKey, paramsObject); + + return (configKey, configObject); + } + + function _writeTUP(string memory parentObjectKey, string memory tupKey, TUPInfo memory value) private returns (string memory) { + vm.serializeAddress(tupKey, "proxy", value.proxy); + vm.serializeAddress(tupKey, "impl", value.impl); + string memory tupObject = vm.serializeAddress(tupKey, "pendingImpl", value.pendingImpl); + + return vm.serializeString(parentObjectKey, tupKey, tupObject); + } + + function _writeBeacon(string memory parentObjectKey, string memory beaconKey, BeaconInfo memory value) private returns (string memory) { + vm.serializeAddress(beaconKey, "beacon", value.beacon); + vm.serializeAddress(beaconKey, "impl", value.impl); + string memory beaconObject = vm.serializeAddress(beaconKey, "pendingImpl", value.pendingImpl); + + return vm.serializeString(parentObjectKey, beaconKey, beaconObject); + } + + function _writeStrategies(string memory parentObjectKey, string memory strategiesKey, TUPInfo[] memory infos) private returns (string memory) { + address impl = infos.length == 0 ? address(0) : infos[0].impl; + + address[] memory proxies = new address[](infos.length); + for (uint i = 0; i < infos.length; i++) { + proxies[i] = infos[i].proxy; + } + + vm.serializeAddress(strategiesKey, "impl", impl); + string memory strategiesObject = vm.serializeAddress(strategiesKey, "addrs", proxies); + + return vm.serializeString(parentObjectKey, strategiesKey, strategiesObject); + } + + function _writeToken(string memory parentObjectKey, string memory tokenKey, TokenInfo memory value) private returns (string memory) { + vm.serializeAddress(tokenKey, "proxy", value.proxy); + vm.serializeAddress(tokenKey, "impl", value.impl); + vm.serializeAddress(tokenKey, "pendingImpl", value.pendingImpl); + string memory tokenObject = vm.serializeAddress(tokenKey, "proxyAdmin", value.proxyAdmin); + + return vm.serializeString(parentObjectKey, tokenKey, tokenObject); + } +} \ No newline at end of file diff --git a/script/utils/Encoders.sol b/script/utils/Encoders.sol new file mode 100644 index 000000000..fd27de313 --- /dev/null +++ b/script/utils/Encoders.sol @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +import "./Interfaces.sol"; +import "./TxBuilder.sol"; + +library EncProxyAdmin { + + function upgrade(address proxy, address implementation) internal pure returns (bytes memory) { + return abi.encodeWithSelector(IProxyAdmin.upgrade.selector, proxy, implementation); + } +} + +library EncUpgradeableBeacon { + + function upgradeTo(address implementation) internal pure returns (bytes memory) { + return abi.encodeWithSelector(IUpgradeableBeacon.upgradeTo.selector, implementation); + } +} + +library EncTimelock { + + uint constant TIMELOCK_VALUE = 0; + string constant TIMELOCK_SIGNATURE = ""; + + function queueTransaction(address target, uint eta, bytes memory data) internal pure returns (bytes memory) { + return abi.encodeWithSelector(ITimelock.queueTransaction.selector, + target, + TIMELOCK_VALUE, + TIMELOCK_SIGNATURE, + data, + eta + ); + } + + function executeTransaction(address target, uint eta, bytes memory data) internal pure returns (bytes memory) { + return abi.encodeWithSelector(ITimelock.executeTransaction.selector, + target, + TIMELOCK_VALUE, + TIMELOCK_SIGNATURE, + data, + eta + ); + } + + function cancelTransaction(address target, uint eta, bytes memory data) internal pure returns (bytes memory) { + return abi.encodeWithSelector(ITimelock.cancelTransaction.selector, + target, + TIMELOCK_VALUE, + TIMELOCK_SIGNATURE, + data, + eta + ); + } +} + +library EncGnosisSafe { + + enum Operation { + Call, + DelegateCall + } + + uint constant SAFE_TX_GAS = 0; + uint constant BASE_GAS = 0; + uint constant GAS_PRICE = 0; + address constant GAS_TOKEN = address(uint160(0)); + address constant REFUND_RECEIVER = payable(address(uint160(0))); + + function execTransaction( + address from, + address to, + bytes memory data, + Operation op + ) internal pure returns (bytes memory) { + return encodeForExecutor(from, to, 0, data, op); + } + + function execTransaction( + address from, + address to, + uint value, + bytes memory data, + Operation op + ) internal pure returns (bytes memory) { + return encodeForExecutor(from, to, value, data, op); + } + + function encodeForExecutor( + address from, + address to, + uint value, + bytes memory data, + Operation op + ) internal pure returns (bytes memory) { + bytes1 v = bytes1(uint8(1)); + bytes32 r = bytes32(uint256(uint160(from))); + bytes32 s; + bytes memory sig = abi.encodePacked(r,s,v); + + bytes memory final_calldata_to_executor_multisig = abi.encodeWithSelector(ISafe.execTransaction.selector, + to, + value, + data, + op, + SAFE_TX_GAS, + BASE_GAS, + GAS_PRICE, + GAS_TOKEN, + REFUND_RECEIVER, + sig + ); + + return final_calldata_to_executor_multisig; + } +} + +library EncMultiSendCallOnly { + + using TxBuilder for *; + + function multiSend(Txs storage txs) internal view returns (bytes memory) { + Tx[] memory arr = txs.toArray(); + + bytes memory ret = new bytes(0); + for (uint i = 0; i < arr.length; i++) { + ret = abi.encodePacked( + ret, + abi.encodePacked( + uint8(0), + arr[i].to, + arr[i].value, + uint(arr[i].data.length), + arr[i].data + ) + ); + } + + return abi.encodeWithSelector(IMultiSend.multiSend.selector, ret); + } +} \ No newline at end of file diff --git a/script/utils/Interfaces.sol b/script/utils/Interfaces.sol new file mode 100644 index 000000000..19a9c2712 --- /dev/null +++ b/script/utils/Interfaces.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +interface IProxyAdmin { + function upgrade(address proxy, address implementation) external; + function getProxyImplementation(address proxy) external returns (address); +} + +interface IUpgradeableBeacon { + function upgradeTo(address newImplementation) external; + function implementation() external returns (address); +} + +interface ISafe { + /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction. + /// Note: The fees are always transferred, even if the user transaction fails. + /// @param to Destination address of Safe transaction. + /// @param value Ether value of Safe transaction. + /// @param data Data payload of Safe transaction. + /// @param operation Operation type of Safe transaction. + /// @param safeTxGas Gas that should be used for the Safe transaction. + /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund) + /// @param gasPrice Gas price that should be used for the payment calculation. + /// @param gasToken Token address (or 0 if ETH) that is used for the payment. + /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin). + /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v}) + 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; +} + +interface ITimelock { + function queuedTransactions(bytes32) external view returns (bool); + + 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 cancelTransaction( + address target, + uint value, + string memory signature, + bytes memory data, + uint eta + ) external; +} + +interface IMultiSend { + function multiSend(bytes memory transactions) external payable; +} \ No newline at end of file diff --git a/script/utils/Releasoor.s.sol b/script/utils/Releasoor.s.sol new file mode 100644 index 000000000..bf5937a36 --- /dev/null +++ b/script/utils/Releasoor.s.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +import "./ConfigParser.sol"; +import "./StringUtils.sol"; +import "./AddressUtils.sol"; +import "./TxBuilder.sol"; + +contract Releasoor is ConfigParser { + + using StringUtils for *; + + Environment env; + Params params; + + uint txsCount; + mapping(uint => Txs) transactions; + + string constant DEPLOY = "deploy"; + string constant QUEUE = "queue"; + string constant EXECUTE = "execute"; + + string constant ENV_MAINNET = "mainnet"; + string constant ENV_HOLESKY = "testnet-holesky"; + string constant ENV_PREPROD = "preprod-holesky"; + + string constant CONFIG_MAINNET = "script/configs/mainnet.json"; + string constant CONFIG_HOLESKY = "script/configs/holesky.json"; + string constant CONFIG_PREPROD = "script/configs/preprod.json"; + + string constant CONFIG_ZIPZOOP = "script/configs/zipzoop.json"; + + /// $ run execute mainnet + /// -- requires that you have previously run deploy and queue + /// ... except that sometimes we don't need to run deploy OR queue. For example: + /// I want to write/run a script that just has the ops multisig call `addStratsToWhitelist`. + /// This doesn't involve a timelock, as the ops multisig holds the whitelister role + /// We may have deployed something in the deploy script, but we probably didn't queue anything + /// for this. + /// + /// So, it's mainly important that execute fails if: + /// - We reference a queued transaction that doesn't exist in the timelock + /// - This would mean we haven't called `queue` yet + /// - We reference a pendingImpl that doesn't exist in the config + /// - This would mean we haven't called `deploy` yet + function run(string memory action, string memory _env) public { + _log(action); + _log(_env); + + _log("Running script: ".concat(action).concat(" for env: ").concat(_env)); + + uint currentChainId = block.chainid; + emit log_named_uint("You are currently on chain id", currentChainId); + + // string memory filePath; + // if (_env.eq(ENV_MAINNET)) { + // filePath = CONFIG_MAINNET; + // } else if (_env.eq(ENV_HOLESKY)) { + // filePath = CONFIG_HOLESKY; + // } else if (_env.eq(ENV_PREPROD)) { + // filePath = CONFIG_PREPROD; + // } else { + // revert("invalid env"); + // } + + ( + Addresses memory addrs, + Environment memory _env, + Params memory _params + ) = _readConfigFile(CONFIG_ZIPZOOP); + _printEnv(_env); + + env = _env; + params = _params; + require(_env.chainid == currentChainId, "You are on the wrong chain for this config"); + + bytes32 initialAddrs = keccak256(abi.encode(addrs)); + + if (action.eq(DEPLOY)) { + deploy(addrs); + } else if (action.eq(QUEUE)) { + (Txs storage executorTxns, uint eta) = queueUpgrade(addrs); + + _printQueueUpgradeSummary(executorTxns, eta); + } else if (action.eq(EXECUTE)) { + executeUpgrade(addrs); + } else { + revert("invalid action"); + } + + _log("Script complete"); + + // Check if we made changes to config + if (initialAddrs != keccak256(abi.encode(addrs))) { + _writeConfigFile(addrs, _env, _params); + } + } + + function deploy(Addresses memory addrs) internal virtual { + revert("deploy not implemented"); + } + + function queueUpgrade(Addresses memory addrs) internal virtual returns (Txs storage executorTxns, uint eta) { + revert("queueUpgrade not implemented"); + } + + function executeUpgrade(Addresses memory addrs) internal virtual { + revert("executeUpgrade not implemented"); + } + + function _newTxs() internal returns (Txs storage) { + Txs storage txs = transactions[txsCount]; + txsCount++; + + return txs; + } + + function _printQueueUpgradeSummary(Txs storage executorTxns, uint eta) internal { + bytes memory calldata_to_multisend_contract = EncMultiSendCallOnly.multiSend(executorTxns); + emit log_named_bytes("calldata_to_multisend_contract", calldata_to_multisend_contract); + + bytes memory final_calldata_to_executor_multisig = EncGnosisSafe.execTransaction({ + from: addrs.timelock, + to: params.multiSendCallOnly, + data: calldata_to_multisend_contract, + op: EncGnosisSafe.Operation.DelegateCall + }); + emit log_named_bytes("final_calldata_to_executor_multisig", final_calldata_to_executor_multisig); + + bytes memory calldata_to_timelock_queueing_action = EncTimelock.queueTransaction({ + target: addrs.executorMultisig, + data: final_calldata_to_executor_multisig, + eta: 0 + }); + emit log_named_bytes("calldata_to_timelock_queueing_action", calldata_to_timelock_queueing_action); + } + + function _log(string memory s) internal { + emit log(s); + } + + function _log(string memory s, address a) internal { + emit log_named_address(s, a); + } +} \ No newline at end of file diff --git a/script/utils/StringUtils.sol b/script/utils/StringUtils.sol new file mode 100644 index 000000000..6ba78f480 --- /dev/null +++ b/script/utils/StringUtils.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +library StringUtils { + + function eq(string memory a, string memory b) internal pure returns (bool) { + return keccak256(bytes(a)) == keccak256(bytes(b)); + } + + function concat(string memory a, string memory b) internal pure returns (string memory) { + return string.concat(a, b); + } +} \ No newline at end of file diff --git a/script/utils/TxBuilder.sol b/script/utils/TxBuilder.sol new file mode 100644 index 000000000..fe8b1ee7b --- /dev/null +++ b/script/utils/TxBuilder.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +struct Tx { + address to; + uint256 value; + bytes data; +} + +struct Txs { + uint txCount; + mapping(uint => Tx) txns; +} + +library TxBuilder { + + function append(Txs storage txs, address to, bytes memory data) internal returns (Txs storage) { + txs.txns[txs.txCount] = Tx({ + to: to, + value: 0, + data: data + }); + + txs.txCount++; + return txs; + } + + function append(Txs storage txs, address to, uint value, bytes memory data) internal returns (Txs storage) { + txs.txns[txs.txCount] = Tx({ + to: to, + value: value, + data: data + }); + + txs.txCount++; + return txs; + } + + function toArray(Txs storage txs) internal view returns (Tx[] memory) { + Tx[] memory arr = new Tx[](txs.txCount); + + for (uint i = 0; i < arr.length; i++) { + arr[i] = txs.txns[i]; + } + + return arr; + } +} \ No newline at end of file diff --git a/script/utils/Multisend.sol b/script/utils/old/Multisend.sol similarity index 100% rename from script/utils/Multisend.sol rename to script/utils/old/Multisend.sol diff --git a/script/utils/TimelockEncoding.sol b/script/utils/old/TimelockEncoding.sol similarity index 100% rename from script/utils/TimelockEncoding.sol rename to script/utils/old/TimelockEncoding.sol diff --git a/script/utils/TxEncodingInterfaces.sol b/script/utils/old/TxEncodingInterfaces.sol similarity index 100% rename from script/utils/TxEncodingInterfaces.sol rename to script/utils/old/TxEncodingInterfaces.sol 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 db458e99d..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, DSTest { - // 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); - } -}