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/DevFeatures.sol

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

/// @notice Library of constants representing development features. We use a 32 byte bitmap because
///         it's easier to integrate with op-deployer. Note that users should typically set a
///         single nibble to 1 and the rest to zero, which gives us 64 potential features, like:
///         0x0000000000000000000000000000000000000000000000000000000000000001
///         0x0000000000000000000000000000000000000000000000000000000000000010
///         0x0000000000000000000000000000000000000000000000000000000000000100
///         etc.
///         We'll expand to using all available bits if we need more than 64 concurrent features.
/// @dev ADDING A NEW DEV FEATURE:
///      A dev feature is wired through several files. There is no compile-time link between them.
///      Update every item below.
///
///        1. Add the new feature bit in this file. Do not reuse a retired value unless the reuse is
///           intentional and reviewed. Retired values: 0x1 (OPTIMISM_PORTAL_INTEROP), 0x10
///           (CANNON_KONA), 0x1000 (CUSTOM_GAS_TOKEN), 0x10000 (OPCM_V2), 0x100000 (L2CM) and
///           0x1000000 (ZK_DISPUTE_GAME).
///        2. Add the matching Go flag in `op-core/devfeatures/devfeatures.go`. The Go value MUST
///           match the Solidity value byte-for-byte.
///        3. Add the env var reader in `packages/contracts-bedrock/scripts/libraries/Config.sol`.
///        4. Wire the env var into the dev feature bitmap in
///           `packages/contracts-bedrock/test/setup/FeatureFlags.sol`. Add the feature name there too.
///        5. Add CI coverage in `.circleci/continue/main.yml` under the `&features_matrix` anchor.
///           Add combination rows when this feature interacts with another feature. Document
///           intentionally unsupported combinations near the matrix. Do not register dev features in
///           `setup-features.system_features.default`. List each new matrix job by name in the
///           `requires` of `required-contracts-ci`, or the job runs without gating the merge.
///
///      For the parallel SYSTEM feature checklist, see
///      packages/contracts-bedrock/src/libraries/Features.sol.
library DevFeatures {
    /// @notice The feature that enables deployment of V2 dispute game contracts.
    /// @custom:legacy
    /// This feature is no longer used, but is kept here for legacy reasons.
    bytes32 public constant DEPLOY_V2_DISPUTE_GAMES =
        bytes32(0x0000000000000000000000000000000000000000000000000000000000000100);

    /// @notice The feature that enables the super root games migration path in OPCM upgrade.
    bytes32 public constant SUPER_ROOT_GAMES_MIGRATION =
        bytes32(0x0000000000000000000000000000000000000000000000000000000010000000);

    /// @notice The feature that enables bridge hook configuration on OptimismPortal2.
    bytes32 public constant BRIDGE_HOOK = bytes32(0x0000000000000000000000000000000000000000000000000000000100000000);

    /// @notice The feature that enables OP Private.
    bytes32 public constant OP_PRIVATE = bytes32(0x0000000000000000000000000000000000000000000000000000001000000000);

    /// @notice Checks if a feature is enabled in a bitmap. Note that this function does not check
    ///         that the input feature represents a single feature and the bitwise AND operation
    ///         allows for multiple features to be enabled at once. Users should generally check
    ///         for only a single feature at a time.
    /// @param _bitmap The bitmap to check.
    /// @param _feature The feature to check.
    /// @return True if the feature is enabled, false otherwise.
    function isDevFeatureEnabled(bytes32 _bitmap, bytes32 _feature) internal pure returns (bool) {
        // SuperRootGamesMigration is enabled by default.
        // TODO(#21662): remove with the broader SuperRootGamesMigration cleanup.
        if (hasFlag(_feature, SUPER_ROOT_GAMES_MIGRATION)) return true;
        return _feature != 0 && hasFlag(_bitmap, _feature);
    }

    /// @notice Checks if all bits of _flag are set in _features.
    /// @param _features The bitmap to check against.
    /// @param _flag The flag bits to look for.
    /// @return True if all bits of _flag are set in _features, false otherwise.
    function hasFlag(bytes32 _features, bytes32 _flag) internal pure returns (bool) {
        return (_features & _flag) == _flag;
    }
}
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.