Skip to content

Commit

Permalink
refactor: remove lastUpdateIsNotNil function
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Dec 10, 2024
1 parent fad2351 commit b68e6c9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions certora/specs/MarketExists.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using Morpho as MORPHO;

methods {
function _.market(PreLiquidation.Id) external => DISPATCHER(true);
function MORPHO.lastUpdate(PreLiquidation.Id) external returns (uint256) envfree;
function MORPHO.market(PreLiquidation.Id) external returns (uint128, uint128, uint128, uint128, uint128, uint128) envfree;
function _.market(PreLiquidation.Id) external => DISPATCHER(true);
function _.price() external => NONDET;
}

Expand All @@ -18,13 +19,7 @@ hook TIMESTAMP uint newTimestamp {
lastTimestamp = newTimestamp;
}

function lastUpdateIsNotNil(PreLiquidation.Id id) returns bool {
mathint lastUpdate;
(_,_,_,_,lastUpdate,_) = MORPHO.market(id);
return lastUpdate != 0;
}

// Ensure that the pre-liquidation contract interacts with a created market.

invariant marketExists()
lastUpdateIsNotNil(currentContract.ID);
MORPHO.lastUpdate(currentContract.ID) != 0

0 comments on commit b68e6c9

Please sign in to comment.