-
Notifications
You must be signed in to change notification settings - Fork 1
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
7f5e1c6
commit 5ab47a5
Showing
4 changed files
with
68 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ jobs: | |
matrix: | ||
conf: | ||
- Immutability | ||
- MarketExists | ||
- Liveness | ||
- Reentrancy | ||
- Reverts | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"files": [ | ||
"src/PreLiquidation.sol", | ||
"lib/morpho-blue/src/Morpho.sol", | ||
], | ||
"link": [ | ||
"PreLiquidation:MORPHO=Morpho" | ||
], | ||
"parametric_contracts" : ["Morpho"], | ||
"solc_optimize_map" : { | ||
"Morpho" : "99999", | ||
"PreLiquidation" : "99999", | ||
}, | ||
"solc_via_ir" : true, | ||
"solc_map": { | ||
"Morpho": "solc-0.8.19", | ||
"PreLiquidation": "solc-0.8.27", | ||
}, | ||
"verify": "PreLiquidation:certora/specs/MarketExists.spec", | ||
"prover_args": [ | ||
"-depth 3", | ||
"-mediumTimeout 20", | ||
"-timeout 120" | ||
], | ||
"rule_sanity": "basic", | ||
"server": "production", | ||
"msg": "PreLiquidation MarketExists" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
using Morpho as MORPHO; | ||
|
||
methods { | ||
function _.market(PreLiquidation.Id) external => DISPATCHER(true); | ||
function MORPHO.market(PreLiquidation.Id) external | ||
returns (uint128, uint128, uint128,uint128, uint128, uint128) envfree; | ||
function _.price() external => mockPrice() expect uint256; | ||
} | ||
|
||
persistent ghost uint256 lastTimestamp; | ||
|
||
hook TIMESTAMP uint newTimestamp { | ||
// Safe require because timestamps are guaranteed to be increasing. | ||
require newTimestamp >= lastTimestamp; | ||
// Safe require as it corresponds to some time very far into the future. | ||
require newTimestamp < 2^63; | ||
lastTimestamp = newTimestamp; | ||
} | ||
|
||
function mockPrice() returns uint256 { | ||
uint256 price; | ||
return price; | ||
} | ||
|
||
function lastUpdateIsNotNil(PreLiquidation.Id id) returns bool { | ||
mathint lastUpdate; | ||
(_,_,_,_,lastUpdate,_) = MORPHO.market(id); | ||
return lastUpdate != 0; | ||
} | ||
|
||
//Ensure constructor requirement. | ||
|
||
invariant marketExists() | ||
lastUpdateIsNotNil(currentContract.ID); |