-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
pragma solidity ^0.8.12; | ||
|
||
import "src/*"; | ||
|
||
contract Mainnet_PEPE_0_4_2 is DeploymentUtils { | ||
|
||
function deploy() public virtual { | ||
// Deploy EigenPod | ||
eigenPodImplementation = new EigenPod( | ||
IETHPOSDeposit(ETHPOSDepositAddress), | ||
eigenPodManager, | ||
EIGENPOD_GENESIS_TIME | ||
); | ||
|
||
// Deploy EigenPodManager | ||
eigenPodManagerImplementation = new EigenPodManager( | ||
IETHPOSDeposit(ETHPOSDepositAddress), | ||
eigenPodBeacon, | ||
strategyManager, | ||
slasher, | ||
delegationManager | ||
); | ||
|
||
cfg.setDeploy(EIGENPOD, address(eigenPodImplementation)); | ||
cfg.setDeploy(EIGENPOD_MANAGER, address(eigenPodManagerImplementation)); | ||
} | ||
|
||
function queueUpgrade() public virtual { | ||
|
||
} | ||
|
||
function executeQueued() public virtual { | ||
|
||
} | ||
|
||
// Executor multisig calls proxyAdmin/beacon proxies and upgrades | ||
// (or calls contracts and sets values) | ||
function doUpgrade() public virtual { | ||
return executorMultisig.startBroadcast() | ||
.upgrade(eigenPodBeacon, newEigenPodImpl) | ||
.upgrade(eigenPodManager, newEigenPodManagerImpl) | ||
.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity =0.8.12; | ||
|
||
import "@compound/contracts/Timelock.sol"; | ||
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/Test.sol"; | ||
|
||
import "../../utils/EncodeSafeTransactionMainnet.sol"; | ||
import "../../utils/Multisend.sol"; | ||
import "../../utils/ProxyInterfaces.sol"; | ||
|
||
contract v0_4_5_pepe is EncodeSafeTransactionMainnet, Script { | ||
|
||
function deploy() public { | ||
// Deploy EigenPod | ||
EigenPod newEigenPodImpl = new EigenPod( | ||
cfg.ETHPOSDepositAddress, | ||
cfg.eigenPodManager.proxy, | ||
cfg.EIGENPOD_GENESIS_TIME | ||
); | ||
|
||
// Deploy EigenPodManager | ||
EigenPodManager newEigenPodManagerImpl = new EigenPodManager( | ||
cfg.ETHPOSDepositAddress, | ||
cfg.eigenPodBeacon.proxy, | ||
cfg.strategyManager.proxy, | ||
cfg.slasher.proxy, | ||
cfg.delegationManager.proxy | ||
); | ||
|
||
// Updates `config/$network.json` with a "pendingImpl" for both of these contracts | ||
cfg.eigenPodBeacon.setPending(address(newEigenPodImpl)); | ||
cfg.eigenPodManager.setPending(address(newEigenPodManagerImpl)); | ||
} | ||
|
||
function test_Deploy() public { | ||
deploy(); | ||
|
||
// Check constants/immutables set on deployment | ||
require(EigenPod(cfg.eigenPodBeacon.pendingImpl).activeValidatorCount() == 0); | ||
} | ||
|
||
// Mock out the upgrade flow as if you were pranking the executor multisig | ||
// | ||
// Depending on the network you're using, this will resolve to: | ||
// - (local) pranking the executor multisig and running the calls | ||
// - (preprod) multicall via the gigawhale private key | ||
// - (holesky) multicall via the community multisig | ||
// - (mainnet) queue + execute via ops and timelock | ||
function execute() public { | ||
executorMultisig.startBroadcast() // start building txn | ||
.upgrade(eigenPodBeacon, cfg.eigenPodBeacon.pendingImpl) // create call to BeaconProxy | ||
.upgrade(eigenPodManager, cfg.eigenPodManager.pendingImpl) // create call to ProxyAdmin | ||
.stopBroadcast(); // finish txn as multicall | ||
} | ||
|
||
function test_Execute() public { | ||
// do some initial checks here | ||
vm.expectRevert(); | ||
IEigenPod(cfg.eigenPodBeacon.impl).activeValidatorCount(); | ||
|
||
// run the upgrade | ||
execute(); | ||
|
||
// do some final checks here | ||
require(IEigenPod(cfg.eigenPodBeacon.impl).activeValidatorCount() == 0); | ||
} | ||
} |