Two internal vault operation functions in the protocol update state variables after making external calls, which deviates from the best practice Checks-Effects-Interactions pattern. While these are internal functions with limited exposure, maintaining consistent patterns across the codebase is important for code quality and maintainability.
The core issue lies in the sequencing of operations within both internal vault functions. The _withdrawFromVault function performs the withdrawal operation before decreasing totalVaultDeposits, while _depositIntoVault executes the approve and deposit calls before increasing totalVaultDeposits. This ordering deviates from the Checks-Effects-Interactions pattern.
Since these are internal functions, they can only be called by other functions within the contract, limiting the potential impact. The functions _ensureLiquidity and _rebalanceLiquidity use these vault operation functions as part of their implementation.
Manual Review
While the impact is limited due to the internal nature of these functions, it's recommended to follow the Checks-Effects-Interactions pattern for consistency:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.