Skip to content
Verified contractPartialMIT

OPContractsManagerStandardValidator

Address0xae6153ec750dfb0871b3e2287caacc0c19f9e809
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.15

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.15+commit.e14f2714
Language
solidity
Optimization
Yes, 200 runs
EVM version
london
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,480,487
Creation transaction
0xddd9a4984f…b14dee3220

50 files

The source code is large: one file is shown at a time. Choose a file in the list.

src/libraries/Predeploys.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Libraries
import { Fork } from "scripts/libraries/Config.sol";
import { DevFeatures } from "src/libraries/DevFeatures.sol";

/// @title Predeploys
/// @notice Contains constant addresses for protocol contracts that are pre-deployed to the L2 system.
//          This excludes the preinstalls (non-protocol contracts).
library Predeploys {
    /// @notice Number of predeploy-namespace addresses reserved for protocol usage.
    uint256 internal constant PREDEPLOY_COUNT = 2048;

    /// @custom:legacy
    /// @notice Address of the LegacyMessagePasser predeploy. Deprecate. Use the updated
    ///         L2ToL1MessagePasser contract instead.
    address internal constant LEGACY_MESSAGE_PASSER = 0x4200000000000000000000000000000000000000;

    /// @custom:legacy
    /// @notice Address of the L1MessageSender predeploy. Deprecated. Use L2CrossDomainMessenger
    ///         or access tx.origin (or msg.sender) in a L1 to L2 transaction instead.
    ///         Not embedded into new OP-Stack chains.
    address internal constant L1_MESSAGE_SENDER = 0x4200000000000000000000000000000000000001;

    /// @custom:legacy
    /// @notice Address of the DeployerWhitelist predeploy. No longer active.
    address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;

    /// @notice Address of the canonical WETH contract.
    address internal constant WETH = 0x4200000000000000000000000000000000000006;

    /// @notice Address of the L2CrossDomainMessenger predeploy.
    address internal constant L2_CROSS_DOMAIN_MESSENGER = 0x4200000000000000000000000000000000000007;

    /// @notice Address of the GasPriceOracle predeploy. Includes fee information
    ///         and helpers for computing the L1 portion of the transaction fee.
    address internal constant GAS_PRICE_ORACLE = 0x420000000000000000000000000000000000000F;

    /// @notice Address of the L2StandardBridge predeploy.
    address internal constant L2_STANDARD_BRIDGE = 0x4200000000000000000000000000000000000010;

    //// @notice Address of the SequencerFeeWallet predeploy.
    address internal constant SEQUENCER_FEE_WALLET = 0x4200000000000000000000000000000000000011;

    /// @notice Address of the OptimismMintableERC20Factory predeploy.
    address internal constant OPTIMISM_MINTABLE_ERC20_FACTORY = 0x4200000000000000000000000000000000000012;

    /// @custom:legacy
    /// @notice Address of the L1BlockNumber predeploy. Deprecated. Use the L1Block predeploy
    ///         instead, which exposes more information about the L1 state.
    address internal constant L1_BLOCK_NUMBER = 0x4200000000000000000000000000000000000013;

    /// @notice Address of the L2ERC721Bridge predeploy.
    address internal constant L2_ERC721_BRIDGE = 0x4200000000000000000000000000000000000014;

    /// @notice Address of the L1Block predeploy.
    address internal constant L1_BLOCK_ATTRIBUTES = 0x4200000000000000000000000000000000000015;

    /// @notice Address of the L2ToL1MessagePasser predeploy.
    address internal constant L2_TO_L1_MESSAGE_PASSER = 0x4200000000000000000000000000000000000016;

    /// @notice Address of the OptimismMintableERC721Factory predeploy.
    address internal constant OPTIMISM_MINTABLE_ERC721_FACTORY = 0x4200000000000000000000000000000000000017;

    /// @notice Address of the L2ProxyAdmin predeploy.
    address internal constant PROXY_ADMIN = 0x4200000000000000000000000000000000000018;

    /// @notice Address of the BaseFeeVault predeploy.
    address internal constant BASE_FEE_VAULT = 0x4200000000000000000000000000000000000019;

    /// @notice Address of the L1FeeVault predeploy.
    address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A;

    /// @notice Address of the OperatorFeeVault predeploy.
    address internal constant OPERATOR_FEE_VAULT = 0x420000000000000000000000000000000000001b;

    /// @notice Address of the SchemaRegistry predeploy.
    address internal constant SCHEMA_REGISTRY = 0x4200000000000000000000000000000000000020;

    /// @notice Address of the EAS predeploy.
    address internal constant EAS = 0x4200000000000000000000000000000000000021;

    /// @notice Address of the GovernanceToken predeploy.
    address internal constant GOVERNANCE_TOKEN = 0x4200000000000000000000000000000000000042;

    /// @custom:legacy
    /// @notice Address of the LegacyERC20ETH predeploy. Deprecated. Balances are migrated to the
    ///         state trie as of the Bedrock upgrade. Contract has been locked and write functions
    ///         can no longer be accessed.
    address internal constant LEGACY_ERC20_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000;

    /// @notice Address of the CrossL2Inbox predeploy.
    address internal constant CROSS_L2_INBOX = 0x4200000000000000000000000000000000000022;

    /// @notice Address of the L2ToL2CrossDomainMessenger predeploy.
    address internal constant L2_TO_L2_CROSS_DOMAIN_MESSENGER = 0x4200000000000000000000000000000000000023;

    /// @notice Address of the SuperchainETHBridge predeploy.
    address internal constant SUPERCHAIN_ETH_BRIDGE = 0x4200000000000000000000000000000000000024;

    /// @notice Address of the ETHLiquidity predeploy.
    address internal constant ETH_LIQUIDITY = 0x4200000000000000000000000000000000000025;

    /// @notice Address of the NativeAssetLiquidity predeploy.
    address internal constant NATIVE_ASSET_LIQUIDITY = 0x4200000000000000000000000000000000000029;

    /// @notice Address of the LiquidityController predeploy.
    address internal constant LIQUIDITY_CONTROLLER = 0x420000000000000000000000000000000000002a;

    /// @notice Address of the ConditionalDeployer predeploy.
    address internal constant CONDITIONAL_DEPLOYER = 0x420000000000000000000000000000000000002C;

    /// @notice Address of the L2DevFeatureFlags predeploy.
    address internal constant L2_DEV_FEATURE_FLAGS = 0x420000000000000000000000000000000000002d;

    /// @notice Address of the UndeliveredMessageExporter predeploy.
    address internal constant UNDELIVERED_MESSAGE_EXPORTER = 0x4200000000000000000000000000000000000030;

    /// @notice Address of the ChainConfig predeploy, which holds the chain's OP Private settlement
    ///         chain ID.
    address internal constant CHAIN_CONFIG = 0x4200000000000000000000000000000000000031;

    /// @notice Implementation variant selector.
    /// @dev Values are array indexes into `PredeployRecord.variants`.
    enum VariantKind {
        DEFAULT,
        CGT
    }

    /// @notice Configuration for one predeploy implementation.
    struct Variant {
        string name;
        string artifactPath;
        uint64 deployGasLimit;
    }

    /// @notice Configuration record for one predeploy proxy.
    /// @param proxy             Canonical proxy address (0x4200...).
    /// @param variants          Implementations behind this proxy, indexed by VariantKind.
    /// @param devFeatureGate    DevFeatures constant that gates this predeploy on L2 genesis.
    /// @param isCustomGasToken  True if this proxy is only deployed on custom gas token chains.
    /// @param isInterop         True if this proxy is only deployed on interop-enabled chains.
    /// @param isProxied         True if the predeploy uses a Proxy.
    /// @param isDeprecated      True if the predeploy is deprecated. Deprecated predeploys are
    ///                          present on-chain for backwards compatibility but are excluded from
    ///                          proxy setup loops, NUT bundles, and upgrade checks.
    struct PredeployRecord {
        address proxy;
        Variant[] variants;
        bytes32 devFeatureGate;
        bool isCustomGasToken;
        bool isInterop;
        bool isProxied;
        bool isDeprecated;
    }

    /// @notice Returns a DEFAULT-only variant array.
    function _variants(
        string memory _name,
        string memory _artifactPath,
        uint64 _deployGasLimit
    )
        private
        pure
        returns (Variant[] memory variants_)
    {
        variants_ = new Variant[](1);
        variants_[uint256(VariantKind.DEFAULT)] = Variant(_name, _artifactPath, _deployGasLimit);
    }

    /// @notice Returns a variant array with DEFAULT and CGT entries.
    function _variants(
        string memory _name,
        string memory _artifactPath,
        uint64 _deployGasLimit,
        string memory _cgtName,
        string memory _cgtArtifactPath,
        uint64 _cgtDeployGasLimit
    )
        private
        pure
        returns (Variant[] memory variants_)
    {
        variants_ = new Variant[](2);
        variants_[uint256(VariantKind.DEFAULT)] = Variant(_name, _artifactPath, _deployGasLimit);
        variants_[uint256(VariantKind.CGT)] = Variant(_cgtName, _cgtArtifactPath, _cgtDeployGasLimit);
    }

    /// @notice Returns the DEFAULT implementation name of a record.
    function implName(PredeployRecord memory _r) internal pure returns (string memory) {
        return _r.variants[uint256(VariantKind.DEFAULT)].name;
    }

    /// @notice Returns the implementation variant for the given gas token config.
    function resolveVariant(PredeployRecord memory _r, bool _isCustomGasToken) internal pure returns (Variant memory) {
        uint256 cgt = uint256(VariantKind.CGT);
        if (_isCustomGasToken && _r.variants.length > cgt && bytes(_r.variants[cgt].name).length != 0) {
            return _r.variants[cgt];
        }
        return _r.variants[uint256(VariantKind.DEFAULT)];
    }

    /// @notice Returns the default implementation name of the predeploy at the given address.
    function getName(address _addr) internal pure returns (string memory out_) {
        require(isPredeployNamespace(_addr), "Predeploys: address must be a predeploy");
        PredeployRecord[] memory records = getAllRecords();
        for (uint256 i = 0; i < records.length; i++) {
            if (records[i].proxy == _addr) {
                return implName(records[i]);
            }
        }
        revert("Predeploys: unnamed predeploy");
    }

    /// @notice Returns true if the predeploy is not proxied.
    function notProxied(address _addr) internal pure returns (bool) {
        PredeployRecord[] memory records = getAllRecords();
        for (uint256 i = 0; i < records.length; i++) {
            if (records[i].proxy == _addr) {
                return !records[i].isProxied;
            }
        }
        return false;
    }

    /// @notice Returns true if the address is in the predeploy namespace.
    /// @param _addr The address to check.
    /// @return True if the address is in range 0x4200...0000 to 0x4200...07FF.
    function isPredeployNamespace(address _addr) internal pure returns (bool) {
        return uint160(_addr) >> 11 == uint160(0x4200000000000000000000000000000000000000) >> 11;
    }

    /// @notice Function to compute the expected address of the predeploy implementation
    ///         in the genesis state.
    function predeployToCodeNamespace(address _addr) internal pure returns (address) {
        require(
            isPredeployNamespace(_addr), "Predeploys: can only derive code-namespace address for predeploy addresses"
        );
        return address(
            uint160((uint256(uint160(_addr)) & 0xffff) | uint256(uint160(0xc0D3C0d3C0d3C0D3c0d3C0d3c0D3C0d3c0d30000)))
        );
    }

    /// @notice Returns true if the predeploy is upgradeable. In this context, upgradeable means that the predeploy
    ///         is in the predeploy namespace and it is proxied. The non-proxied predeploys are
    ///         listed by hand instead of looked up in `getAllRecords()`, so that callers do not
    ///         compile in the whole record table. The list must match the records with
    ///         `isProxied = false`; `Predeploys_IsUpgradeable_Test` checks this.
    /// @param _proxy The address of the predeploy.
    /// @return isUpgradeable_ True if the predeploy is upgradeable, false otherwise.
    function isUpgradeable(address _proxy) internal pure returns (bool isUpgradeable_) {
        isUpgradeable_ = isPredeployNamespace(_proxy) && _proxy != WETH && _proxy != GOVERNANCE_TOKEN;
    }

    /// @notice Returns all predeploy implementation records.
    /// @dev THE SINGLE SOURCE OF TRUTH for predeploy configuration.
    ///      When adding a new predeploy, update ALL of the following:
    ///        1. Predeploys.sol (this file)
    ///           - Add an `address internal constant` for the proxy address above.
    ///           - Add a `PredeployRecord` entry here and bump the array size.
    ///        2. src/L2/L2ContractsManager.sol
    ///           - Add an `address internal immutable` declaration.
    ///           - Assign it via `findImpl()` in the constructor.
    ///           - Call `upgradeTo` or `upgradeToAndCall` for it in `_apply()`.
    ///           - Add an entry to `getImplementations()` and bump the array count.
    ///        3. scripts/L2Genesis.s.sol
    ///           - Add a `setXxx()` setter function.
    ///           - Call it from `setPredeployImplementations()`.
    ///        4. If the predeploy is not proxied, exclude it in `isUpgradeable()` above.
    ///      Non-proxied records (isProxied = false) are appended at the end and must be skipped
    ///      by consumers that operate on proxy/implementation slots (NUT bundle, setPredeployProxies).
    ///      Deprecated records (isDeprecated = true) are appended after non-proxied records and must
    ///      be skipped by consumers that perform proxy setup, NUT bundles, or upgrade checks.
    function getAllRecords() internal pure returns (PredeployRecord[] memory records_) {
        records_ = new PredeployRecord[](29);

        // ── Core predeploys
        // ────────────────────────────────────────────────────────────────
        records_[0] = PredeployRecord({
            proxy: L2_CROSS_DOMAIN_MESSENGER,
            variants: _variants(
                "L2CrossDomainMessenger", "L2CrossDomainMessenger.sol:L2CrossDomainMessenger", 3_129_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[1] = PredeployRecord({
            proxy: GAS_PRICE_ORACLE,
            variants: _variants("GasPriceOracle", "GasPriceOracle.sol:GasPriceOracle", 2_762_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[2] = PredeployRecord({
            proxy: L2_STANDARD_BRIDGE,
            variants: _variants("L2StandardBridge", "L2StandardBridge.sol:L2StandardBridge", 4_193_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[3] = PredeployRecord({
            proxy: SEQUENCER_FEE_WALLET,
            variants: _variants("SequencerFeeVault", "SequencerFeeVault.sol:SequencerFeeVault", 1_800_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[4] = PredeployRecord({
            proxy: OPTIMISM_MINTABLE_ERC20_FACTORY,
            variants: _variants(
                "OptimismMintableERC20Factory",
                "OptimismMintableERC20Factory.sol:OptimismMintableERC20Factory",
                4_193_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[5] = PredeployRecord({
            proxy: L2_ERC721_BRIDGE,
            variants: _variants("L2ERC721Bridge", "L2ERC721Bridge.sol:L2ERC721Bridge", 2_380_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[6] = PredeployRecord({
            proxy: L1_BLOCK_ATTRIBUTES,
            variants: _variants(
                "L1Block", "L1Block.sol:L1Block", 1_191_000, "L1BlockCGT", "L1BlockCGT.sol:L1BlockCGT", 1_568_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[7] = PredeployRecord({
            proxy: L2_TO_L1_MESSAGE_PASSER,
            variants: _variants(
                "L2ToL1MessagePasser",
                "L2ToL1MessagePasser.sol:L2ToL1MessagePasser",
                694_000,
                "L2ToL1MessagePasserCGT",
                "L2ToL1MessagePasserCGT.sol:L2ToL1MessagePasserCGT",
                827_394
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[8] = PredeployRecord({
            proxy: OPTIMISM_MINTABLE_ERC721_FACTORY,
            variants: _variants(
                "OptimismMintableERC721Factory",
                "OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory",
                5_661_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[9] = PredeployRecord({
            proxy: PROXY_ADMIN,
            variants: _variants("L2ProxyAdmin", "L2ProxyAdmin.sol:L2ProxyAdmin", 2_541_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[10] = PredeployRecord({
            proxy: BASE_FEE_VAULT,
            variants: _variants("BaseFeeVault", "BaseFeeVault.sol:BaseFeeVault", 1_800_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[11] = PredeployRecord({
            proxy: L1_FEE_VAULT,
            variants: _variants("L1FeeVault", "L1FeeVault.sol:L1FeeVault", 1_800_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[12] = PredeployRecord({
            proxy: OPERATOR_FEE_VAULT,
            variants: _variants("OperatorFeeVault", "OperatorFeeVault.sol:OperatorFeeVault", 1_800_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[13] = PredeployRecord({
            proxy: SCHEMA_REGISTRY,
            variants: _variants("SchemaRegistry", "SchemaRegistry.sol:SchemaRegistry", 805_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[14] = PredeployRecord({
            proxy: EAS,
            variants: _variants("EAS", "EAS.sol:EAS", 6_251_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });

        // ── Interop predeploys
        // ─────────────────────────────────────────────────────────────
        records_[15] = PredeployRecord({
            proxy: CROSS_L2_INBOX,
            variants: _variants("CrossL2Inbox", "CrossL2Inbox.sol:CrossL2Inbox", 685_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: true,
            isProxied: true,
            isDeprecated: false
        });
        records_[16] = PredeployRecord({
            proxy: L2_TO_L2_CROSS_DOMAIN_MESSENGER,
            variants: _variants(
                "L2ToL2CrossDomainMessenger", "L2ToL2CrossDomainMessenger.sol:L2ToL2CrossDomainMessenger", 2_378_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: true,
            isProxied: true,
            isDeprecated: false
        });
        records_[17] = PredeployRecord({
            proxy: SUPERCHAIN_ETH_BRIDGE,
            variants: _variants("SuperchainETHBridge", "SuperchainETHBridge.sol:SuperchainETHBridge", 1_175_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: true,
            isProxied: true,
            isDeprecated: false
        });
        records_[18] = PredeployRecord({
            proxy: ETH_LIQUIDITY,
            variants: _variants("ETHLiquidity", "ETHLiquidity.sol:ETHLiquidity", 750_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: true,
            isProxied: true,
            isDeprecated: false
        });

        records_[19] = PredeployRecord({
            proxy: UNDELIVERED_MESSAGE_EXPORTER,
            variants: _variants(
                "UndeliveredMessageExporter", "UndeliveredMessageExporter.sol:UndeliveredMessageExporter", 650_000
            ),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: true,
            isProxied: true,
            isDeprecated: false
        });

        // ── CGT predeploys
        // ─────────────────────────────────────────────────────────────────
        records_[20] = PredeployRecord({
            proxy: NATIVE_ASSET_LIQUIDITY,
            variants: _variants("NativeAssetLiquidity", "NativeAssetLiquidity.sol:NativeAssetLiquidity", 392_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: true,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[21] = PredeployRecord({
            proxy: LIQUIDITY_CONTROLLER,
            variants: _variants("LiquidityController", "LiquidityController.sol:LiquidityController", 1_870_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: true,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[22] = PredeployRecord({
            proxy: CONDITIONAL_DEPLOYER,
            variants: _variants("ConditionalDeployer", "ConditionalDeployer.sol:ConditionalDeployer", 600_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });
        records_[23] = PredeployRecord({
            proxy: L2_DEV_FEATURE_FLAGS,
            variants: _variants("L2DevFeatureFlags", "L2DevFeatureFlags.sol:L2DevFeatureFlags", 332_000),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: false
        });

        // ── Non-proxied predeploys
        // ─────────────────────────────────────────────────────────
        // These are etched directly (no Proxy wrapper, no implementation slot).
        // Excluded from NUT bundles and proxy setup. deployGasLimit is unused.
        records_[24] = PredeployRecord({
            proxy: WETH,
            variants: _variants("WETH", "WETH.sol:WETH", 0),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: false,
            isDeprecated: false
        });
        records_[25] = PredeployRecord({
            proxy: GOVERNANCE_TOKEN,
            variants: _variants("GovernanceToken", "GovernanceToken.sol:GovernanceToken", 0),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: false,
            isDeprecated: false
        });

        // ── Deprecated predeploys
        // ──────────────────────────────────────────────────────────
        // Present on-chain for backwards compatibility but excluded from proxy setup loops,
        // NUT bundles, and upgrade checks. Handled by individual setters in L2Genesis.
        records_[26] = PredeployRecord({
            proxy: LEGACY_MESSAGE_PASSER,
            variants: _variants("LegacyMessagePasser", "LegacyMessagePasser.sol:LegacyMessagePasser", 0),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: true
        });
        records_[27] = PredeployRecord({
            proxy: DEPLOYER_WHITELIST,
            variants: _variants("DeployerWhitelist", "DeployerWhitelist.sol:DeployerWhitelist", 0),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: true
        });
        records_[28] = PredeployRecord({
            proxy: L1_BLOCK_NUMBER,
            variants: _variants("L1BlockNumber", "L1BlockNumber.sol:L1BlockNumber", 0),
            devFeatureGate: bytes32(0),
            isCustomGasToken: false,
            isInterop: false,
            isProxied: true,
            isDeprecated: true
        });
    }

    /// @notice Returns all proxied, non-deprecated predeploy records (one entry per proxy).
    function getUpgradeableRecords() internal pure returns (PredeployRecord[] memory records_) {
        PredeployRecord[] memory all = getAllRecords();
        uint256 count = 0;
        for (uint256 i = 0; i < all.length; i++) {
            if (!all[i].isProxied || all[i].isDeprecated) continue;
            count++;
        }
        // Create a new array with the proxied, non-deprecated records
        records_ = new PredeployRecord[](count);
        uint256 j = 0;
        for (uint256 i = 0; i < all.length; i++) {
            if (!all[i].isProxied || all[i].isDeprecated) continue;
            records_[j++] = all[i];
        }
    }

    /// @notice Returns every implementation that must be deployed for upgradeable predeploys,
    ///         flattened across all variants (e.g. both L1Block and L1BlockCGT). L2CM selects
    ///         the correct variant at runtime, so all variants are deployed unconditionally.
    function getUpgradeableImpls() internal pure returns (Variant[] memory impls_) {
        PredeployRecord[] memory records = getUpgradeableRecords();
        uint256 count = 0;
        for (uint256 i = 0; i < records.length; i++) {
            count += records[i].variants.length;
        }
        impls_ = new Variant[](count);
        uint256 j = 0;
        for (uint256 i = 0; i < records.length; i++) {
            for (uint256 k = 0; k < records[i].variants.length; k++) {
                impls_[j++] = records[i].variants[k];
            }
        }
    }

    /// @notice Asserts that the registry record for `_proxy` has the expected gate fields.
    ///         Reverts if no matching record is found or if the gates differ.
    ///         Called by L2Genesis setters to self-verify their own registry configuration,
    ///         catching any drift between a setter's assumed gates and the registry.
    function assertGates(address _proxy, bytes32 _devGate, bool _isCustomGasToken, bool _isInterop) internal pure {
        PredeployRecord[] memory records = getAllRecords();
        for (uint256 i = 0; i < records.length; i++) {
            if (records[i].proxy == _proxy) {
                require(
                    records[i].devFeatureGate == _devGate && records[i].isCustomGasToken == _isCustomGasToken
                        && records[i].isInterop == _isInterop,
                    "Predeploys: gate mismatch"
                );
                return;
            }
        }
        revert("Predeploys: proxy not found");
    }

    function isSupportedPredeploy(
        address _addr,
        uint256 _fork,
        bool _isCustomGasToken,
        bool _useInterop,
        bytes32 _devFeatureBitmap
    )
        internal
        pure
        returns (bool)
    {
        // iterate over all records and check if the predeploy is supported based on the arguments
        PredeployRecord[] memory records = getAllRecords();
        for (uint256 i = 0; i < records.length; i++) {
            if (records[i].proxy == _addr) {
                // If the feature on the gate is not present on the bitmap, the predeploy is not supported.
                if (
                    records[i].devFeatureGate != 0
                        && !DevFeatures.isDevFeatureEnabled(_devFeatureBitmap, records[i].devFeatureGate)
                ) {
                    return false;
                }

                // If the predeploy has a system feature gate, check if it is supported based on the arguments.
                if (records[i].isCustomGasToken && !_isCustomGasToken) {
                    return false;
                }
                if (records[i].isInterop && (!_useInterop || _fork < uint256(Fork.LAGOON))) {
                    return false;
                }

                return true;
            }
        }
        return false;
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "london",
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-v5/=lib/openzeppelin-contracts-v5/contracts/",
    "@rari-capital/solmate/=lib/solmate/",
    "@lib-keccak/=lib/lib-keccak/contracts/lib/",
    "@solady/=lib/solady/src/",
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "safe-contracts/=lib/safe-contracts/contracts/",
    "kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/",
    "interfaces/=interfaces/",
    "lib/lib-keccak/:solady/=lib/lib-keccak/lib/solady/",
    "lib/lib-keccak/:solady/=lib/lib-keccak/lib/solady/",
    "@solady-test/=lib/lib-keccak/lib/solady/test/",
    "erc4626-tests/=lib/openzeppelin-contracts-v5/lib/erc4626-tests/",
    "lib-keccak/=lib/lib-keccak/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts-v5/=lib/openzeppelin-contracts-v5/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solady/=lib/solady/",
    "solmate/=lib/solmate/src/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.