From 48aa2a956ebc3819c6b640a5057a77c155e24a4a Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:31:01 -0800 Subject: [PATCH 1/2] Add DeployMainnet for router file --- .../DeployValidatorOptInRouter.s.sol | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol b/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol index 9f6aef56f..ed3da864d 100644 --- a/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol +++ b/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol @@ -9,6 +9,7 @@ import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import {ValidatorOptInRouter} from "../../contracts/validator-registry/ValidatorOptInRouter.sol"; +import {MainnetConstants} from "../MainnetConstants.sol"; contract BaseDeploy is Script { function deployValidatorOptInRouter( @@ -32,6 +33,34 @@ contract BaseDeploy is Script { } } +/// Temporary stand-in until the mev-commit middleware and symbiotic core, are ready for mainnet. +contract AlwaysFalseMevCommitMiddleware { + function isValidatorOptedIn(bytes calldata) external pure returns (bool) { + return false; + } +} + +contract DeployMainnet is BaseDeploy { + address constant public VANILLA_REGISTRY = 0x47afdcB2B089C16CEe354811EA1Bbe0DB7c335E9; + address constant public MEV_COMMIT_AVS = 0xBc77233855e3274E1903771675Eb71E602D9DC2e; + address constant public OWNER = MainnetConstants.PRIMEV_TEAM_MULTISIG; + + function run() external { + require(block.chainid == 1, "must deploy on mainnet"); + vm.startBroadcast(); + + AlwaysFalseMevCommitMiddleware alwaysFalseMevCommitMiddleware = new AlwaysFalseMevCommitMiddleware(); + + deployValidatorOptInRouter( + VANILLA_REGISTRY, + MEV_COMMIT_AVS, + address(alwaysFalseMevCommitMiddleware), + OWNER + ); + vm.stopBroadcast(); + } +} + contract DeployHolesky is BaseDeploy { address constant public VANILLA_REGISTRY = 0x87D5F694fAD0b6C8aaBCa96277DE09451E277Bcf; address constant public MEV_COMMIT_AVS = 0xEDEDB8ed37A43Fd399108A44646B85b780D85DD4; From 34f3c137317db1a1655e40d6a07ac994d4ea66fd Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:15:49 -0800 Subject: [PATCH 2/2] fix: move AlwaysFalseMevCommitMiddleware to its own file for proper contract verification --- contracts/contracts/utils/AlwaysFalseMiddleware.sol | 9 +++++++++ .../validator-registry/DeployValidatorOptInRouter.s.sol | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 contracts/contracts/utils/AlwaysFalseMiddleware.sol diff --git a/contracts/contracts/utils/AlwaysFalseMiddleware.sol b/contracts/contracts/utils/AlwaysFalseMiddleware.sol new file mode 100644 index 000000000..563dc2e1b --- /dev/null +++ b/contracts/contracts/utils/AlwaysFalseMiddleware.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BSL 1.1 +pragma solidity 0.8.26; + +/// Temporary stand-in until the mev-commit middleware and symbiotic core, are ready for mainnet. +contract AlwaysFalseMevCommitMiddleware { + function isValidatorOptedIn(bytes calldata) external pure returns (bool) { + return false; + } +} diff --git a/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol b/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol index ed3da864d..08a38ecb4 100644 --- a/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol +++ b/contracts/scripts/validator-registry/DeployValidatorOptInRouter.s.sol @@ -10,6 +10,7 @@ import {console} from "forge-std/console.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import {ValidatorOptInRouter} from "../../contracts/validator-registry/ValidatorOptInRouter.sol"; import {MainnetConstants} from "../MainnetConstants.sol"; +import {AlwaysFalseMevCommitMiddleware} from "../../contracts/utils/AlwaysFalseMiddleware.sol"; contract BaseDeploy is Script { function deployValidatorOptInRouter( @@ -33,13 +34,6 @@ contract BaseDeploy is Script { } } -/// Temporary stand-in until the mev-commit middleware and symbiotic core, are ready for mainnet. -contract AlwaysFalseMevCommitMiddleware { - function isValidatorOptedIn(bytes calldata) external pure returns (bool) { - return false; - } -} - contract DeployMainnet is BaseDeploy { address constant public VANILLA_REGISTRY = 0x47afdcB2B089C16CEe354811EA1Bbe0DB7c335E9; address constant public MEV_COMMIT_AVS = 0xBc77233855e3274E1903771675Eb71E602D9DC2e;