From 9c2e3777611613e7a7760ee0f8bd44201085be89 Mon Sep 17 00:00:00 2001 From: prateek105 Date: Thu, 11 Jan 2024 19:52:21 +0530 Subject: [PATCH] Reset borrower t0 reserve settle amount if borrower is out of auction after any action --- .../unbounded/UnboundedLiquidationPoolHandler.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/forge/invariants/base/handlers/unbounded/UnboundedLiquidationPoolHandler.sol b/tests/forge/invariants/base/handlers/unbounded/UnboundedLiquidationPoolHandler.sol index 5d8339e1c..324a39c29 100644 --- a/tests/forge/invariants/base/handlers/unbounded/UnboundedLiquidationPoolHandler.sol +++ b/tests/forge/invariants/base/handlers/unbounded/UnboundedLiquidationPoolHandler.sol @@ -233,6 +233,9 @@ abstract contract UnboundedLiquidationPoolHandler is BaseHandler { auctionInfo.auctionPrice ); } + + // **A10**: T0 reserve settle amount resets if borrower is out of auction + if (_getAuctionInfo(borrower_).kickTime == 0) borrowerT0ReserveSettleAmount[borrower_] = 0; } catch (bytes memory err) { _ensurePoolError(err); } @@ -341,6 +344,9 @@ abstract contract UnboundedLiquidationPoolHandler is BaseHandler { // assign value to fenwick tree to mitigate rounding error that could be created in a _fenwickRemove call fenwickDeposits[bucketIndex_] = afterTakeVars.deposit; + + // **A10**: T0 reserve settle amount resets if borrower is out of auction + if (_getAuctionInfo(borrower_).kickTime == 0) borrowerT0ReserveSettleAmount[borrower_] = 0; } catch (bytes memory err) { // Reset event Logs vm.getRecordedLogs(); @@ -468,6 +474,10 @@ abstract contract UnboundedLiquidationPoolHandler is BaseHandler { buckets.add(7388); lenderDepositTime[borrower_][7388] = block.timestamp; } + + // **A10**: T0 reserve settle amount resets if borrower is out of auction + if (_getAuctionInfo(borrower_).kickTime == 0) borrowerT0ReserveSettleAmount[borrower_] = 0; + } catch (bytes memory err) { _ensurePoolError(err); }