github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/src/dispute/interfaces/IDisputeGame.sol (about) 1 // SPDX-License-Identifier: MIT 2 pragma solidity ^0.8.0; 3 4 import { IInitializable } from "src/dispute/interfaces/IInitializable.sol"; 5 6 import "src/libraries/DisputeTypes.sol"; 7 8 /// @title IDisputeGame 9 /// @notice The generic interface for a DisputeGame contract. 10 interface IDisputeGame is IInitializable { 11 /// @notice Emitted when the game is resolved. 12 /// @param status The status of the game after resolution. 13 event Resolved(GameStatus indexed status); 14 15 /// @notice Returns the timestamp that the DisputeGame contract was created at. 16 /// @return createdAt_ The timestamp that the DisputeGame contract was created at. 17 function createdAt() external view returns (Timestamp createdAt_); 18 19 /// @notice Returns the timestamp that the DisputeGame contract was resolved at. 20 /// @return resolvedAt_ The timestamp that the DisputeGame contract was resolved at. 21 function resolvedAt() external view returns (Timestamp resolvedAt_); 22 23 /// @notice Returns the current status of the game. 24 /// @return status_ The current status of the game. 25 function status() external view returns (GameStatus status_); 26 27 /// @notice Getter for the game type. 28 /// @dev The reference impl should be entirely different depending on the type (fault, validity) 29 /// i.e. The game type should indicate the security model. 30 /// @return gameType_ The type of proof system being used. 31 function gameType() external view returns (GameType gameType_); 32 33 /// @notice Getter for the root claim. 34 /// @dev `clones-with-immutable-args` argument #1 35 /// @return rootClaim_ The root claim of the DisputeGame. 36 function rootClaim() external pure returns (Claim rootClaim_); 37 38 /// @notice Getter for the extra data. 39 /// @dev `clones-with-immutable-args` argument #2 40 /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. 41 function extraData() external pure returns (bytes memory extraData_); 42 43 /// @notice If all necessary information has been gathered, this function should mark the game 44 /// status as either `CHALLENGER_WINS` or `DEFENDER_WINS` and return the status of 45 /// the resolved game. It is at this stage that the bonds should be awarded to the 46 /// necessary parties. 47 /// @dev May only be called if the `status` is `IN_PROGRESS`. 48 /// @return status_ The status of the game after resolution. 49 function resolve() external returns (GameStatus status_); 50 51 /// @notice A compliant implementation of this interface should return the components of the 52 /// game UUID's preimage provided in the cwia payload. The preimage of the UUID is 53 /// constructed as `keccak256(gameType . rootClaim . extraData)` where `.` denotes 54 /// concatenation. 55 /// @return gameType_ The type of proof system being used. 56 /// @return rootClaim_ The root claim of the DisputeGame. 57 /// @return extraData_ Any extra data supplied to the dispute game contract by the creator. 58 function gameData() external view returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_); 59 }