Skip to content

Conversation

@JustXxx
Copy link
Owner

@JustXxx JustXxx commented Sep 8, 2024

No description provided.

JustXxx and others added 30 commits May 2, 2024 15:58
Copy FaultDisputeGame2.sol and FaultDisputGame2.t.sol and FaultDisputeActors2.sol
modify Nary, adapted to version 1.2.0
rename _verifyExecBisectionRoot to _verifyExecMultisectionRoot and add a test for last attack branch…
fix ancestor search bugs and support DA in stepV2()
Add _findExecTraceAncestor() test for attacking the last branch with non-root-claim ancestor
billxu and others added 27 commits July 22, 2024 20:33
…dLocalData

fix the unit test of addLocalData
…st contract has been added to minimize changes in the testing code
…ontract

The "attack" has been modified to support "da" and the "FaultDisputeGameTest" contract has been added to minimize changes in the testing code
Added an attack test with the da type as calldata.
Comment on lines +1142 to +1169
uint256 _intervalDepth
)
internal
pure
returns (Position first_)
{
first_ = _position;
for (uint64 start = first_.depth(); start % _intervalDepth != 0; start++) {
first_ = first_.right();
}
}

function attackV2(Claim _disputed, uint256 _parentIndex, uint64 _attackBranch, uint256 _daType, bytes memory _claims) public payable {
Claim claim = Claim.wrap(LibDA.getClaimsHash(_daType, MAX_ATTACK_BRANCH, _claims));
moveV2(_disputed, _parentIndex, claim, _attackBranch);
}

function step(
uint256 _claimIndex,
bool _isAttack,
bytes calldata _stateData,
bytes calldata _proof
)
public
virtual
{
revert NotSupported();
}

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame._findTraceAncestorRoot(Position,uint256,bool) (src/dispute/FaultDisputeGameN.sol#1142-1169) uses a weak PRNG: "offset = ancestorPos_.raw() % (1 << N_BITS) (src/dispute/FaultDisputeGameN.sol#1156)"
Comment on lines +1171 to +1177
function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) public payable virtual {
revert NotSupported();
}

function getClaim(bytes32 _claimRoot, Position _pos, LibDA.DAItem memory _daItem) internal view returns (Claim claim_) {
LibDA.verifyClaimHash(_daItem.daType, _claimRoot, MAX_ATTACK_BRANCH, _pos.raw() % (MAX_ATTACK_BRANCH + 1), _daItem.dataHash, _daItem.proof);
claim_ = Claim.wrap(_daItem.dataHash);

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame._traceAncestorV2(Position,uint256) (src/dispute/FaultDisputeGameN.sol#1171-1177) uses a weak PRNG: "_position.depth() % _intervalDepth != 0 (src/dispute/FaultDisputeGameN.sol#1172)"
Comment on lines +1183 to +1195

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame._firstValidRightIndex(Position,uint256) (src/dispute/FaultDisputeGameN.sol#1183-1195) uses a weak PRNG: "start % _intervalDepth != 0 (src/dispute/FaultDisputeGameN.sol#1192)"
Comment on lines +1218 to +1221

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame.getClaim(bytes32,Position,LibDA.DAItem) (src/dispute/FaultDisputeGameN.sol#1218-1221) uses a weak PRNG: "LibDA.verifyClaimHash(_daItem.daType,_claimRoot,MAX_ATTACK_BRANCH,_pos.raw() % (MAX_ATTACK_BRANCH + 1),_daItem.dataHash,_daItem.proof) (src/dispute/FaultDisputeGameN.sol#1219)"
@JustXxx JustXxx merged commit e74347a into code-read-from-develop Sep 8, 2024
JustXxx pushed a commit that referenced this pull request Sep 11, 2024
* feat: add L2 standrad bridge interop contract

* test: add L2 standard bridge interop unit tests (#13)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: unit tests fixes

* fix: super to legacy tests failing

* fix: mock and expect mint and burn

* fix: add generic factory interface (#14)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert (#17)

* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert

* fix: use only a public function for create3

* feat: rollback interop factory, modify legacy one

* fix: delete local token return variable

* fix: PR fixes

* test: fix address assuming

* test: fix view warning

* fix: snapshots

* test: small fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants