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
9e440425
Unverified
Commit
9e440425
authored
Feb 09, 2024
by
clabby
Committed by
GitHub
Feb 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a getter for the claimed bond flag (#9466)
parent
f0aaa471
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
9 deletions
+75
-9
faultdisputegame.go
op-bindings/bindings/faultdisputegame.go
+33
-2
faultdisputegame_more.go
op-bindings/bindings/faultdisputegame_more.go
+1
-1
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+2
-2
FaultDisputeGame.json
...ges/contracts-bedrock/snapshots/abi/FaultDisputeGame.json
+13
-0
PermissionedDisputeGame.json
...tracts-bedrock/snapshots/abi/PermissionedDisputeGame.json
+13
-0
FaultDisputeGame.sol
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
+13
-4
No files found.
op-bindings/bindings/faultdisputegame.go
View file @
9e440425
This diff is collapsed.
Click to expand it.
op-bindings/bindings/faultdisputegame_more.go
View file @
9e440425
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/semver-lock.json
View file @
9e440425
...
...
@@ -96,8 +96,8 @@
"sourceCodeHash"
:
"0xe1891e7e6a1928b9a2ddc47d1f010650f1125a0617b8bf32190176a3bb674b4f"
},
"src/dispute/FaultDisputeGame.sol"
:
{
"initCodeHash"
:
"0x
ba582b158027b434b4e7d4d1edc073c7fce8b499c5ce8da03ea98c173c530f5d
"
,
"sourceCodeHash"
:
"0xd
5f0f679c4559b277287f1844fb03ed47c702fcffff3c4aaea0e0ce8fc7d0760
"
"initCodeHash"
:
"0x
ca9b1b10500ef59c60f0d575cc3bad28bf6554fbbd1edc26ee0e9225e2c36c86
"
,
"sourceCodeHash"
:
"0xd
1e1f952c6112f5126601740cfabfdd3e5692cfaadcc9f5316a30bd48c10cc0b
"
},
"src/legacy/DeployerWhitelist.sol"
:
{
"initCodeHash"
:
"0x8de80fb23b26dd9d849f6328e56ea7c173cd9e9ce1f05c9beea559d1720deb3d"
,
...
...
packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json
View file @
9e440425
...
...
@@ -174,6 +174,19 @@
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
"inputs"
:
[],
"name"
:
"claimedBondFlag"
,
"outputs"
:
[
{
"internalType"
:
"uint128"
,
"name"
:
"claimedBondFlag_"
,
"type"
:
"uint128"
}
],
"stateMutability"
:
"pure"
,
"type"
:
"function"
},
{
"inputs"
:
[],
"name"
:
"createdAt"
,
...
...
packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json
View file @
9e440425
...
...
@@ -184,6 +184,19 @@
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
"inputs"
:
[],
"name"
:
"claimedBondFlag"
,
"outputs"
:
[
{
"internalType"
:
"uint128"
,
"name"
:
"claimedBondFlag_"
,
"type"
:
"uint128"
}
],
"stateMutability"
:
"pure"
,
"type"
:
"function"
},
{
"inputs"
:
[],
"name"
:
"createdAt"
,
...
...
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
View file @
9e440425
...
...
@@ -50,6 +50,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
/// @notice The global root claim's position is always at gindex 1.
Position internal constant ROOT_POSITION = Position.wrap(1);
/// @notice The flag set in the `bond` field of a `ClaimData` struct to indicate that the bond has been claimed.
uint128 internal constant CLAIMED_BOND_FLAG = type(uint128).max;
/// @notice The starting timestamp of the game
Timestamp public createdAt;
...
...
@@ -81,8 +84,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
bool internal initialized;
/// @notice Semantic version.
/// @custom:semver 0.
2.1
string public constant version = "0.
2.1
";
/// @custom:semver 0.
3.0
string public constant version = "0.
3.0
";
/// @param _gameType The type ID of the game.
/// @param _absolutePrestate The absolute prestate of the instruction trace.
...
...
@@ -550,6 +553,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
if (!success) revert BondTransferFailed();
}
/// @notice Returns the flag set in the `bond` field of a `ClaimData` struct to indicate that the bond has been
/// claimed.
function claimedBondFlag() external pure returns (uint128 claimedBondFlag_) {
claimedBondFlag_ = CLAIMED_BOND_FLAG;
}
////////////////////////////////////////////////////////////////
// IMMUTABLE GETTERS //
////////////////////////////////////////////////////////////////
...
...
@@ -599,8 +608,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
function _distributeBond(address _recipient, ClaimData storage _bonded) internal {
// Set all bits in the bond value to indicate that the bond has been paid out.
uint256 bond = _bonded.bond;
if (bond ==
type(uint128).max
) revert ClaimAlreadyResolved();
_bonded.bond =
type(uint128).max
;
if (bond ==
CLAIMED_BOND_FLAG
) revert ClaimAlreadyResolved();
_bonded.bond =
CLAIMED_BOND_FLAG
;
// Increase the recipient's credit.
credit[_recipient] += bond;
...
...
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