Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { Config } from "scripts/Config.sol";
import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol";
import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol";
import { AlphabetVM } from "test/mocks/AlphabetVM.sol";
import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";
import { ChainAssertions } from "scripts/ChainAssertions.sol";
import { Types } from "scripts/Types.sol";
import { LibStateDiff } from "scripts/libraries/LibStateDiff.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";

import "src/libraries/DisputeTypes.sol";
import "src/libraries/DisputeErrors.sol";
import { LibPosition } from "src/dispute/lib/LibPosition.sol";
import "src/dispute/lib/Types.sol";
import "src/dispute/lib/Errors.sol";

/**
* @title FaultDisputeGameViz
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/fpac/FPACOPS.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { AnchorStateRegistry, IAnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol";
import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol";
import { StdAssertions } from "forge-std/StdAssertions.sol";
import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";
import "scripts/Deploy.s.sol";

/// @notice Deploys the Fault Proof Alpha Chad contracts.
Expand Down
18 changes: 9 additions & 9 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"src/L1/OptimismPortal2.sol": {
"initCodeHash": "0xea32d79e8297956d4f9a4c7985bb53ff8bb3735e5b307d4e118fea71f503a38e",
"sourceCodeHash": "0x2b662e100d1e282588eaaf3704aca0d0a6900ec3b8f8134e2d5d577ee372e42f"
"sourceCodeHash": "0x209d7e9ffa97a54c060f5d30e5d88684a50a7b4610336cf03880bfbc80ca669e"
},
"src/L1/ProtocolVersions.sol": {
"initCodeHash": "0x72cd467e8bcf019c02675d72ab762e088bcc9cc0f1a4e9f587fa4589f7fdd1b8",
Expand Down Expand Up @@ -96,8 +96,8 @@
"sourceCodeHash": "0xa304b4b556162323d69662b4dd9a1d073d55ec661494465489bb67f1e465e7b3"
},
"src/Safe/DeputyGuardianModule.sol": {
"initCodeHash": "0x8f6adc162587ac7150045c0cf4671f23e0453417a4b7006e39eb8cb58052dc58",
"sourceCodeHash": "0x8ebf09555561d475ec51c681033b8c567281f40f310ad47312b00710f6394d34"
"initCodeHash": "0x533a9dfab7fa1f7f5e8796f0ad78b4a16f93cd8ff3cddcce946691944f6416c0",
"sourceCodeHash": "0x82c7ea737cefeb2fda38a75c7165cbad9c902a0f22a13dd46f56050223e308ce"
},
"src/Safe/LivenessGuard.sol": {
"initCodeHash": "0x16ec47f0888391638814047a1735dbac849b48e256b2e20182bbb3186d950a3c",
Expand All @@ -116,16 +116,16 @@
"sourceCodeHash": "0x292a950cfe01923558ead684f2e014b00bc17bc07362dbd58f45b1cc121942a9"
},
"src/dispute/AnchorStateRegistry.sol": {
"initCodeHash": "0x2f8c56069e43e306b0e40fba43109188b29328e83569560021a68aa5d9f2486b",
"sourceCodeHash": "0xba941ad1f941f5a4a066182d50634fa9b190085ed82779decef71c019ba963c5"
"initCodeHash": "0x1d01bc6ff31eec22200919d7c78e1e17c13482d290386e950a3767002816164e",
"sourceCodeHash": "0x99fece0b7b5952bca60a998a8c47bfd3696e5268271d321011feea1bfb9df24d"
},
"src/dispute/DisputeGameFactory.sol": {
"initCodeHash": "0x3d65d1afd2ba6cd7ebb194859390579fd5dd95c1e18ca9a74f00d95a3a4de4fa",
"sourceCodeHash": "0xc4dbd17217b63f8117f56f78c213e57dda304fee7577fe296e1d804ebe049542"
"initCodeHash": "0xfcb7178f7ed9e9ecb095d7e5252e4353d8f964d908de6914eb61a67ce69f2a63",
"sourceCodeHash": "0x3865908f3101bbb866cb103a4f23a35e54da863b0ff11b0aa56fe5ab72786601"
},
"src/dispute/FaultDisputeGame.sol": {
"initCodeHash": "0x44407585a3dcf50d7e0d0f6c3d752fe5b18bb6837a9db138a2e0961757eb91c7",
"sourceCodeHash": "0x4f930a9e4577404887c03fd91ddfcbf9915bddcfb52e4ff8d7a00099c6ad0f29"
"initCodeHash": "0x1a645e296fa5a9a707726d9b79f5b87a9337198351c9c966e785389c1ddc745b",
"sourceCodeHash": "0xfc9256651556ac2a59b82e48b22e89c46e9a67327a84c308c9745d96ef410d1d"
},
"src/dispute/weth/DelayedWETH.sol": {
"initCodeHash": "0x7b6ec89eaec09e369426e73161a9c6932223bb1f974377190c3f6f552995da35",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
{
"inputs": [
{
"internalType": "ClaimHash",
"internalType": "Hash",
"name": "",
"type": "bytes32"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
{
"inputs": [
{
"internalType": "ClaimHash",
"internalType": "Hash",
"name": "",
"type": "bytes32"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"label": "claims",
"offset": 0,
"slot": "3",
"type": "mapping(ClaimHash => bool)"
"type": "mapping(Hash => bool)"
},
{
"bytes": "32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"label": "claims",
"offset": 0,
"slot": "3",
"type": "mapping(ClaimHash => bool)"
"type": "mapping(Hash => bool)"
},
{
"bytes": "32",
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/src/L1/OptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ISemver } from "src/universal/ISemver.sol";
import { Constants } from "src/libraries/Constants.sol";

import "src/libraries/PortalErrors.sol";
import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @custom:proxied
/// @title OptimismPortal2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { ISemver } from "src/universal/ISemver.sol";
import { Unauthorized } from "src/libraries/PortalErrors.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title DeputyGuardianModule
/// @notice This module is intended to be enabled on the Security Council Safe, which will own the Guardian role in the
Expand Down Expand Up @@ -43,8 +43,8 @@ contract DeputyGuardianModule is ISemver {
address internal immutable DEPUTY_GUARDIAN;

/// @notice Semantic version.
/// @custom:semver 1.0.0
string public constant version = "1.0.0";
/// @custom:semver 1.0.1
string public constant version = "1.0.1";

// Constructor to initialize the Safe and baseModule instances
constructor(Safe _safe, SuperchainConfig _superchainConfig, address _deputyGuardian) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol"
import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title AnchorStateRegistry
/// @notice The AnchorStateRegistry is a contract that stores the latest "anchor" state for each available
Expand All @@ -24,8 +24,8 @@ contract AnchorStateRegistry is Initializable, IAnchorStateRegistry, ISemver {
}

/// @notice Semantic version.
/// @custom:semver 0.1.0
string public constant version = "0.1.0";
/// @custom:semver 0.1.1
string public constant version = "0.1.1";

/// @notice DisputeGameFactory address.
IDisputeGameFactory internal immutable DISPUTE_GAME_FACTORY;
Expand Down
24 changes: 12 additions & 12 deletions packages/contracts-bedrock/src/dispute/DisputeGameFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import { ISemver } from "src/universal/ISemver.sol";
import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";

import { LibGameId } from "src/dispute/lib/LibGameId.sol";

import "src/libraries/DisputeTypes.sol";
import "src/libraries/DisputeErrors.sol";
import "src/dispute/lib/Types.sol";
import "src/dispute/lib/Errors.sol";

/// @title DisputeGameFactory
/// @notice A factory contract for creating `IDisputeGame` contracts. All created dispute games are stored in both a
Expand All @@ -23,8 +21,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
using LibClone for address;

/// @notice Semantic version.
/// @custom:semver 0.6.0
string public constant version = "0.6.0";
/// @custom:semver 0.7.0
string public constant version = "0.7.0";

/// @inheritdoc IDisputeGameFactory
mapping(GameType => IDisputeGame) public gameImpls;
Expand Down Expand Up @@ -68,7 +66,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
returns (IDisputeGame proxy_, Timestamp timestamp_)
{
Hash uuid = getGameUUID(_gameType, _rootClaim, _extraData);
(, timestamp_, proxy_) = _disputeGames[uuid].unpack();
(, Timestamp timestamp, address proxy) = _disputeGames[uuid].unpack();
(proxy_, timestamp_) = (IDisputeGame(proxy), timestamp);
}

/// @inheritdoc IDisputeGameFactory
Expand All @@ -77,7 +76,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
view
returns (GameType gameType_, Timestamp timestamp_, IDisputeGame proxy_)
{
(gameType_, timestamp_, proxy_) = _disputeGameList[_index].unpack();
(GameType gameType, Timestamp timestamp, address proxy) = _disputeGameList[_index].unpack();
(gameType_, timestamp_, proxy_) = (gameType, timestamp, IDisputeGame(proxy));
}

/// @inheritdoc IDisputeGameFactory
Expand Down Expand Up @@ -123,7 +123,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
if (GameId.unwrap(_disputeGames[uuid]) != bytes32(0)) revert GameAlreadyExists(uuid);

// Pack the game ID.
GameId id = LibGameId.pack(_gameType, Timestamp.wrap(uint64(block.timestamp)), proxy_);
GameId id = LibGameId.pack(_gameType, Timestamp.wrap(uint64(block.timestamp)), address(proxy_));

// Store the dispute game id in the mapping & emit the `DisputeGameCreated` event.
_disputeGames[uuid] = id;
Expand Down Expand Up @@ -167,7 +167,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
// Perform a reverse linear search for the `_n` most recent games of type `_gameType`.
for (uint256 i = _start; i >= 0 && i <= _start;) {
GameId id = _disputeGameList[i];
(GameType gameType, Timestamp timestamp, IDisputeGame proxy) = id.unpack();
(GameType gameType, Timestamp timestamp, address proxy) = id.unpack();

if (gameType.raw() == _gameType.raw()) {
// Increase the size of the `games_` array by 1.
Expand All @@ -177,8 +177,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
mstore(games_, add(mload(games_), 0x01))
}

bytes memory extraData = proxy.extraData();
Claim rootClaim = proxy.rootClaim();
bytes memory extraData = IDisputeGame(proxy).extraData();
Claim rootClaim = IDisputeGame(proxy).rootClaim();
games_[games_.length - 1] = GameSearchResult({
index: i,
metadata: id,
Expand Down
13 changes: 6 additions & 7 deletions packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistr
import { Clone } from "@solady/utils/Clone.sol";
import { Types } from "src/libraries/Types.sol";
import { ISemver } from "src/universal/ISemver.sol";
import { LibClock } from "src/dispute/lib/LibUDT.sol";

import "src/libraries/DisputeTypes.sol";
import "src/libraries/DisputeErrors.sol";
import "src/dispute/lib/Types.sol";
import "src/dispute/lib/Errors.sol";

/// @title FaultDisputeGame
/// @notice An implementation of the `IFaultDisputeGame` interface.
Expand Down Expand Up @@ -62,8 +61,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
Position internal constant ROOT_POSITION = Position.wrap(1);

/// @notice Semantic version.
/// @custom:semver 0.18.0
string public constant version = "0.18.0";
/// @custom:semver 0.18.1
string public constant version = "0.18.1";

/// @notice The starting timestamp of the game
Timestamp public createdAt;
Expand All @@ -84,7 +83,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
mapping(address => uint256) public credit;

/// @notice A mapping to allow for constant-time lookups of existing claims.
mapping(ClaimHash => bool) public claims;
mapping(Hash => bool) public claims;

/// @notice A mapping of subgames rooted at a claim index to other claim indices in the subgame.
mapping(uint256 => uint256[]) public subgames;
Expand Down Expand Up @@ -365,7 +364,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
// INVARIANT: There cannot be multiple identical claims with identical moves on the same challengeIndex. Multiple
// claims at the same position may dispute the same challengeIndex. However, they must have different
// values.
ClaimHash claimHash = _claim.hashClaimPos(nextPosition, _challengeIndex);
Hash claimHash = _claim.hashClaimPos(nextPosition, _challengeIndex);
if (claims[claimHash]) revert ClaimAlreadyExists();
claims[claimHash] = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity 0.8.15;
import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol";
import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol";
import { FaultDisputeGame, IFaultDisputeGame, IBigStepper, IInitializable } from "src/dispute/FaultDisputeGame.sol";
import "src/libraries/DisputeTypes.sol";
import "src/libraries/DisputeErrors.sol";
import "src/dispute/lib/Types.sol";
import "src/dispute/lib/Errors.sol";

/// @title PermissionedDisputeGame
/// @notice PermissionedDisputeGame is a contract that inherits from `FaultDisputeGame`, and contains two roles:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title IAnchorStateRegistry
/// @notice Describes a contract that stores the anchor state for each game type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IInitializable } from "src/dispute/interfaces/IInitializable.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title IDisputeGame
/// @notice The generic interface for a DisputeGame contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IDisputeGame } from "./IDisputeGame.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title IDisputeGameFactory
/// @notice The interface for a DisputeGameFactory contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IDisputeGame } from "./IDisputeGame.sol";

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/Types.sol";

/// @title IFaultDisputeGame
/// @notice The interface for a fault proof backed dispute game.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import "src/libraries/DisputeTypes.sol";
import "src/dispute/lib/LibUDT.sol";

////////////////////////////////////////////////////////////////
// `DisputeGameFactory` Errors //
Expand Down
45 changes: 0 additions & 45 deletions packages/contracts-bedrock/src/dispute/lib/LibGameId.sol

This file was deleted.

Loading