M-22: dailyDebtIncreaseLimitLeft is not updated in liquidate()
Comments
V3Vault provides a daily limit check for debt operations. This daily limit limits how much debt is utilized in debt operations. The expected specs for using this limit check is as follows:
Reset the daily debt limit if necessary.
Increase/decrease the daily debt limit.
Unfortunately, the liquidate function does not implement this daily debt limit feature. Because of this, when a user liquidates a loan position, the debt daily limit will not be updated.
Mitigation
PR #11
This fix provides the necessary updates to the liquidate function:
At the beginning of the operation, the debt daily limit is reset if necessary.
The daily debt limit is increased by the loan debt denominated in asset amount.
With these two fixes in place, the liquidate() function now increases the daily debt limit.
Lines of code
Vulnerability details
C4 issue
M-22: dailyDebtIncreaseLimitLeft is not updated in liquidate()
Comments
V3Vault provides a daily limit check for debt operations. This daily limit limits how much debt is utilized in debt operations. The expected specs for using this limit check is as follows:
Unfortunately, the liquidate function does not implement this daily debt limit feature. Because of this, when a user liquidates a loan position, the debt daily limit will not be updated.
Mitigation
PR #11
This fix provides the necessary updates to the liquidate function:
With these two fixes in place, the liquidate() function now increases the daily debt limit.
Conclusion
LGTM