From 12f5bc5fc3a56bb4679d25046c6e22d0b6839410 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:37:18 -0700 Subject: [PATCH 1/2] rewards manager deployment script --- contracts/l1-deployer-cli.sh | 12 +++++++ .../rewards/DeployRewardManager.s.sol | 36 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol diff --git a/contracts/l1-deployer-cli.sh b/contracts/l1-deployer-cli.sh index 4540cc92d..cbc4602a0 100755 --- a/contracts/l1-deployer-cli.sh +++ b/contracts/l1-deployer-cli.sh @@ -5,6 +5,7 @@ deploy_vanilla_flag=false deploy_avs_flag=false deploy_middleware_flag=false deploy_router_flag=false +deploy_rewards_flag=false skip_release_verification_flag=false resume_flag=false wallet_type="" @@ -24,6 +25,7 @@ help() { echo " deploy-avs Deploy and verify the MevCommitAVS contract to L1." echo " deploy-middleware Deploy and verify the MevCommitMiddleware contract to L1." echo " deploy-router Deploy and verify the ValidatorOptInRouter contract to L1." + echo " deploy-rewards Deploy and verify the RewardManager contract to L1." echo echo "Required Options:" echo " --chain, -c Specify the chain to deploy to ('mainnet' or 'holesky')." @@ -122,6 +124,10 @@ parse_args() { deploy_router_flag=true shift ;; + deploy-rewards) + deploy_rewards_flag=true + shift + ;; --chain|-c) if [[ -z "$2" ]]; then echo "Error: --chain requires an argument." @@ -383,6 +389,10 @@ deploy_router() { deploy_contract_generic "scripts/validator-registry/DeployValidatorOptInRouter.s.sol" } +deploy_rewards() { + deploy_contract_generic "scripts/validator-registry/rewards/DeployRewardManager.s.sol" +} + main() { check_dependencies parse_args "$@" @@ -406,6 +416,8 @@ main() { deploy_middleware elif [[ "${deploy_router_flag}" == true ]]; then deploy_router + elif [[ "${deploy_rewards_flag}" == true ]]; then + deploy_rewards else usage fi diff --git a/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol b/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol new file mode 100644 index 000000000..0019b3aa9 --- /dev/null +++ b/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: BSL 1.1 + +// solhint-disable no-console +// solhint-disable one-contract-per-file + +pragma solidity 0.8.26; +import {RewardManager} from "../../../contracts/validator-registry/rewards/RewardManager.sol"; +import {Script} from "forge-std/Script.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; +import {MainnetConstants} from "../../MainnetConstants.sol"; + +contract DeployMainnet is Script { + address constant public VANILLA_REGISTRY = 0x47afdcB2B089C16CEe354811EA1Bbe0DB7c335E9; + address constant public MEV_COMMIT_AVS = 0xBc77233855e3274E1903771675Eb71E602D9DC2e; + address constant public MEV_COMMIT_MIDDLEWARE = 0x21fD239311B050bbeE7F32850d99ADc224761382; + uint256 constant public AUTO_CLAIM_GAS_LIMIT = 250_000; + address constant public OWNER = MainnetConstants.PRIMEV_TEAM_MULTISIG; + function run() public { + require(block.chainid == 1, "must deploy on mainnet"); + vm.startBroadcast(); + + address proxy = Upgrades.deployUUPSProxy( + "RewardManager.sol", + abi.encodeCall( + RewardManager.initialize, + (VANILLA_REGISTRY, + MEV_COMMIT_AVS, + MEV_COMMIT_MIDDLEWARE, + AUTO_CLAIM_GAS_LIMIT, + OWNER) + ) + ); + console.log("RewardManager UUPS proxy deployed to:", address(proxy)); + vm.stopBroadcast(); + } +} From 0c85424de235b6a72caa12aa0d7e107c361cdec1 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:45:09 -0700 Subject: [PATCH 2/2] Update DeployRewardManager.s.sol --- .../scripts/validator-registry/rewards/DeployRewardManager.s.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol b/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol index 0019b3aa9..cad5f2579 100644 --- a/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol +++ b/contracts/scripts/validator-registry/rewards/DeployRewardManager.s.sol @@ -8,6 +8,7 @@ import {RewardManager} from "../../../contracts/validator-registry/rewards/Rewar import {Script} from "forge-std/Script.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import {MainnetConstants} from "../../MainnetConstants.sol"; +import {console} from "forge-std/console.sol"; contract DeployMainnet is Script { address constant public VANILLA_REGISTRY = 0x47afdcB2B089C16CEe354811EA1Bbe0DB7c335E9;