Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Nov 8, 2024
1 parent 281fc65 commit f630bad
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
8 changes: 8 additions & 0 deletions contracts/scripts/MainnetConstants.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: BSL 1.1

pragma solidity 0.8.26;

library MainnetConstants {
address constant public PRIMEV_TEAM_MULTISIG = 0x0000000000000000000000000000000000000000; // TODO: multisig
address constant public PRECONF_ETH_ADDR = 0xfA0B0f5d298d28EFE4d35641724141ef19C05684; // preconf.eth
}
18 changes: 18 additions & 0 deletions contracts/scripts/validator-registry/DeployVanillaRegistry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {Script} from "forge-std/Script.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
import {VanillaRegistry} from "../../contracts/validator-registry/VanillaRegistry.sol";
import {console} from "forge-std/console.sol";
import {MainnetConstants} from "../MainnetConstants.sol";

contract BaseDeploy is Script {
function deployVanillaRegistry(
Expand All @@ -34,6 +35,23 @@ contract BaseDeploy is Script {
}
}

contract DeployMainnet is BaseDeploy {
address constant public OWNER = MainnetConstants.PRIMEV_TEAM_MULTISIG;

uint256 constant public MIN_STAKE = 3 ether;
address constant public SLASH_ORACLE = MainnetConstants.PRIMEV_TEAM_MULTISIG;
address constant public SLASH_RECEIVER = MainnetConstants.PRECONF_ETH_ADDR;
uint256 constant public UNSTAKE_PERIOD_BLOCKS = 12000; // ~ 1 day
uint256 constant public PAYOUT_PERIOD_BLOCKS = 12000; // ~ 1 day

function run() external {
require(block.chainid == 1, "must deploy on mainnet");
vm.startBroadcast();
deployVanillaRegistry(MIN_STAKE, SLASH_ORACLE, SLASH_RECEIVER, UNSTAKE_PERIOD_BLOCKS, PAYOUT_PERIOD_BLOCKS, OWNER);
vm.stopBroadcast();
}
}

contract DeployHolesky is BaseDeploy {
uint256 constant public MIN_STAKE = 0.0001 ether; // 10k vals = 1 ETH cost
address constant public SLASH_ORACLE = 0x4535bd6fF24860b5fd2889857651a85fb3d3C6b1;
Expand Down
54 changes: 54 additions & 0 deletions contracts/scripts/validator-registry/avs/DeployAVS.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {IEigenPodManager} from "eigenlayer-contracts/src/contracts/interfaces/IE
import {IStrategyManager} from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";
import {IAVSDirectory} from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol";
import {EigenHoleskyReleaseConsts} from "./ReleaseAddrConsts.sol";
import {EigenMainnetReleaseConsts} from "./ReleaseAddrConsts.sol";
import {MainnetConstants} from "../../MainnetConstants.sol";

contract BaseDeploy is Script {
function deployMevCommitAVS(
Expand Down Expand Up @@ -62,6 +64,58 @@ contract BaseDeploy is Script {
}
}

contract DeployMainnet is BaseDeploy {
address constant public OWNER = MainnetConstants.PRIMEV_TEAM_MULTISIG;

IDelegationManager constant public DELEGATION_MANAGER = IDelegationManager(EigenMainnetReleaseConsts.DELEGATION_MANAGER);
IEigenPodManager constant public EIGENPOD_MANAGER = IEigenPodManager(EigenMainnetReleaseConsts.EIGENPOD_MANAGER);
IStrategyManager constant public STRATEGY_MANAGER = IStrategyManager(EigenMainnetReleaseConsts.STRATEGY_MANAGER);
IAVSDirectory constant public AVS_DIRECTORY = IAVSDirectory(EigenMainnetReleaseConsts.AVS_DIRECTORY);
address constant public FREEZE_ORACLE = MainnetConstants.PRIMEV_TEAM_MULTISIG;
uint256 constant public UNFREEZE_FEE = 3 ether;
address constant public UNFREEZE_RECEIVER = MainnetConstants.PRECONF_ETH_ADDR;
uint256 constant public UNFREEZE_PERIOD_BLOCKS = 12000; // ~ 1 day
uint256 constant public OPERATOR_DEREG_PERIOD_BLOCKS = 12000; // ~ 1 day
uint256 constant public VALIDATOR_DEREG_PERIOD_BLOCKS = 12000; // ~ 1 day
uint256 constant public LST_RESTARKER_DEREG_PERIOD_BLOCKS = 12000; // ~ 1 day

function run() external {
require(block.chainid == 1, "must deploy on mainnet");
vm.startBroadcast();
address[] memory restakeableStrategies = new address[](11);
restakeableStrategies[0] = EigenMainnetReleaseConsts.STRATEGY_BASE_CBETH;
restakeableStrategies[1] = EigenMainnetReleaseConsts.STRATEGY_BASE_STETH;
restakeableStrategies[2] = EigenMainnetReleaseConsts.STRATEGY_BASE_RETH;
restakeableStrategies[3] = EigenMainnetReleaseConsts.STRATEGY_BASE_ETHX;
restakeableStrategies[4] = EigenMainnetReleaseConsts.STRATEGY_BASE_ANKRETH;
restakeableStrategies[5] = EigenMainnetReleaseConsts.STRATEGY_BASE_OETH;
restakeableStrategies[6] = EigenMainnetReleaseConsts.STRATEGY_BASE_OSETH;
restakeableStrategies[7] = EigenMainnetReleaseConsts.STRATEGY_BASE_SWETH;
restakeableStrategies[8] = EigenMainnetReleaseConsts.STRATEGY_BASE_WBETH;
restakeableStrategies[9] = EigenMainnetReleaseConsts.STRATEGY_BASE_SFRXETH;
restakeableStrategies[10] = EigenMainnetReleaseConsts.STRATEGY_BASE_LSETH;
restakeableStrategies[11] = EigenMainnetReleaseConsts.STRATEGY_BASE_METH;
restakeableStrategies[12] = EigenMainnetReleaseConsts.BEACON_CHAIN_ETH;

deployMevCommitAVS(
OWNER,
DELEGATION_MANAGER,
EIGENPOD_MANAGER,
STRATEGY_MANAGER,
AVS_DIRECTORY,
restakeableStrategies,
FREEZE_ORACLE,
UNFREEZE_FEE,
UNFREEZE_RECEIVER,
UNFREEZE_PERIOD_BLOCKS,
OPERATOR_DEREG_PERIOD_BLOCKS,
VALIDATOR_DEREG_PERIOD_BLOCKS,
LST_RESTARKER_DEREG_PERIOD_BLOCKS
);
vm.stopBroadcast();
}
}

contract DeployHolesky is BaseDeploy {
// This is the most important field. On mainnet it'll be the primev multisig.
address constant public OWNER = 0x4535bd6fF24860b5fd2889857651a85fb3d3C6b1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pragma solidity 0.8.26;

/// @notice Constants from https://github.com/Layr-Labs/eigenlayer-contracts?tab=readme-ov-file#deployments,
/// @notice Last updated 07-26-2024
/// @notice Last updated 11-07-2024
library EigenMainnetReleaseConsts {

address internal constant DELEGATION_MANAGER = 0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A;
Expand Down

0 comments on commit f630bad

Please sign in to comment.