code-423n4 / 2024-04-revert-mitigation-findings

1 stars 1 forks source link

M-08 MitigationConfirmed #30

Open c4-bot-4 opened 4 months ago

c4-bot-4 commented 4 months ago

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 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

Conclusion

Mitigation Confirmed

c4-judge commented 4 months ago

jhsagd76 marked the issue as satisfactory