From 64e2734a539a325528f6b76c24838dce88975aed Mon Sep 17 00:00:00 2001 From: 0xDiscotech <131301107+0xDiscotech@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:05:10 -0300 Subject: [PATCH 1/2] chore: predeploys --- src/template/LateOptInRevenueShare.sol | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/template/LateOptInRevenueShare.sol b/src/template/LateOptInRevenueShare.sol index 79e42aaaa..3a08cf30a 100644 --- a/src/template/LateOptInRevenueShare.sol +++ b/src/template/LateOptInRevenueShare.sol @@ -11,6 +11,7 @@ import {RevShareCodeRepo} from "src/libraries/RevShareCodeRepo.sol"; import {Utils} from "src/libraries/Utils.sol"; import {MultisigTaskPrinter} from "src/libraries/MultisigTaskPrinter.sol"; import {RevShareGasLimits} from "src/libraries/RevShareGasLimits.sol"; +import {Predeploys} from "lib/optimism/packages/contracts-bedrock/src/libraries/Predeploys.sol"; /// @notice Interface for the OptimismPortal2 in L1. This is the main interaction point for the template. interface IOptimismPortal2 { @@ -43,22 +44,26 @@ interface IFeeVault { /// - Complete Vault Setup: Configures Base, Sequencer, L1, and Operator fee vaults /// - L1 Withdrawer Support: Optional deployment with configurable parameters contract LateOptInRevenueShare is SimpleTaskBase { + using Predeploys for *; using LibString for string; using stdToml for string; /// @notice Address of the Create2Deployer Preinstall on L2. address internal constant CREATE2_DEPLOYER = 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2; - /// @notice Address of the Sequencer Fee Vault Predeploy on L2. - address internal constant SEQUENCER_FEE_VAULT = 0x4200000000000000000000000000000000000011; + /// @notice Address of the Operator Fee Vault Predeploy on L2. address internal constant OPERATOR_FEE_VAULT = 0x420000000000000000000000000000000000001b; - /// @notice Address of the Base Fee Vault Predeploy on L2. - address internal constant BASE_FEE_VAULT = 0x4200000000000000000000000000000000000019; - /// @notice Address of the L1 Fee Vault Predeploy on L2. - address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A; /// @notice Address of the FeeSplitter Predeploy on L2. address internal constant FEE_SPLITTER = 0x420000000000000000000000000000000000002B; + /// @notice Address of the Sequencer Fee Vault Predeploy on L2. + address internal immutable SEQUENCER_FEE_WALLET = Predeploys.SEQUENCER_FEE_WALLET; + /// @notice Address of the L1 Fee Vault Predeploy on L2. + address internal immutable L1_FEE_VAULT = Predeploys.L1_FEE_VAULT; + /// @notice Address of the Base Fee Vault Predeploy on L2. + address internal immutable BASE_FEE_VAULT = Predeploys.BASE_FEE_VAULT; + /// @notice The default minimum withdrawal amount for the FeeVault once part of the Revenue Share system. + uint256 public constant FEE_VAULT_MIN_WITHDRAWAL_AMOUNT = 0; /// @notice The default withdrawal network for the FeeVault once part of the Revenue Share system, 0 = L1, 1 = L2 uint8 public constant FEE_VAULT_WITHDRAWAL_NETWORK = 1; @@ -220,7 +225,7 @@ contract LateOptInRevenueShare is SimpleTaskBase { // Take into account the calls for setting up the vaults _incrementCallsForVault(BASE_FEE_VAULT); - _incrementCallsForVault(SEQUENCER_FEE_VAULT); + _incrementCallsForVault(SEQUENCER_FEE_WALLET); _incrementCallsForVault(L1_FEE_VAULT); _incrementCallsForVault(OPERATOR_FEE_VAULT); @@ -266,7 +271,7 @@ contract LateOptInRevenueShare is SimpleTaskBase { ); _setFeeVaultConfiguration( - SEQUENCER_FEE_VAULT, FEE_VAULT_MIN_WITHDRAWAL_AMOUNT, FEE_VAULT_RECIPIENT, FEE_VAULT_WITHDRAWAL_NETWORK + SEQUENCER_FEE_WALLET, FEE_VAULT_MIN_WITHDRAWAL_AMOUNT, FEE_VAULT_RECIPIENT, FEE_VAULT_WITHDRAWAL_NETWORK ); _setFeeVaultConfiguration( From ec0c8c118ed9b943bf6c5f62db0ae88fae76f84f Mon Sep 17 00:00:00 2001 From: 0xDiscotech <131301107+0xDiscotech@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:27:27 -0300 Subject: [PATCH 2/2] chore: custom file for predeploys --- src/libraries/RevSharePredeploys.sol | 23 +++++++++++++++++++++++ src/template/LateOptInRevenueShare.sol | 22 ++-------------------- src/template/RevenueShareUpgradePath.sol | 22 ++++------------------ 3 files changed, 29 insertions(+), 38 deletions(-) create mode 100644 src/libraries/RevSharePredeploys.sol diff --git a/src/libraries/RevSharePredeploys.sol b/src/libraries/RevSharePredeploys.sol new file mode 100644 index 000000000..09d66d9cb --- /dev/null +++ b/src/libraries/RevSharePredeploys.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; + +// TODO: Import `FeeSplitter` and `OperatorFeeVault` from the Optimism contracts library once they are included. +/// @notice Library for storing the predeploys for the Revenue Share templates +abstract contract RevSharePredeploys { + /// @notice Address of the Create2Deployer Preinstall on L2. + address internal constant CREATE2_DEPLOYER = 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2; + /// @notice Address of the Operator Fee Vault Predeploy on L2. + address internal constant OPERATOR_FEE_VAULT = 0x420000000000000000000000000000000000001b; + /// @notice Address of the FeeSplitter Predeploy on L2. + address internal constant FEE_SPLITTER = 0x420000000000000000000000000000000000002B; + /// @notice Address of the Sequencer Fee Vault Predeploy on L2. + address internal constant SEQUENCER_FEE_WALLET = 0x4200000000000000000000000000000000000011; + /// @notice Address of the L1 Fee Vault Predeploy on L2. + address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A; + /// @notice Address of the Base Fee Vault Predeploy on L2. + address internal constant BASE_FEE_VAULT = 0x4200000000000000000000000000000000000019; + /// @notice The default recipient for the FeeVault once part of the Revenue Share system. + address public constant FEE_VAULT_RECIPIENT = FEE_SPLITTER; + /// @notice Address of the ProxyAdmin predeploy on L2. + address internal constant PROXY_ADMIN = 0x4200000000000000000000000000000000000018; +} diff --git a/src/template/LateOptInRevenueShare.sol b/src/template/LateOptInRevenueShare.sol index 3a08cf30a..d906aba64 100644 --- a/src/template/LateOptInRevenueShare.sol +++ b/src/template/LateOptInRevenueShare.sol @@ -11,7 +11,7 @@ import {RevShareCodeRepo} from "src/libraries/RevShareCodeRepo.sol"; import {Utils} from "src/libraries/Utils.sol"; import {MultisigTaskPrinter} from "src/libraries/MultisigTaskPrinter.sol"; import {RevShareGasLimits} from "src/libraries/RevShareGasLimits.sol"; -import {Predeploys} from "lib/optimism/packages/contracts-bedrock/src/libraries/Predeploys.sol"; +import {RevSharePredeploys} from "src/libraries/RevSharePredeploys.sol"; /// @notice Interface for the OptimismPortal2 in L1. This is the main interaction point for the template. interface IOptimismPortal2 { @@ -43,32 +43,14 @@ interface IFeeVault { /// - Flexible Calculator: Use custom calculator or deploy default SuperchainRevSharesCalculator implementation /// - Complete Vault Setup: Configures Base, Sequencer, L1, and Operator fee vaults /// - L1 Withdrawer Support: Optional deployment with configurable parameters -contract LateOptInRevenueShare is SimpleTaskBase { - using Predeploys for *; +contract LateOptInRevenueShare is SimpleTaskBase, RevSharePredeploys { using LibString for string; using stdToml for string; - /// @notice Address of the Create2Deployer Preinstall on L2. - address internal constant CREATE2_DEPLOYER = 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2; - - /// @notice Address of the Operator Fee Vault Predeploy on L2. - address internal constant OPERATOR_FEE_VAULT = 0x420000000000000000000000000000000000001b; - /// @notice Address of the FeeSplitter Predeploy on L2. - address internal constant FEE_SPLITTER = 0x420000000000000000000000000000000000002B; - /// @notice Address of the Sequencer Fee Vault Predeploy on L2. - address internal immutable SEQUENCER_FEE_WALLET = Predeploys.SEQUENCER_FEE_WALLET; - /// @notice Address of the L1 Fee Vault Predeploy on L2. - address internal immutable L1_FEE_VAULT = Predeploys.L1_FEE_VAULT; - /// @notice Address of the Base Fee Vault Predeploy on L2. - address internal immutable BASE_FEE_VAULT = Predeploys.BASE_FEE_VAULT; - /// @notice The default minimum withdrawal amount for the FeeVault once part of the Revenue Share system. - uint256 public constant FEE_VAULT_MIN_WITHDRAWAL_AMOUNT = 0; /// @notice The default withdrawal network for the FeeVault once part of the Revenue Share system, 0 = L1, 1 = L2 uint8 public constant FEE_VAULT_WITHDRAWAL_NETWORK = 1; - /// @notice The default recipient for the FeeVault once part of the Revenue Share system. - address public constant FEE_VAULT_RECIPIENT = FEE_SPLITTER; /// @notice The portal we are targeting for L2 calls. address public portal; diff --git a/src/template/RevenueShareUpgradePath.sol b/src/template/RevenueShareUpgradePath.sol index 14709d6ce..e20e2f34e 100644 --- a/src/template/RevenueShareUpgradePath.sol +++ b/src/template/RevenueShareUpgradePath.sol @@ -10,6 +10,7 @@ import {MultisigTaskPrinter} from "src/libraries/MultisigTaskPrinter.sol"; import {RevShareCodeRepo} from "src/libraries/RevShareCodeRepo.sol"; import {RevShareGasLimits} from "src/libraries/RevShareGasLimits.sol"; import {Utils} from "src/libraries/Utils.sol"; +import {RevSharePredeploys} from "src/libraries/RevSharePredeploys.sol"; /// @notice Interface for the OptimismPortal2 in L1. This is the main interaction point for the template. interface IOptimismPortal2 { @@ -40,25 +41,10 @@ interface IProxyAdmin { } /// @notice A template contract for chains to upgrade to the Revenue Share v1.0.0 implementation. -contract RevenueShareV100UpgradePath is SimpleTaskBase { +contract RevenueShareV100UpgradePath is SimpleTaskBase, RevSharePredeploys { using LibString for string; using stdToml for string; - /// @notice Address of the Create2Deployer Preinstall on L2. - address internal constant CREATE2_DEPLOYER = 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2; - /// @notice Address of the Sequencer Fee Vault Predeploy on L2. - address internal constant SEQUENCER_FEE_VAULT = 0x4200000000000000000000000000000000000011; - /// @notice Address of the Operator Fee Vault Predeploy on L2. - address internal constant OPERATOR_FEE_VAULT = 0x420000000000000000000000000000000000001b; - /// @notice Address of the Base Fee Vault Predeploy on L2. - address internal constant BASE_FEE_VAULT = 0x4200000000000000000000000000000000000019; - /// @notice Address of the L1 Fee Vault Predeploy on L2. - address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A; - /// @notice Address of the FeeSplitter Predeploy on L2. - address internal constant FEE_SPLITTER = 0x420000000000000000000000000000000000002B; - /// @notice Address of the ProxyAdmin predeploy on L2. - address internal constant PROXY_ADMIN = 0x4200000000000000000000000000000000000018; - /// @notice Used to validate calls made to the OptimismPortal. mapping(bytes32 => uint8) internal _callsToPortal; @@ -393,7 +379,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { abi.encodeCall( IProxyAdmin.upgradeAndCall, ( - payable(SEQUENCER_FEE_VAULT), + payable(SEQUENCER_FEE_WALLET), address(_sequencerFeeVaultPrecalculatedAddress), abi.encodeCall( IFeeVault.initialize, @@ -643,7 +629,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { abi.encodeCall( IProxyAdmin.upgradeAndCall, ( - payable(SEQUENCER_FEE_VAULT), + payable(SEQUENCER_FEE_WALLET), address(_sequencerFeeVaultPrecalculatedAddress), abi.encodeCall( IFeeVault.initialize,