https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/StakingLPEth.sol#L88-L100
The current implementation of unstake() requires users to first call either cooldownAssets or cooldownShares to initiate a cooldown period before they can withdraw their assets, adding an unnecessary step to the withdrawal process when the cooldownDuration is 0. This design forces users to interact with the contract twiceonce to start the cooldown and again to actually withdraw their assetswhich increases transaction costs and complexity for the user.
Thats to say, the unstake function allows withdrawals only after the cooldown period has passed or if cooldownDuration is set to 0, as shown in the provided code snippet. However, this process can be streamlined by integrating the cooldown initiation directly into the unstake function itself, eliminating the need for separate cooldown function calls.
QA, design improvement. However, the existing process of initiating a cooldown through cooldownAssets or cooldownShares and then calling unstake adds unnecessary steps for users when the duration gets set to 0.
Consider modifying the unstake function to automatically initiate the cooldown if the cooldown duration is 0
