forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The attack has been modified to support da and the FaultDisputeGameTe…
…st contract has been added to minimize changes in the testing code
- Loading branch information
billxu
committed
Aug 7, 2024
1 parent
40dfed9
commit 61f97ab
Showing
3 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/contracts-bedrock/test/dispute/FaultDisputeGameNTest.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import { GameType, Claim, Duration } from "src/dispute/lib/LibUDT.sol"; | ||
import { FaultDisputeGame } from "src/dispute/FaultDisputeGameN.sol"; | ||
import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol"; | ||
import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol"; | ||
import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol"; | ||
|
||
contract FaultDisputeGameTest is FaultDisputeGame { | ||
constructor( | ||
GameType _gameType, | ||
Claim _absolutePrestate, | ||
uint256 _maxGameDepth, | ||
uint256 _splitDepth, | ||
Duration _clockExtension, | ||
Duration _maxClockDuration, | ||
IBigStepper _vm, | ||
IDelayedWETH _weth, | ||
IAnchorStateRegistry _anchorStateRegistry, | ||
uint256 _l2ChainId | ||
) | ||
FaultDisputeGame( | ||
_gameType, | ||
_absolutePrestate, | ||
_maxGameDepth, | ||
_splitDepth, | ||
_clockExtension, | ||
_maxClockDuration, | ||
_vm, | ||
_weth, | ||
_anchorStateRegistry, | ||
_l2ChainId | ||
) | ||
{ } | ||
|
||
// For testing convenience and to minimize changes in the testing code, the submission of the "claims" value is | ||
// omitted during the attack. In contract testing, the value of "claims" is already known and does not need to be | ||
// submitted via calldata or EIP-4844 during the attack. | ||
function attackV2(Claim _disputed, uint256 _parentIndex, Claim _claim, uint64 _attackBranch) public payable { | ||
moveV2(_disputed, _parentIndex, _claim, _attackBranch); | ||
} | ||
} |