Commit 9fe09cb7 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: migrate dispute package to ISemver

On the path to removing `Semver` and moving to `ISemver`.
parent 7b2d0359
This diff is collapsed.
This diff is collapsed.
...@@ -3,10 +3,10 @@ pragma solidity ^0.8.15; ...@@ -3,10 +3,10 @@ pragma solidity ^0.8.15;
import { ClonesWithImmutableArgs } from "@cwia/ClonesWithImmutableArgs.sol"; import { ClonesWithImmutableArgs } from "@cwia/ClonesWithImmutableArgs.sol";
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { Semver } from "src/universal/Semver.sol"; import { ISemver } from "src/universal/ISemver.sol";
import { IDisputeGame } from "./interfaces/IDisputeGame.sol"; import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { IDisputeGameFactory } from "./interfaces/IDisputeGameFactory.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
import { LibGameId } from "src/dispute/lib/LibGameId.sol"; import { LibGameId } from "src/dispute/lib/LibGameId.sol";
...@@ -19,7 +19,7 @@ import "src/libraries/DisputeErrors.sol"; ...@@ -19,7 +19,7 @@ import "src/libraries/DisputeErrors.sol";
/// time of the dispute game is packed tightly into the storage slot with the address of /// time of the dispute game is packed tightly into the storage slot with the address of
/// the dispute game. This is to make offchain discoverability of playable dispute games /// the dispute game. This is to make offchain discoverability of playable dispute games
/// easier. /// easier.
contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver {
/// @dev Allows for the creation of clone proxies with immutable arguments. /// @dev Allows for the creation of clone proxies with immutable arguments.
using ClonesWithImmutableArgs for address; using ClonesWithImmutableArgs for address;
...@@ -36,8 +36,12 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -36,8 +36,12 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
/// track dispute games /// track dispute games
GameId[] internal _disputeGameList; GameId[] internal _disputeGameList;
/// @notice Semantic version.
/// @custom:semver 0.0.6
string public constant version = "0.0.6";
/// @notice constructs a new DisputeGameFactory contract. /// @notice constructs a new DisputeGameFactory contract.
constructor() OwnableUpgradeable() Semver(0, 0, 5) { constructor() OwnableUpgradeable() {
initialize(address(0)); initialize(address(0));
} }
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.8.15; pragma solidity ^0.8.15;
import { IDisputeGame } from "./interfaces/IDisputeGame.sol"; import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { IFaultDisputeGame } from "./interfaces/IFaultDisputeGame.sol"; import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";
import { IInitializable } from "./interfaces/IInitializable.sol"; import { IInitializable } from "src/dispute/interfaces/IInitializable.sol";
import { IBondManager } from "./interfaces/IBondManager.sol"; import { IBondManager } from "src/dispute/interfaces/IBondManager.sol";
import { IBigStepper, IPreimageOracle } from "./interfaces/IBigStepper.sol"; import { IBigStepper, IPreimageOracle } from "src/dispute/interfaces/IBigStepper.sol";
import { L2OutputOracle } from "src/L1/L2OutputOracle.sol"; import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
import { BlockOracle } from "./BlockOracle.sol"; import { BlockOracle } from "src/dispute/BlockOracle.sol";
import { Clone } from "src/libraries/Clone.sol"; import { Clone } from "src/libraries/Clone.sol";
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { Semver } from "src/universal/Semver.sol"; import { ISemver } from "src/universal/ISemver.sol";
import { LibHashing } from "./lib/LibHashing.sol"; import { LibHashing } from "src/dispute/lib/LibHashing.sol";
import { LibPosition } from "./lib/LibPosition.sol"; import { LibPosition } from "src/dispute/lib/LibPosition.sol";
import { LibClock } from "./lib/LibClock.sol"; import { LibClock } from "src/dispute/lib/LibClock.sol";
import "src/libraries/DisputeTypes.sol"; import "src/libraries/DisputeTypes.sol";
import "src/libraries/DisputeErrors.sol"; import "src/libraries/DisputeErrors.sol";
/// @title FaultDisputeGame /// @title FaultDisputeGame
/// @notice An implementation of the `IFaultDisputeGame` interface. /// @notice An implementation of the `IFaultDisputeGame` interface.
contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// State Vars // // State Vars //
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
...@@ -81,6 +81,10 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -81,6 +81,10 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @notice Indicates whether the subgame rooted at the root claim has been resolved. /// @notice Indicates whether the subgame rooted at the root claim has been resolved.
bool internal subgameAtRootResolved; bool internal subgameAtRootResolved;
/// @notice Semantic version.
/// @custom:semver 0.0.10
string public constant version = "0.0.10";
/// @param _gameType The type ID of the game. /// @param _gameType The type ID of the game.
/// @param _absolutePrestate The absolute prestate of the instruction trace. /// @param _absolutePrestate The absolute prestate of the instruction trace.
/// @param _maxGameDepth The maximum depth of bisection. /// @param _maxGameDepth The maximum depth of bisection.
...@@ -91,7 +95,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -91,7 +95,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @param _blockOracle The block oracle, used for loading block hashes further back /// @param _blockOracle The block oracle, used for loading block hashes further back
/// than the `BLOCKHASH` opcode allows as well as their estimated /// than the `BLOCKHASH` opcode allows as well as their estimated
/// timestamps. /// timestamps.
/// @custom:semver 0.0.9
constructor( constructor(
GameType _gameType, GameType _gameType,
Claim _absolutePrestate, Claim _absolutePrestate,
...@@ -100,9 +103,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -100,9 +103,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
IBigStepper _vm, IBigStepper _vm,
L2OutputOracle _l2oo, L2OutputOracle _l2oo,
BlockOracle _blockOracle BlockOracle _blockOracle
) ) {
Semver(0, 0, 9)
{
GAME_TYPE = _gameType; GAME_TYPE = _gameType;
ABSOLUTE_PRESTATE = _absolutePrestate; ABSOLUTE_PRESTATE = _absolutePrestate;
MAX_GAME_DEPTH = _maxGameDepth; MAX_GAME_DEPTH = _maxGameDepth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment