V3Vault.sol implements a daily limit on loan and deposit amounts that resets every 24 hours. Problem was the vault reset the limits in such a way that the increase of the limit applied on repay and withdraw was nullified if it happened before a reset
Mitigation
PR-11 successfully mitigates the original issue by adding debt/loan limit reset as the first step inside _repay & _withdraw. This way the additional increase on the limit is applied after the global reset and prevents it from getting nullified.
Additionally the liquidate function was updated to also increase the debt limit similar to repay
Lines of code
Vulnerability details
C4 Issue
M-08: DailyLendIncreaseLimitLeft and dailyDebtIncreaseLimitLeft are not adjusted accurately
Issue Details
V3Vault.sol
implements a daily limit on loan and deposit amounts that resets every 24 hours. Problem was the vault reset the limits in such a way that the increase of the limit applied onrepay
andwithdraw
was nullified if it happened before a resetMitigation
PR-11 successfully mitigates the original issue by adding debt/loan limit reset as the first step inside
_repay
&_withdraw
. This way the additional increase on the limit is applied after the global reset and prevents it from getting nullified.Additionally the
liquidate
function was updated to also increase the debt limit similar torepay
Conclusion
Mitigation Confirmed