Submitted by FastChecker, also found by DanielArmstrong
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L807-L949 
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L807-L883 
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L807-L1249
When the V3Vault.sol#_withdraw and V3Vault.sol#_repay functions are called, dailyLendIncreaseLimitLeft and dailyDebtIncreaseLimitLeft are increased. However, if it is called before _withdraw and _repay are called, this increase becomes meaningless.
Even if the V3Vault.sol#_withdraw and V3Vault.sol#_repay functions are called, dailyLendIncreaseLimitLeft and dailyDebtIncreaseLimitLeft do not increase, so the protocol does not work as intended.
V3Vault.sol#_withdraw is as follows:
As you can see, increase dailylendIncreaselimitLeft by the asset amount in L949. However, V3Vault.sol#_deposit is as follows:
As you can see on the right, the dailyLendIncreaseLimitLeft function is called in L883.
V3Vault.sol#_resetDailyLendIncreaseLimit is as follows:
Looking at the function above, the increase of dailyLendIncreaseLimitLeft in the withdraw performed before depositing when a new day begins is not reflected in the dailyLendIncreaseLimitleft control by L1249. That is, the increase will not be reflected in the dailyLendIncreaseLimitLeft control. The same problem exists in the repay and borrow functions.
VeVault.sol#_withdraw function is modified as follows:
VeVault.sol#_repay function is modified as follows:
kalinbas (Revert) confirmed
Revert mitigated:
Status: Mitigation confirmed. Full details in reports from thank_you, b0g0 and ktg.
