ajna-finance / ajna-core

The Ajna protocol is a non-custodial, peer-to-peer, permissionless lending, borrowing and trading system that requires no governance or external price feeds to function.
https://www.ajna.finance/
Other
31 stars 11 forks source link

Incorrect(Unscaled) deposits are used to check bucket bankruptcy in forgive bad debt #971

Closed prateek105 closed 1 year ago

prateek105 commented 1 year ago

Description

Purpose

Impact

Tasks

EdNoepel commented 1 year ago

There's overlap with this change and Sherlock 41. Awaiting @mattcushman 's input on that.

I see Matt has opined on that in the comments. Might warrant further discussion.

prateek105 commented 1 year ago

LGTM, do we need to add a unit test for this?

I tried adding a unit test for this scenario but was unable to simulate because to simulate a significant difference between scaled and unscaled amount I will need to skip a lot of time and if I do that the accrueInterest overflows. But we do have tests that cover this branch so it is part of code coverage already, for these reasons I think we can ignore a separate unit test for this.