Skip to content

Commit

Permalink
fix: repaid shares computation
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Dec 10, 2024
1 parent ba2280f commit 712e6a2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions certora/specs/LiquidateBuffer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ rule liquidateImprovePosition(env e, MorphoHarness.MarketParams marketParams, ad
assert borrowerCollateral * collateralPrice * virtualTotalBorrowShares(id) * Util.wad() >= borrowerShares * Util.oraclePriceScale() * virtualTotalBorrowAssets(id) * lif;

uint256 seizedAssets;
uint256 repaidShares;
(seizedAssets, repaidShares) = liquidate(e, marketParams, borrower, seizedAssetsInput, repaidSharesInput, data);
uint256 repaidAssets;
(seizedAssets, repaidAssets) = liquidate(e, marketParams, borrower, seizedAssetsInput, repaidSharesInput, data);

assert collateral(id, borrower) != 0;

uint256 newBorrowerShares = borrowShares(id, borrower);
uint256 repaidShares = assert_uint256(borrowerShares - newBorrowerShares);

require !priceChanged;
assert repaidShares * borrowerCollateral >= seizedAssets * borrowerShares;
Expand Down

0 comments on commit 712e6a2

Please sign in to comment.