Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
897d9b8d
Commit
897d9b8d
authored
Jun 23, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce `Semver` on `FaultDisputeGame` + `DisputeGameFactory`
parent
590d2b79
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
39 deletions
+14
-39
disputegamefactory.go
op-bindings/bindings/disputegamefactory.go
+5
-5
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+2
-2
DisputeGameFactory.sol
...ontracts-bedrock/contracts/dispute/DisputeGameFactory.sol
+3
-9
FaultDisputeGame.sol
.../contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
+3
-11
IDisputeGame.sol
...cts-bedrock/contracts/dispute/interfaces/IDisputeGame.sol
+1
-2
IVersioned.sol
...racts-bedrock/contracts/dispute/interfaces/IVersioned.sol
+0
-10
No files found.
op-bindings/bindings/disputegamefactory.go
View file @
897d9b8d
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.gas-snapshot
View file @
897d9b8d
...
@@ -39,8 +39,8 @@ FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeed
...
@@ -39,8 +39,8 @@ FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeed
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 503574)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 503574)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 491581)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 491581)
FaultDisputeGame_Test:test_defendRoot_invalidMove_reverts() (gas: 13250)
FaultDisputeGame_Test:test_defendRoot_invalidMove_reverts() (gas: 13250)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 174
09
)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 174
48
)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 178
34
)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 178
73
)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10337)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10337)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8216)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8216)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17691)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17691)
...
...
packages/contracts-bedrock/contracts/dispute/DisputeGameFactory.sol
View file @
897d9b8d
...
@@ -8,10 +8,10 @@ import { ClonesWithImmutableArgs } from "@cwia/ClonesWithImmutableArgs.sol";
...
@@ -8,10 +8,10 @@ import { ClonesWithImmutableArgs } from "@cwia/ClonesWithImmutableArgs.sol";
import {
import {
OwnableUpgradeable
OwnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { Semver } from "../universal/Semver.sol";
import { IDisputeGame } from "./interfaces/IDisputeGame.sol";
import { IDisputeGame } from "./interfaces/IDisputeGame.sol";
import { IDisputeGameFactory } from "./interfaces/IDisputeGameFactory.sol";
import { IDisputeGameFactory } from "./interfaces/IDisputeGameFactory.sol";
import { IVersioned } from "./interfaces/IVersioned.sol";
/// @title DisputeGameFactory
/// @title DisputeGameFactory
/// @notice A factory contract for creating `IDisputeGame` contracts. All created dispute games
/// @notice A factory contract for creating `IDisputeGame` contracts. All created dispute games
...
@@ -19,7 +19,7 @@ import { IVersioned } from "./interfaces/IVersioned.sol";
...
@@ -19,7 +19,7 @@ import { IVersioned } from "./interfaces/IVersioned.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,
IVersioned
{
contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory,
Semver
{
/// @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;
...
@@ -37,7 +37,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion
...
@@ -37,7 +37,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion
GameId[] internal _disputeGameList;
GameId[] internal _disputeGameList;
/// @notice constructs a new DisputeGameFactory contract.
/// @notice constructs a new DisputeGameFactory contract.
constructor() OwnableUpgradeable() {
constructor() OwnableUpgradeable()
Semver(0, 0, 2)
{
initialize(address(0));
initialize(address(0));
}
}
...
@@ -48,12 +48,6 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion
...
@@ -48,12 +48,6 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion
_transferOwnership(_owner);
_transferOwnership(_owner);
}
}
/// @inheritdoc IVersioned
/// @custom:semver 0.0.2
function version() external pure returns (string memory) {
return "0.0.2";
}
/// @inheritdoc IDisputeGameFactory
/// @inheritdoc IDisputeGameFactory
function gameCount() external view returns (uint256 gameCount_) {
function gameCount() external view returns (uint256 gameCount_) {
gameCount_ = _disputeGameList.length;
gameCount_ = _disputeGameList.length;
...
...
packages/contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
View file @
897d9b8d
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
pragma solidity ^0.8.15;
pragma solidity ^0.8.15;
import { IDisputeGame } from "./interfaces/IDisputeGame.sol";
import { IDisputeGame } from "./interfaces/IDisputeGame.sol";
import { IVersioned } from "./interfaces/IVersioned.sol";
import { IFaultDisputeGame } from "./interfaces/IFaultDisputeGame.sol";
import { IFaultDisputeGame } from "./interfaces/IFaultDisputeGame.sol";
import { IInitializable } from "./interfaces/IInitializable.sol";
import { IInitializable } from "./interfaces/IInitializable.sol";
import { IBondManager } from "./interfaces/IBondManager.sol";
import { IBondManager } from "./interfaces/IBondManager.sol";
import { IBigStepper } from "./interfaces/IBigStepper.sol";
import { IBigStepper } from "./interfaces/IBigStepper.sol";
import { Clone } from "../libraries/Clone.sol";
import { Clone } from "../libraries/Clone.sol";
import { Semver } from "../universal/Semver.sol";
import { LibHashing } from "./lib/LibHashing.sol";
import { LibHashing } from "./lib/LibHashing.sol";
import { LibPosition } from "./lib/LibPosition.sol";
import { LibPosition } from "./lib/LibPosition.sol";
import { LibClock } from "./lib/LibClock.sol";
import { LibClock } from "./lib/LibClock.sol";
...
@@ -18,7 +18,7 @@ import "../libraries/DisputeErrors.sol";
...
@@ -18,7 +18,7 @@ import "../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 {
contract FaultDisputeGame is IFaultDisputeGame, Clone
, Semver
{
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// State Vars //
// State Vars //
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
...
@@ -40,9 +40,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
...
@@ -40,9 +40,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
/// @notice The root claim's position is always at gindex 1.
/// @notice The root claim's position is always at gindex 1.
Position internal constant ROOT_POSITION = Position.wrap(1);
Position internal constant ROOT_POSITION = Position.wrap(1);
/// @notice The current Semver of the FaultDisputeGame implementation.
string internal constant VERSION = "0.0.2";
/// @notice The starting timestamp of the game
/// @notice The starting timestamp of the game
Timestamp public gameStart;
Timestamp public gameStart;
...
@@ -63,7 +60,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
...
@@ -63,7 +60,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
Claim _absolutePrestate,
Claim _absolutePrestate,
uint256 _maxGameDepth,
uint256 _maxGameDepth,
IBigStepper _vm
IBigStepper _vm
) {
)
Semver(0, 0, 2)
{
ABSOLUTE_PRESTATE = _absolutePrestate;
ABSOLUTE_PRESTATE = _absolutePrestate;
MAX_GAME_DEPTH = _maxGameDepth;
MAX_GAME_DEPTH = _maxGameDepth;
VM = _vm;
VM = _vm;
...
@@ -376,9 +373,4 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
...
@@ -376,9 +373,4 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
})
})
);
);
}
}
/// @inheritdoc IVersioned
function version() external pure override returns (string memory version_) {
version_ = VERSION;
}
}
}
packages/contracts-bedrock/contracts/dispute/interfaces/IDisputeGame.sol
View file @
897d9b8d
...
@@ -3,13 +3,12 @@ pragma solidity ^0.8.15;
...
@@ -3,13 +3,12 @@ pragma solidity ^0.8.15;
import "../../libraries/DisputeTypes.sol";
import "../../libraries/DisputeTypes.sol";
import { IVersioned } from "./IVersioned.sol";
import { IBondManager } from "./IBondManager.sol";
import { IBondManager } from "./IBondManager.sol";
import { IInitializable } from "./IInitializable.sol";
import { IInitializable } from "./IInitializable.sol";
/// @title IDisputeGame
/// @title IDisputeGame
/// @notice The generic interface for a DisputeGame contract.
/// @notice The generic interface for a DisputeGame contract.
interface IDisputeGame is IInitializable
, IVersioned
{
interface IDisputeGame is IInitializable {
/// @notice Emitted when the game is resolved.
/// @notice Emitted when the game is resolved.
/// @param status The status of the game after resolution.
/// @param status The status of the game after resolution.
event Resolved(GameStatus indexed status);
event Resolved(GameStatus indexed status);
...
...
packages/contracts-bedrock/contracts/dispute/interfaces/IVersioned.sol
deleted
100644 → 0
View file @
590d2b79
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
/// @title IVersioned
/// @notice An interface for semantically versioned contracts.
interface IVersioned {
/// @notice Returns the semantic version of the contract
/// @return _version The semantic version of the contract
function version() external pure returns (string memory _version);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment