Skip to content

Commit

Permalink
Merge pull request #621 from morpho-org/certora/liquidate-liveness
Browse files Browse the repository at this point in the history
[Certora] Liquidate liveness
  • Loading branch information
QGarchery authored Nov 30, 2023
2 parents b8bc824 + 17d221d commit 2d5a8f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions certora/specs/Liveness.spec
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ rule liquidateChangesTokens(env e, MorphoInternalAccess.MarketParams marketParam
assert liquidityAfter == liquidityBefore + min(repaidAssets, borrowLoanAssetsBefore);
}

// Check that you can liquidate non-zero tokens by passing shares.
rule canLiquidateByPassingShares(env e, MorphoInternalAccess.MarketParams marketParams, address borrower, uint256 repaidShares, bytes data) {
uint256 seizedAssets;
uint256 repaidAssets;
seizedAssets, repaidAssets = liquidate(e, marketParams, borrower, 0, repaidShares, data);

satisfy seizedAssets != 0 && repaidAssets != 0;
}

// Check that nonce and authorization are properly updated with calling setAuthorizationWithSig.
rule setAuthorizationWithSigChangesNonceAndAuthorizes(env e, MorphoInternalAccess.Authorization authorization, MorphoInternalAccess.Signature signature) {
mathint nonceBefore = nonce(authorization.authorizer);
Expand Down

0 comments on commit 2d5a8f6

Please sign in to comment.