ajna-core icon indicating copy to clipboard operation
ajna-core copied to clipboard

Update `_assertAuction` to check borrower `t0ReserveSettleAmount` and add invariant A10

Open prateek105 opened this issue 1 year ago • 0 comments

Description

  • Update auctionInfo to return borrower t0ReserveSettleAmount from the pool.
  • Update _assertAuction to check borrower t0ReserveSettleAmount.
  • Add invariant A10: Upon kick t0ReserveSettleAmount should be set to BorrowerT0Debt * borrowFeeRate / 2 for the kicked borrower
  • Update LOANS_COUNT in ERC20PoolPositionsInvariants from 500 to 320 to resolve the EvmError: MemoryLimitOOG error while running tests. This started to fail because auctionInfo updated to return t0ReserveSettleAmount now.

Purpose

Impact

  • This PR includes src changes to return t0ReserveSettleAmount. This PR can be used for testing only to avoid contracts redeployment as there is no real need for user to know how much bad debt can be settled through reserves at the time of settlement.

Tasks

  • [x] Changes to protocol contracts are covered by unit tests executed by CI.
  • [x] Protocol contract size limits have not been exceeded.
  • [x] Gas consumption for impacted transactions have been compared with the target branch, and nontrivial changes cited in the Impact section above.
  • [x] Scope labels have been assigned as appropriate.
  • [x] Invariant tests have been manually executed as appropriate for the nature of the change.

prateek105 avatar Jan 10 '24 14:01 prateek105