Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/libraries/RevSharePredeploys.sol
Original file line number Diff line number Diff line change
@@ -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;
}
21 changes: 4 additions & 17 deletions src/template/LateOptInRevenueShare.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {RevSharePredeploys} from "src/libraries/RevSharePredeploys.sol";

/// @notice Interface for the OptimismPortal2 in L1. This is the main interaction point for the template.
interface IOptimismPortal2 {
Expand Down Expand Up @@ -42,28 +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 {
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 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 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;
Expand Down Expand Up @@ -220,7 +207,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);

Expand Down Expand Up @@ -266,7 +253,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(
Expand Down
22 changes: 4 additions & 18 deletions src/template/RevenueShareUpgradePath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down