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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface IDisputeGame is IInitializable {
function gameType() external view returns (GameType gameType_);
function gameCreator() external pure returns (address creator_);
function rootClaim() external pure returns (Claim rootClaim_);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_);
function l1Head() external pure returns (Hash l1Head_);
function l2SequenceNumber() external pure returns (uint256 l2SequenceNumber_);
function extraData() external pure returns (bytes memory extraData_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ interface IFaultDisputeGame is IDisputeGame {
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error UnknownChainId();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
Expand Down Expand Up @@ -121,6 +122,7 @@ interface IFaultDisputeGame is IDisputeGame {
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ interface IPermissionedDisputeGame is IDisputeGame {
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error UnknownChainId();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
Expand Down Expand Up @@ -111,6 +112,7 @@ interface IPermissionedDisputeGame is IDisputeGame {
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ interface ISuperFaultDisputeGame is IDisputeGame {
function normalModeCredit(address) external view returns (uint256);
function l2SequenceNumber() external pure returns (uint256 l2SequenceNumber_);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim outputRootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand All @@ -121,8 +122,6 @@ interface ISuperFaultDisputeGame is IDisputeGame {
function vm() external view returns (IBigStepper vm_);
function wasRespectedGameTypeWhenCreated() external view returns (bool);
function weth() external view returns (IDelayedWETH weth_);
// TODO(#18516): Remove once IDisputeGame includes this interface
function rootClaimByChainId(uint256 _chainId) external view returns (Claim outputRootClaim_);

function __constructor__(GameConstructorParams memory _params) external;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ interface ISuperPermissionedDisputeGame is IDisputeGame {
function normalModeCredit(address) external view returns (uint256);
function l2SequenceNumber() external pure returns (uint256 l2SequenceNumber_);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim outputRootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand All @@ -119,8 +120,6 @@ interface ISuperPermissionedDisputeGame is IDisputeGame {
function vm() external view returns (IBigStepper vm_);
function wasRespectedGameTypeWhenCreated() external view returns (bool);
function weth() external view returns (IDelayedWETH weth_);
// TODO(#18516): Remove once IDisputeGame includes this interface
function rootClaimByChainId(uint256 _chainId) external view returns (Claim outputRootClaim_);

function __constructor__(ISuperFaultDisputeGame.GameConstructorParams memory _params) external;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ interface IFaultDisputeGameV2 is IDisputeGame {
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error UnknownChainId();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
Expand Down Expand Up @@ -114,6 +115,7 @@ interface IFaultDisputeGameV2 is IDisputeGame {
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ interface IPermissionedDisputeGameV2 is IDisputeGame {
error UnexpectedList();
error UnexpectedRootClaim(Claim rootClaim);
error UnexpectedString();
error UnknownChainId();
error ValidStep();
error InvalidBondDistributionMode();
error GameNotFinalized();
Expand Down Expand Up @@ -110,6 +111,7 @@ interface IPermissionedDisputeGameV2 is IDisputeGame {
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) external payable;
function normalModeCredit(address) external view returns (uint256);
function refundModeCredit(address) external view returns (uint256);
function rootClaimByChainId(uint256 _chainId) external pure returns (Claim rootClaim_);
function resolutionCheckpoints(uint256)
external
view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ interface IOptimisticZkGame is IDisputeGame, ISemver {
function gameType() external view returns (GameType gameType_);
function gameCreator() external pure returns (address creator_);
function rootClaim() external pure returns (Claim rootClaim_);
function rootClaimByChainId(uint256) external pure returns (Claim rootClaim_);
function l1Head() external pure returns (Hash l1Head_);
function extraData() external pure returns (bytes memory extraData_);
function gameData() external view returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_);
Expand Down
24 changes: 24 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,25 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_chainId",
"type": "uint256"
}
],
"name": "rootClaimByChainId",
"outputs": [
{
"internalType": "Claim",
"name": "rootClaim_",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "splitDepth",
Expand Down Expand Up @@ -1212,6 +1231,11 @@
"name": "UnexpectedString",
"type": "error"
},
{
"inputs": [],
"name": "UnknownChainId",
"type": "error"
},
{
"inputs": [],
"name": "ValidStep",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,25 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_chainId",
"type": "uint256"
}
],
"name": "rootClaimByChainId",
"outputs": [
{
"internalType": "Claim",
"name": "rootClaim_",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "splitDepth",
Expand Down Expand Up @@ -1177,6 +1196,11 @@
"name": "UnexpectedString",
"type": "error"
},
{
"inputs": [],
"name": "UnknownChainId",
"type": "error"
},
{
"inputs": [],
"name": "ValidStep",
Expand Down
19 changes: 19 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/OptimisticZkGame.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,25 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "rootClaimByChainId",
"outputs": [
{
"internalType": "Claim",
"name": "rootClaim_",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "sp1Verifier",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,25 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_chainId",
"type": "uint256"
}
],
"name": "rootClaimByChainId",
"outputs": [
{
"internalType": "Claim",
"name": "rootClaim_",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "splitDepth",
Expand Down Expand Up @@ -1253,6 +1272,11 @@
"name": "UnexpectedString",
"type": "error"
},
{
"inputs": [],
"name": "UnknownChainId",
"type": "error"
},
{
"inputs": [],
"name": "ValidStep",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,25 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_chainId",
"type": "uint256"
}
],
"name": "rootClaimByChainId",
"outputs": [
{
"internalType": "Claim",
"name": "rootClaim_",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "splitDepth",
Expand Down Expand Up @@ -1208,6 +1227,11 @@
"name": "UnexpectedString",
"type": "error"
},
{
"inputs": [],
"name": "UnknownChainId",
"type": "error"
},
{
"inputs": [],
"name": "ValidStep",
Expand Down
20 changes: 10 additions & 10 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@
"sourceCodeHash": "0xf19216b7943479af87a01ab8935e68561853e8e333d09719c917228bc7a01a3a"
},
"src/dispute/FaultDisputeGame.sol:FaultDisputeGame": {
"initCodeHash": "0xe7d3c982532946d196d7efadb9e2576c76b8f9e0d1f885ac36977d6f3fb72a65",
"sourceCodeHash": "0x63222e6926c8dd050d1adc0e65039c42382f269c3b0e113751d79e7a5167b7ac"
"initCodeHash": "0x57b01ba6873a49b3adafe58d05e0e0c4f342281181682f9f7ecd30752395b4ad",
"sourceCodeHash": "0x04111af652e4a059b591da704a7d7a15dcb46a75be05fd7cad6b88c1b7a1ac1b"
},
"src/dispute/PermissionedDisputeGame.sol:PermissionedDisputeGame": {
"initCodeHash": "0xefa478f976e55eb53fcccf653b202bc2532781230f20013450ce0845b77d815c",
"sourceCodeHash": "0x335a503a4cc02dd30d88d163393680f3fd89168e0faa4fa4b0ae5da399656f91"
"initCodeHash": "0xcd7a262ac008a2de347e459902ca7039c1c980eb312106b9cc2c1f3190ae0840",
"sourceCodeHash": "0x618013c7ad9742f59445f355f7b26347ee1727c9e6616218a6f3443f1b4bb8e0"
},
"src/dispute/SuperFaultDisputeGame.sol:SuperFaultDisputeGame": {
"initCodeHash": "0xb5ce71bc56109055cd0dc71fc63015443bbdb29c5975e049802cd1b5188f06ca",
Expand All @@ -212,16 +212,16 @@
"sourceCodeHash": "0x314b6e0412f698ce3531e8176ce8e5b8a3976cc3fa9d7ecb1f3278612f90ed4e"
},
"src/dispute/v2/FaultDisputeGameV2.sol:FaultDisputeGameV2": {
"initCodeHash": "0x6fc59e2da083c9e2093e42b0fda705e8215cc216e4dcedbf728c08f69ec2d3bd",
"sourceCodeHash": "0x7fc97734c12e207f011c4f079fffe84f5bd11f4fb4a95dd56ad6a69df184584f"
"initCodeHash": "0x2806f9c9f0babb80be2a0c40382d265d598632dc6c1902db7f5f8f214d233f2f",
"sourceCodeHash": "0x1ac7a6aa4adafe2058046f06a425c662369f756a89be956b5a222647d99fabe8"
},
"src/dispute/v2/PermissionedDisputeGameV2.sol:PermissionedDisputeGameV2": {
"initCodeHash": "0x9896fd04e9a3f9fe4f1d6e93eb298b37a6bfa33424aa705e68cc58d0ba7f3f90",
"sourceCodeHash": "0xc0ff6e93b6e2b9111c11e81b5df8948ab71d02b9d2c4dfda982fcb615519f1f7"
"initCodeHash": "0xfbb451f1a0bf22bb96242db527371dd0b0c3435208f9e074441ec0aacbf414bd",
"sourceCodeHash": "0x92bb886203246108435408762fab6e56fe223c2ed5ae85b5b792653cead4ec7a"
},
"src/dispute/zk/OptimisticZkGame.sol:OptimisticZkGame": {
"initCodeHash": "0x0e905fc81f45b1e9aa786e66bfe70b3ec4abd8d550be5d4c8f43cdad6f2618b2",
"sourceCodeHash": "0x162408c90e8d9d8afd982e9825db093eba5c387cbe1145c1a9b86e2361547138"
"initCodeHash": "0x6eff352a513e3ce2ac5c53e4094985bf2ae1acad3992d73d6564c95aca3aebf1",
"sourceCodeHash": "0x998796b0286830629cd50eeb003eec571680cd171f4ad80bd5cad53aca756909"
},
"src/legacy/DeployerWhitelist.sol:DeployerWhitelist": {
"initCodeHash": "0x2e0ef4c341367eb59cc6c25190c64eff441d3fe130189da91d4d126f6bdbc9b5",
Expand Down
15 changes: 12 additions & 3 deletions packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ import {
GameNotResolved,
ReservedGameType,
GamePaused,
BadExtraData
BadExtraData,
UnknownChainId
} from "src/dispute/lib/Errors.sol";

// Interfaces
Expand Down Expand Up @@ -172,9 +173,9 @@ contract FaultDisputeGame is Clone, ISemver {
uint256 internal constant HEADER_BLOCK_NUMBER_INDEX = 8;

/// @notice Semantic version.
/// @custom:semver 1.8.0
/// @custom:semver 1.9.0
function version() public pure virtual returns (string memory) {
return "1.8.0";
return "1.9.0";
}

/// @notice The starting timestamp of the game
Expand Down Expand Up @@ -865,6 +866,14 @@ contract FaultDisputeGame is Clone, ISemver {
rootClaim_ = Claim.wrap(_getArgBytes32(20));
}

/// @notice Getter for the root claim for a given L2 chain ID.
/// @param _chainId The L2 chain ID to get the root claim for.
/// @return rootClaim_ The root claim of the DisputeGame.
function rootClaimByChainId(uint256 _chainId) public view returns (Claim rootClaim_) {
if (_chainId != L2_CHAIN_ID) revert UnknownChainId();
rootClaim_ = rootClaim();
}

/// @notice Getter for the parent hash of the L1 block when the dispute game was created.
/// @dev `clones-with-immutable-args` argument #3
/// @return l1Head_ The parent hash of the L1 block when the dispute game was created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ contract PermissionedDisputeGame is FaultDisputeGame {
}

/// @notice Semantic version.
/// @custom:semver 1.8.0
/// @custom:semver 1.9.0
function version() public pure override returns (string memory) {
return "1.8.0";
return "1.9.0";
}

/// @param _params Parameters for creating a new FaultDisputeGame.
Expand Down
Loading