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/L1/OPContractsManagerStandardValidator.solmain51.4 KB
- interfaces/L1/IBridgeHook.sol571 B
- interfaces/L1/IETHLockbox.sol1.99 KB
- interfaces/L1/IL1CrossDomainMessenger.sol1.41 KB
- interfaces/L1/IL1ERC721Bridge.sol1.73 KB
- interfaces/L1/IL1StandardBridge.sol2.91 KB
- interfaces/L1/IOPContractsManagerStandardValidator.sol4.97 KB
- interfaces/L1/IOptimismPortal2.sol7.22 KB
- interfaces/L1/IResourceMetering.sol680 B
- interfaces/L1/ISuperchainConfig.sol1.57 KB
- interfaces/L1/ISystemConfig.sol5.89 KB
- interfaces/L1/opcm/IOPContractsManagerMigrationValidator.sol3.76 KB
- interfaces/L1/opcm/IStandardValidatorUtils.sol3.98 KB
- interfaces/cannon/IMIPS64.sol1.22 KB
- interfaces/cannon/IPreimageOracle.sol4.43 KB
- interfaces/dispute/IAnchorStateRegistry.sol3.72 KB
- interfaces/dispute/IBigStepper.sol3.46 KB
- interfaces/dispute/IDelayedWETH.sol2.66 KB
- interfaces/dispute/IDisputeGame.sol1.26 KB
- interfaces/dispute/IDisputeGameFactory.sol2.98 KB
- interfaces/dispute/IFaultDisputeGame.sol6.25 KB
- interfaces/dispute/IInitializable.sol130 B
- interfaces/dispute/IPermissionedDisputeGame.sol6.42 KB
- interfaces/legacy/IAddressManager.sol521 B
- interfaces/universal/ICrossDomainMessenger.sol2.14 KB
- interfaces/universal/IERC721Bridge.sol1.43 KB
- interfaces/universal/IOptimismMintableERC20Factory.sol1.36 KB
- interfaces/universal/IOwnable.sol686 B
- interfaces/universal/IProxyAdmin.sol1.62 KB
- interfaces/universal/IProxyAdminOwnedBase.sol620 B
- interfaces/universal/IReinitializableBase.sol323 B
- interfaces/universal/ISemver.sol519 B
- interfaces/universal/IStandardBridge.sol2.27 KB
- lib/forge-std/src/Vm.sol162.62 KB
- lib/lib-keccak/contracts/lib/LibKeccak.sol18.07 KB
- lib/solady/src/utils/LibString.sol51.93 KB
- scripts/libraries/Config.sol14.51 KB
- src/L1/opcm/StandardValidatorUtils.sol23.67 KB
- src/cannon/libraries/CannonTypes.sol3.87 KB
- src/dispute/lib/Errors.sol6.87 KB
- src/dispute/lib/LibGameArgs.sol7.22 KB
- src/dispute/lib/LibPosition.sol9.48 KB
- src/dispute/lib/LibUDT.sol9.01 KB
- src/dispute/lib/Types.sol5.95 KB
- src/libraries/BridgeHookTypes.sol2.08 KB
- src/libraries/Constants.sol5.65 KB
- src/libraries/DevFeatures.sol4.46 KB
- src/libraries/Features.sol2.59 KB
- src/libraries/Predeploys.sol30.22 KB
- src/libraries/Types.sol4.23 KB
src/L1/opcm/StandardValidatorUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
// Libraries
import { LibString } from "@solady/utils/LibString.sol";
import { GameType, Claim, GameTypes, Hash } from "src/dispute/lib/Types.sol";
import { Duration } from "src/dispute/lib/LibUDT.sol";
import { Constants } from "src/libraries/Constants.sol";
// Interfaces
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol";
import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol";
import { IMIPS64 } from "interfaces/cannon/IMIPS64.sol";
import { ISemver } from "interfaces/universal/ISemver.sol";
import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol";
import { IProxyAdminOwnedBase } from "interfaces/universal/IProxyAdminOwnedBase.sol";
import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IBigStepper } from "interfaces/dispute/IBigStepper.sol";
uint256 constant EXPECTED_MAX_GAME_DEPTH = 73;
uint256 constant EXPECTED_SPLIT_DEPTH = 30;
uint256 constant EXPECTED_CLOCK_EXTENSION = 10800;
uint256 constant EXPECTED_MAX_CLOCK_DURATION = 302400;
string constant EXPECTED_PREIMAGE_ORACLE_VERSION = "1.1.5";
uint256 constant EXPECTED_CHALLENGE_PERIOD = 86400;
uint256 constant EXPECTED_MIN_PROPOSAL_SIZE = 126000;
uint256 constant EXPECTED_MIN_PROOF_MATURITY_DELAY_SECONDS = 86400;
uint256 constant EXPECTED_MAX_PROOF_MATURITY_DELAY_SECONDS = 604800;
uint256 constant EXPECTED_MIN_DISPUTE_GAME_FINALITY_DELAY_SECONDS = 43200;
uint256 constant EXPECTED_MAX_DISPUTE_GAME_FINALITY_DELAY_SECONDS = 302400;
uint256 constant EXPECTED_MIN_WITHDRAWAL_DELAY_SECONDS = 43200;
uint256 constant EXPECTED_MAX_WITHDRAWAL_DELAY_SECONDS = 604800;
/// @notice Struct containing the unified game args for a dispute game implementation.
struct DisputeGameImplementation {
address gameAddress;
uint256 maxGameDepth;
uint256 splitDepth;
Duration maxClockDuration;
Duration clockExtension;
GameType gameType;
// extra args
uint256 l2SequenceNumber;
// dispute-game v2 game args
Claim absolutePrestate;
IBigStepper vm;
IAnchorStateRegistry asr;
IDelayedWETH weth;
uint256 l2ChainId;
address challenger;
address proposer;
}
/// @notice Arguments passed to `assertValidDisputeGame`.
struct DisputeGameValidationArgs {
string errors;
ISystemConfig sysCfg;
DisputeGameImplementation game;
bytes32 absolutePrestate;
uint256 l2ChainID;
IProxyAdmin admin;
GameType gameType;
string errorPrefix;
}
/// @notice Struct containing the simplified game args for a super permissioned dispute game implementation.
struct SuperPermissionedDisputeGameImplementation {
address gameAddress;
IAnchorStateRegistry asr;
address proposer;
}
/// @notice Arguments passed to `assertValidSuperPermissionedDisputeGame`.
struct SuperPermissionedDisputeGameValidationArgs {
string errors;
ISystemConfig sysCfg;
SuperPermissionedDisputeGameImplementation game;
IProxyAdmin admin;
address expectedProposer;
string errorPrefix;
}
/// @notice Implementation addresses used when validating a super permissioned dispute game.
struct SuperPermissionedDisputeGameImpls {
address expectedGameImpl;
address anchorStateRegistryImpl;
}
/// @notice Implementation addresses used when validating a dispute game (resolved by caller).
struct DisputeGameImpls {
address expectedGameImpl;
address mipsImpl;
address delayedWETHImpl;
address anchorStateRegistryImpl;
}
/// @notice Config values used when validating a dispute game (resolved by caller).
struct DisputeGameConfig {
address l1PAOMultisig;
}
/// @title StandardValidatorUtils
/// @notice StandardValidatorUtils is a contract that provides some validation logic
/// for the OPContractsManagerStandardValidator to split the bytecode across multiple
/// contracts to meet the EIP-170 bytecode size limit
contract StandardValidatorUtils {
/// @notice Appends `_message` to `_errors` when `_condition` is false; otherwise returns
/// `_errors` unchanged. Used to accumulate validation failures without reverting.
function internalRequire(
bool _condition,
string memory _message,
string memory _errors
)
internal
pure
returns (string memory errors_)
{
if (_condition) {
return _errors;
}
if (bytes(_errors).length == 0) {
errors_ = _message;
} else {
errors_ = string.concat(_errors, ",", _message);
}
}
/// @notice Returns the expected ETHLockbox for a chain.
function expectedETHLockbox(ISystemConfig _sysCfg) internal view returns (address) {
IOptimismPortal2 portal = IOptimismPortal2(payable(_sysCfg.optimismPortal()));
return address(portal.ethLockbox());
}
/// @notice Asserts that the SuperchainConfig contract is valid.
function assertValidSuperchainConfig(
string memory _errors,
ISuperchainConfig _superchainConfig
)
external
view
returns (string memory)
{
_errors = internalRequire(!_superchainConfig.paused(address(0)), "SPRCFG-10", _errors);
return _errors;
}
/// @notice Asserts that the ProxyAdmin contract is valid.
function assertValidProxyAdmin(
string memory _errors,
IProxyAdmin _admin,
address _l1PAOMultisig
)
external
view
returns (string memory)
{
_errors = internalRequire(_admin.owner() == _l1PAOMultisig, "PROXYA-10", _errors);
return _errors;
}
/// @notice Asserts that dispute games are correctly configured for super root mode.
function assertValidSuperRootDisputeGames(
string memory _errors,
ISystemConfig _sysCfg
)
external
view
returns (string memory)
{
IDisputeGameFactory dgf = IDisputeGameFactory(_sysCfg.disputeGameFactory());
_errors = internalRequire(address(dgf.gameImpls(GameTypes.CANNON)) == address(0), "PLDG-SHAPE", _errors);
_errors =
internalRequire(address(dgf.gameImpls(GameTypes.PERMISSIONED_CANNON)) == address(0), "PDDG-SHAPE", _errors);
_errors = internalRequire(address(dgf.gameImpls(GameTypes.CANNON_KONA)) == address(0), "CKDG-SHAPE", _errors);
_errors = internalRequire(address(dgf.gameImpls(GameTypes.SUPER_CANNON)) == address(0), "SCDG-SHAPE", _errors);
_errors =
internalRequire(address(dgf.gameImpls(GameTypes.SUPER_PERMISSIONED)) != address(0), "SPDG-SHAPE", _errors);
// At least one permissionless super game must be registered: SUPER_CANNON_KONA or
// ZK_DISPUTE_GAME.
_errors = internalRequire(
address(dgf.gameImpls(GameTypes.SUPER_CANNON_KONA)) != address(0)
|| address(dgf.gameImpls(GameTypes.ZK_DISPUTE_GAME)) != address(0),
"DF-60",
_errors
);
return _errors;
}
/// @notice Asserts that super game types are NOT registered in non-super-root mode.
function assertValidNonSuperRootDisputeGames(
string memory _errors,
ISystemConfig _sysCfg
)
external
view
returns (string memory)
{
IDisputeGameFactory dgf = IDisputeGameFactory(_sysCfg.disputeGameFactory());
_errors = internalRequire(address(dgf.gameImpls(GameTypes.CANNON)) == address(0), "PLDG-NOSHAPE", _errors);
_errors = internalRequire(address(dgf.gameImpls(GameTypes.SUPER_CANNON)) == address(0), "SCDG-NOSHAPE", _errors);
_errors = internalRequire(
address(dgf.gameImpls(GameTypes.SUPER_PERMISSIONED)) == address(0), "SPDG-NOSHAPE", _errors
);
_errors = internalRequire(
address(dgf.gameImpls(GameTypes.SUPER_CANNON_KONA)) == address(0), "SCKDG-NOSHAPE", _errors
);
_errors =
internalRequire(address(dgf.gameImpls(GameTypes.ZK_DISPUTE_GAME)) == address(0), "ZKDG-NOSHAPE", _errors);
_errors = internalRequire(
address(dgf.gameImpls(GameTypes.PERMISSIONED_CANNON)) != address(0), "PDDG-NOSHAPE", _errors
);
_errors = internalRequire(address(dgf.gameImpls(GameTypes.CANNON_KONA)) != address(0), "CKDG-NOSHAPE", _errors);
return _errors;
}
/// @notice Asserts that the MipsVm contract is valid.
function assertValidMipsVm(
string memory _errors,
IMIPS64 _mips,
address _mipsImpl,
string memory _errorPrefix
)
public
view
returns (string memory)
{
_errorPrefix = string.concat(_errorPrefix, "-VM");
_errors = internalRequire(address(_mips) == _mipsImpl, string.concat(_errorPrefix, "-10"), _errors);
_errors = internalRequire(
LibString.eq(ISemver(address(_mips)).version(), ISemver(_mipsImpl).version()),
string.concat(_errorPrefix, "-20"),
_errors
);
_errors = internalRequire(_mips.stateVersion() == 8, string.concat(_errorPrefix, "-30"), _errors);
return _errors;
}
/// @notice Asserts that the OptimismMintableERC20Factory contract is valid.
function assertValidOptimismMintableERC20Factory(
string memory _errors,
ISystemConfig _sysCfg,
IProxyAdmin _admin,
address _impl
)
external
view
returns (string memory)
{
IOptimismMintableERC20Factory _factory = IOptimismMintableERC20Factory(_sysCfg.optimismMintableERC20Factory());
_errors = internalRequire(
LibString.eq(ISemver(address(_factory)).version(), ISemver(_impl).version()), "MERC20F-10", _errors
);
_errors = internalRequire(_admin.getProxyImplementation(address(_factory)) == _impl, "MERC20F-20", _errors);
IL1StandardBridge _bridge = IL1StandardBridge(payable(_sysCfg.l1StandardBridge()));
_errors = internalRequire(_factory.BRIDGE() == address(_bridge), "MERC20F-30", _errors);
_errors = internalRequire(_factory.bridge() == address(_bridge), "MERC20F-40", _errors);
return _errors;
}
/// @notice Asserts that the DisputeGameFactory contract is valid.
function assertValidDisputeGameFactory(
string memory _errors,
ISystemConfig _sysCfg,
IProxyAdmin _admin,
address _impl,
address _l1PAOMultisig
)
external
view
returns (string memory)
{
IDisputeGameFactory _factory = IDisputeGameFactory(_sysCfg.disputeGameFactory());
_errors = internalRequire(
LibString.eq(ISemver(address(_factory)).version(), ISemver(_impl).version()), "DF-10", _errors
);
_errors = internalRequire(_admin.getProxyImplementation(address(_factory)) == _impl, "DF-20", _errors);
_errors = internalRequire(_factory.owner() == _l1PAOMultisig, "DF-30", _errors);
_errors = internalRequire(IProxyAdminOwnedBase(address(_factory)).proxyAdmin() == _admin, "DF-40", _errors);
// At least one permissioned game must be registered — either the legacy
// PERMISSIONED_CANNON or the super-root SUPER_PERMISSIONED.
_errors = internalRequire(
address(_factory.gameImpls(GameTypes.PERMISSIONED_CANNON)) != address(0)
|| address(_factory.gameImpls(GameTypes.SUPER_PERMISSIONED)) != address(0),
"DF-50",
_errors
);
return _errors;
}
/// @notice Asserts that the OptimismPortal contract is valid.
function assertValidOptimismPortal(
string memory _errors,
ISystemConfig _sysCfg,
IProxyAdmin _admin,
address _impl
)
external
view
returns (string memory)
{
IOptimismPortal2 _portal = IOptimismPortal2(payable(_sysCfg.optimismPortal()));
_errors = internalRequire(
LibString.eq(ISemver(address(_portal)).version(), ISemver(_impl).version()), "PORTAL-10", _errors
);
_errors = internalRequire(_admin.getProxyImplementation(address(_portal)) == _impl, "PORTAL-20", _errors);
_errors = internalRequire(address(_portal.systemConfig()) == address(_sysCfg), "PORTAL-40", _errors);
_errors = internalRequire(_portal.l2Sender() == Constants.DEFAULT_L2_SENDER, "PORTAL-80", _errors);
_errors = internalRequire(IProxyAdminOwnedBase(address(_portal)).proxyAdmin() == _admin, "PORTAL-90", _errors);
// The proof maturity delay is per chain and "standard" means within the configured bounds.
uint256 proofMaturityDelay = _portal.proofMaturityDelaySeconds();
_errors = internalRequire(
proofMaturityDelay >= EXPECTED_MIN_PROOF_MATURITY_DELAY_SECONDS
&& proofMaturityDelay <= EXPECTED_MAX_PROOF_MATURITY_DELAY_SECONDS,
"PORTAL-100",
_errors
);
// TODO(optimism-private#744): assert the portal's bridge hook once OPCM configures hooks.
return _errors;
}
/// @notice Asserts that the PreimageOracle contract is valid.
function assertValidPreimageOracle(
string memory _errors,
IPreimageOracle _oracle,
string memory _errorPrefix
)
public
view
returns (string memory)
{
_errorPrefix = string.concat(_errorPrefix, "-PIMGO");
_errors = internalRequire(
LibString.eq(ISemver(address(_oracle)).version(), EXPECTED_PREIMAGE_ORACLE_VERSION),
string.concat(_errorPrefix, "-10"),
_errors
);
_errors = internalRequire(
_oracle.challengePeriod() == EXPECTED_CHALLENGE_PERIOD, string.concat(_errorPrefix, "-20"), _errors
);
_errors = internalRequire(
_oracle.minProposalSize() == EXPECTED_MIN_PROPOSAL_SIZE, string.concat(_errorPrefix, "-30"), _errors
);
return _errors;
}
/// @notice Asserts that the DelayedWETH contract is valid.
function assertValidDelayedWETH(
string memory _errors,
ISystemConfig _sysCfg,
IDelayedWETH _weth,
IProxyAdmin _admin,
address _l1PAOMultisig,
address _delayedWETHImpl,
string memory _errorPrefix
)
public
view
returns (string memory)
{
_errorPrefix = string.concat(_errorPrefix, "-DWETH");
_errors = internalRequire(
LibString.eq(ISemver(address(_weth)).version(), ISemver(_delayedWETHImpl).version()),
string.concat(_errorPrefix, "-10"),
_errors
);
_errors = internalRequire(
_admin.getProxyImplementation(address(_weth)) == _delayedWETHImpl,
string.concat(_errorPrefix, "-20"),
_errors
);
_errors =
internalRequire(_weth.proxyAdminOwner() == _l1PAOMultisig, string.concat(_errorPrefix, "-30"), _errors);
// The withdrawal delay is per chain; "standard" means within the sanctioned range.
uint256 withdrawalDelay = _weth.delay();
_errors = internalRequire(
withdrawalDelay >= EXPECTED_MIN_WITHDRAWAL_DELAY_SECONDS
&& withdrawalDelay <= EXPECTED_MAX_WITHDRAWAL_DELAY_SECONDS,
string.concat(_errorPrefix, "-40"),
_errors
);
_errors = internalRequire(
address(_weth.ethLockbox()) == expectedETHLockbox(_sysCfg), string.concat(_errorPrefix, "-50"), _errors
);
_errors = internalRequire(
IProxyAdminOwnedBase(address(_weth)).proxyAdmin() == _admin, string.concat(_errorPrefix, "-60"), _errors
);
_errors = internalRequire(address(_weth) == _sysCfg.delayedWETH(), string.concat(_errorPrefix, "-70"), _errors);
return _errors;
}
/// @notice Asserts that the AnchorStateRegistry contract is valid.
function assertValidAnchorStateRegistry(
string memory _errors,
ISystemConfig _sysCfg,
IDisputeGameFactory _dgf,
IAnchorStateRegistry _asr,
IProxyAdmin _admin,
address _anchorStateRegistryImpl,
string memory _errorPrefix
)
public
view
returns (string memory)
{
_errorPrefix = string.concat(_errorPrefix, "-ANCHORP");
_errors = internalRequire(
LibString.eq(ISemver(address(_asr)).version(), ISemver(_anchorStateRegistryImpl).version()),
string.concat(_errorPrefix, "-10"),
_errors
);
_errors = internalRequire(
_admin.getProxyImplementation(address(_asr)) == _anchorStateRegistryImpl,
string.concat(_errorPrefix, "-20"),
_errors
);
_errors = internalRequire(
address(_asr.disputeGameFactory()) == address(_dgf), string.concat(_errorPrefix, "-30"), _errors
);
_errors = internalRequire(
address(_asr.ethLockbox()) == expectedETHLockbox(_sysCfg), string.concat(_errorPrefix, "-40"), _errors
);
_errors = internalRequire(
IProxyAdminOwnedBase(address(_asr)).proxyAdmin() == _admin, string.concat(_errorPrefix, "-50"), _errors
);
_errors = internalRequire(_asr.retirementTimestamp() > 0, string.concat(_errorPrefix, "-60"), _errors);
// The registry a game anchors against must be the one the portal consults when finalizing
// withdrawals. Without this, a game could snapshot the respected game type of a second,
// locally valid registry that the portal never reads.
_errors = internalRequire(
IOptimismPortal2(payable(_sysCfg.optimismPortal())).anchorStateRegistry() == _asr,
string.concat(_errorPrefix, "-70"),
_errors
);
// The finality delay is per chain and "standard" means within the configured bounds.
uint256 finalityDelay = _asr.disputeGameFinalityDelaySeconds();
_errors = internalRequire(
finalityDelay >= EXPECTED_MIN_DISPUTE_GAME_FINALITY_DELAY_SECONDS
&& finalityDelay <= EXPECTED_MAX_DISPUTE_GAME_FINALITY_DELAY_SECONDS,
string.concat(_errorPrefix, "-80"),
_errors
);
return _errors;
}
/// @notice Asserts that a DisputeGame contract is valid. Drills into WETH, ASR, MIPS, and
/// PreimageOracle validation. Caller resolves storage-dependent values via the
/// `DisputeGameImpls` and `DisputeGameConfig` structs.
function assertValidDisputeGame(
DisputeGameValidationArgs memory _args,
DisputeGameImpls memory _impls,
DisputeGameConfig memory _cfg
)
public
view
returns (string memory errors_)
{
errors_ = _args.errors;
string memory errorPrefix = _args.errorPrefix;
DisputeGameImplementation memory game = _args.game;
(Hash anchorRoot,) = game.asr.getAnchorRoot();
IDisputeGameFactory dgf = IDisputeGameFactory(_args.sysCfg.disputeGameFactory());
errors_ = internalRequire(
LibString.eq(ISemver(game.gameAddress).version(), ISemver(_impls.expectedGameImpl).version()),
string.concat(errorPrefix, "-20"),
errors_
);
errors_ =
internalRequire(game.gameAddress == _impls.expectedGameImpl, string.concat(errorPrefix, "-150"), errors_);
errors_ = internalRequire(
GameType.unwrap(game.gameType) == GameType.unwrap(_args.gameType),
string.concat(errorPrefix, "-30"),
errors_
);
errors_ = internalRequire(
Claim.unwrap(game.absolutePrestate) == _args.absolutePrestate, string.concat(errorPrefix, "-40"), errors_
);
// Super game types store l2ChainId=0 in game args because the chain ID is embedded
// in the super root proof extraData, not in the game args.
uint256 expectedL2ChainId = GameTypes.isSuperGame(_args.gameType) ? 0 : _args.l2ChainID;
errors_ = internalRequire(game.l2ChainId == expectedL2ChainId, string.concat(errorPrefix, "-60"), errors_);
errors_ = internalRequire(game.l2SequenceNumber == 0, string.concat(errorPrefix, "-70"), errors_);
errors_ = internalRequire(
Duration.unwrap(game.clockExtension) == EXPECTED_CLOCK_EXTENSION, string.concat(errorPrefix, "-80"), errors_
);
errors_ = internalRequire(game.splitDepth == EXPECTED_SPLIT_DEPTH, string.concat(errorPrefix, "-90"), errors_);
errors_ =
internalRequire(game.maxGameDepth == EXPECTED_MAX_GAME_DEPTH, string.concat(errorPrefix, "-100"), errors_);
errors_ = internalRequire(
Duration.unwrap(game.maxClockDuration) == EXPECTED_MAX_CLOCK_DURATION,
string.concat(errorPrefix, "-110"),
errors_
);
errors_ = internalRequire(Hash.unwrap(anchorRoot) != bytes32(0), string.concat(errorPrefix, "-120"), errors_);
errors_ = assertValidDelayedWETH(
errors_, _args.sysCfg, game.weth, _args.admin, _cfg.l1PAOMultisig, _impls.delayedWETHImpl, errorPrefix
);
errors_ = assertValidAnchorStateRegistry(
errors_, _args.sysCfg, dgf, game.asr, _args.admin, _impls.anchorStateRegistryImpl, errorPrefix
);
errors_ = assertValidMipsVm(errors_, IMIPS64(address(game.vm)), _impls.mipsImpl, errorPrefix);
// Only assert valid preimage oracle if the game VM is valid, since otherwise
// the contract is likely to revert.
if (address(game.vm) == _impls.mipsImpl) {
errors_ = assertValidPreimageOracle(errors_, game.vm.oracle(), errorPrefix);
}
return errors_;
}
/// @notice Asserts that a simplified SuperPermissionedDisputeGame contract is valid.
function assertValidSuperPermissionedDisputeGame(
SuperPermissionedDisputeGameValidationArgs memory _args,
SuperPermissionedDisputeGameImpls memory _impls
)
public
view
returns (string memory errors_)
{
errors_ = _args.errors;
string memory errorPrefix = _args.errorPrefix;
SuperPermissionedDisputeGameImplementation memory game = _args.game;
(Hash anchorRoot,) = game.asr.getAnchorRoot();
IDisputeGameFactory dgf = IDisputeGameFactory(_args.sysCfg.disputeGameFactory());
errors_ = internalRequire(
LibString.eq(ISemver(game.gameAddress).version(), ISemver(_impls.expectedGameImpl).version()),
string.concat(errorPrefix, "-20"),
errors_
);
errors_ =
internalRequire(game.gameAddress == _impls.expectedGameImpl, string.concat(errorPrefix, "-150"), errors_);
errors_ = internalRequire(Hash.unwrap(anchorRoot) != bytes32(0), string.concat(errorPrefix, "-120"), errors_);
errors_ = assertValidAnchorStateRegistry(
errors_, _args.sysCfg, dgf, game.asr, _args.admin, _impls.anchorStateRegistryImpl, errorPrefix
);
errors_ = internalRequire(game.proposer == _args.expectedProposer, string.concat(errorPrefix, "-140"), errors_);
return errors_;
}
}
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.