Skip to content

Commit

Permalink
refactor: create market input validation rule
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Dec 7, 2023
1 parent 4ac8778 commit 01f9e2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions certora/specs/Reverts.spec
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ rule setFeeRecipientRevertCondition(env e, address newFeeRecipient) {
assert lastReverted <=> e.msg.value != 0 || e.msg.sender != oldOwner || newFeeRecipient == oldFeeRecipient;
}

// Check the revert condition for the createMarket function.
rule createMarketRevertCondition(env e, MorphoHarness.MarketParams marketParams) {
// Check that createMarket reverts when its input are not validated.
rule createMarketInputValidation(env e, MorphoHarness.MarketParams marketParams) {
MorphoHarness.Id id = libId(marketParams);
bool irmEnabled = isIrmEnabled(marketParams.irm);
bool lltvEnabled = isLltvEnabled(marketParams.lltv);
bool wasCreated = isCreated(id);
createMarket@withrevert(e, marketParams);
assert lastReverted <=> e.msg.value != 0 || !irmEnabled || !lltvEnabled || wasCreated;
assert e.msg.value != 0 || !irmEnabled || !lltvEnabled || wasCreated => lastReverted;
}

// Check that supply reverts when its input are not validated.
Expand Down

0 comments on commit 01f9e2b

Please sign in to comment.