generated from defi-wonderland/solidity-foundry-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d45342
commit c0ffee6
Showing
5 changed files
with
94 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,79 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.26; | ||
|
||
import {IEBORequestModule, IOracle} from './Setup.t.sol'; | ||
import {PropertyParent} from './properties/PropertyParent.t.sol'; | ||
|
||
contract FuzzTest is PropertyParent { | ||
/// @custom:property-id 13 | ||
/// @custom:property each disputeId and responseId can only be tied to one requestId | ||
/// TODO: aggregator on arrays... | ||
function prop_singleRequestIdForSingleDisputeOrResponseId() public { | ||
// for each request | ||
for (uint256 currentRequestIdx; currentRequestIdx < _ghost_requests.length; currentRequestIdx++) { | ||
bytes32 currentRequestId = _ghost_requests[currentRequestIdx]; | ||
// for each response of this request | ||
for ( | ||
uint256 currentRequestResponseIdx; | ||
currentRequestResponseIdx < _ghost_activeResponses[currentRequestId].length; | ||
currentRequestResponseIdx++ | ||
) { | ||
// for each other request | ||
for (uint256 otherRequestsIdx; otherRequestsIdx < _ghost_requests.length; otherRequestsIdx++) { | ||
if (otherRequestsIdx == currentRequestIdx) continue; | ||
|
||
bytes32 otherRequestId = _ghost_requests[otherRequestsIdx]; | ||
|
||
// for each response of the other request | ||
for ( | ||
uint256 otherRequestResponseIdx; | ||
otherRequestResponseIdx < _ghost_activeResponses[otherRequestId].length; | ||
otherRequestResponseIdx++ | ||
) { | ||
// check that it is not pointing to the same request | ||
assertTrue( | ||
_ghost_activeResponses[currentRequestId][currentRequestResponseIdx] | ||
!= _ghost_activeResponses[otherRequestId][otherRequestResponseIdx], | ||
'prop 13: different response id for same request' | ||
); | ||
} | ||
} | ||
} | ||
} | ||
|
||
// for each request | ||
for (uint256 currentRequestIdx; currentRequestIdx < _ghost_requests.length; currentRequestIdx++) { | ||
bytes32 currentRequestId = _ghost_requests[currentRequestIdx]; | ||
// for each dispute of this request | ||
for ( | ||
uint256 currentRequestDisputeIdx; | ||
currentRequestDisputeIdx < _ghost_disputes[currentRequestId].length; | ||
currentRequestDisputeIdx++ | ||
) { | ||
// for each other request | ||
for (uint256 otherRequestsIdx; otherRequestsIdx < _ghost_requests.length; otherRequestsIdx++) { | ||
if (otherRequestsIdx == currentRequestIdx) continue; | ||
|
||
bytes32 otherRequestId = _ghost_requests[otherRequestsIdx]; | ||
|
||
// for each dispute of the other request | ||
for ( | ||
uint256 otherRequestDisputeIdx; | ||
otherRequestDisputeIdx < _ghost_disputes[otherRequestId].length; | ||
otherRequestDisputeIdx++ | ||
) { | ||
// check that it is not pointing to the same request | ||
assertTrue( | ||
_ghost_disputes[currentRequestId][currentRequestDisputeIdx] | ||
!= _ghost_disputes[otherRequestId][otherRequestDisputeIdx], | ||
'prop 13: different dispute id for same request' | ||
); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
//solhint-disable no-empty-blocks | ||
function test_debug() public {} | ||
} |
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
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