Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup router invariants #397

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
10 changes: 10 additions & 0 deletions test/recon-core/CryticToFoundry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ contract CryticToFoundry is Test, TargetFunctions, FoundryAsserts {
poolManager_freeze();
erc7540_6_deposit_call_target(72);
}

// forge test --match-test test_invariant_E_1_0 -vv
function test_invariant_E_1_0() public {
deployNewTokenPoolAndTranche(81, 113078215817378582107422693752520426616851634649913195634947047953023656943);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to assign some variable ( meaningful name ) to these magic numbers :D.
Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are tests that are copy pasted as output of broken properties from medusa/echidna. So there is no meaningful names for these, and we shouldn't adapt these.

poolManager_updateTranchePrice(9757554087961420227, 972056852255743695);
restrictionManager_updateMemberBasic(1240252875855011110);
router_enableLockDepositRequest(16948529030864767477943060538480731523813239832281896240408330105234726880);
router_executeLockedDepositRequest();
assertTrue(invariant_E_1());
}
}
2 changes: 1 addition & 1 deletion test/recon-core/Properties.sol
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ abstract contract Properties is Setup, Asserts, ERC7540CentrifugeProperties {
/// @audit Minted by Asset Payouts by Investors
== (
mintedByCurrencyPayout[address(token)] + sumOfDepositRequests[address(token)]
+ sumOfTransfersIn[address(token)]
+ sumOfTransfersIn[address(token)] + sumOfExecutedLockedDepositRequests[address(token)]
// Minus Claimed Redemptions and TransfersOut
- sumOfClaimedRedemptions[address(token)] - sumOfClaimedDepositCancelations[address(token)]
- sumOfTransfersOut[address(token)]
Expand Down
Loading