Contract fails to deliver promised returns, but doesn't lose value
Description
Brief/Intro
The MorphoYearnOGWETHStrategy::_deallocate() function incorrectly checks WETH balances before and after the withdrawal operation, causing the StrategyDeallocationLoss event to always be emitted with actualAmountSent as 0, even when no actual loss occurs.
Vulnerability Details
The issue exists in the MorphoYearnOGWETHStrategy::_deallocate() function. The function calls vault.withdraw() before capturing the balance measurements, resulting in incorrect loss calculations:
The correct implementation should capture wethBalanceBefore prior to the withdrawal operation and wethBalanceAfter following it. Currently, both balance checks occur after the withdrawal, resulting in wethBalanceBefore and wethBalanceAfter being identical values. This makes wethRedeemed = wethBalanceAfter - wethBalanceBefore = 0, which will always be less than the requested amount (assuming amount > 0).
Impact Details
The StrategyDeallocationLoss event is incorrectly emitted on every deallocation operation, regardless of whether an actual loss occurred. .