github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/src/libraries/DisputeErrors.sol (about)

     1  // SPDX-License-Identifier: MIT
     2  pragma solidity ^0.8.15;
     3  
     4  import "src/libraries/DisputeTypes.sol";
     5  
     6  ////////////////////////////////////////////////////////////////
     7  //                `DisputeGameFactory` Errors                 //
     8  ////////////////////////////////////////////////////////////////
     9  
    10  /// @notice Thrown when a dispute game is attempted to be created with an unsupported game type.
    11  /// @param gameType The unsupported game type.
    12  error NoImplementation(GameType gameType);
    13  
    14  /// @notice Thrown when a dispute game that already exists is attempted to be created.
    15  /// @param uuid The UUID of the dispute game that already exists.
    16  error GameAlreadyExists(Hash uuid);
    17  
    18  /// @notice Thrown when the root claim has an unexpected VM status.
    19  ///         Some games can only start with a root-claim with a specific status.
    20  /// @param rootClaim is the claim that was unexpected.
    21  error UnexpectedRootClaim(Claim rootClaim);
    22  
    23  ////////////////////////////////////////////////////////////////
    24  //                 `FaultDisputeGame` Errors                  //
    25  ////////////////////////////////////////////////////////////////
    26  
    27  /// @notice Thrown when a dispute game has already been initialized.
    28  error AlreadyInitialized();
    29  
    30  /// @notice Thrown when a supplied bond is too low to cover the cost of the interaction.
    31  error InsufficientBond();
    32  
    33  /// @notice Thrown when a credit claim is attempted for a value of 0.
    34  error NoCreditToClaim();
    35  
    36  /// @notice Thrown when the transfer of credit to a recipient account reverts.
    37  error BondTransferFailed();
    38  
    39  /// @notice Thrown when the `extraData` passed to the CWIA proxy is too long for the `FaultDisputeGame`.
    40  error ExtraDataTooLong();
    41  
    42  /// @notice Thrown when a defense against the root claim is attempted.
    43  error CannotDefendRootClaim();
    44  
    45  /// @notice Thrown when a claim is attempting to be made that already exists.
    46  error ClaimAlreadyExists();
    47  
    48  /// @notice Thrown when a given claim is invalid (0).
    49  error InvalidClaim();
    50  
    51  /// @notice Thrown when an action that requires the game to be `IN_PROGRESS` is invoked when
    52  ///         the game is not in progress.
    53  error GameNotInProgress();
    54  
    55  /// @notice Thrown when a move is attempted to be made after the clock has timed out.
    56  error ClockTimeExceeded();
    57  
    58  /// @notice Thrown when the game is attempted to be resolved too early.
    59  error ClockNotExpired();
    60  
    61  /// @notice Thrown when a move is attempted to be made at or greater than the max depth of the game.
    62  error GameDepthExceeded();
    63  
    64  /// @notice Thrown when a step is attempted above the maximum game depth.
    65  error InvalidParent();
    66  
    67  /// @notice Thrown when an invalid prestate is supplied to `step`.
    68  error InvalidPrestate();
    69  
    70  /// @notice Thrown when a step is made that computes the expected post state correctly.
    71  error ValidStep();
    72  
    73  /// @notice Thrown when a game is attempted to be initialized with an L1 head that does
    74  ///         not contain the disputed output root.
    75  error L1HeadTooOld();
    76  
    77  /// @notice Thrown when an invalid local identifier is passed to the `addLocalData` function.
    78  error InvalidLocalIdent();
    79  
    80  /// @notice Thrown when resolving claims out of order.
    81  error OutOfOrderResolution();
    82  
    83  /// @notice Thrown when resolving a claim that has already been resolved.
    84  error ClaimAlreadyResolved();
    85  
    86  /// @notice Thrown when a parent output root is attempted to be found on a claim that is in
    87  ///         the output root portion of the tree.
    88  error ClaimAboveSplit();
    89  
    90  /// @notice Thrown on deployment if the split depth is greater than or equal to the max
    91  ///         depth of the game.
    92  error InvalidSplitDepth();
    93  
    94  /// @notice Thrown when trying to step against a claim for a second time, after it has already been countered with
    95  ///         an instruction step.
    96  error DuplicateStep();
    97  
    98  /// @notice Thrown when an anchor root is not found for a given game type.
    99  error AnchorRootNotFound();
   100  
   101  ////////////////////////////////////////////////////////////////
   102  //              `PermissionedDisputeGame` Errors              //
   103  ////////////////////////////////////////////////////////////////
   104  
   105  /// @notice Thrown when an unauthorized address attempts to interact with the game.
   106  error BadAuth();