The _freeFunds()
function in @src/StrategyMainnet.sol (the same for all strategies) incorrectly handles cases where the requested withdrawal amount exceeds the available unexchanged balance, forcing Withdrawers to take losses when they could be avoided. This violates the specs outlined in the Yearn V3 specifications.
When a user requests to withdraw an amount larger than what's currently unexchanged in the transmuter, the function simply withdraws whatever is available (totalAvailable
) and returns. The difference between the requested amount and what was actually withdrawn (_amount - totalAvailable
) is counted as a loss and passed on to the withdrawer.
However, the strategy has additional ways to free funds that aren't being utilized:
The strategy can claim WETH from the transmuter via transmuter.claim()
The claimed WETH can be swapped back to alETH using the Curve router
By not attempting these additional steps before forcing a loss, the strategy unnecessarily penalizes users during withdrawals. This is particularly problematic because:
The strategy lacks an _emergencyWithdraw()
function, leaving users no alternative withdrawal path
The Yearn V3 specifications explicitly recommend reverting in illiquidity scenarios rather than forcing losses
Alice deposits 100 alETH into the strategy
The strategy deposits these into the transmuter, converting them to WETH over time
After some time:
30 alETH remains unexchanged
70 WETH is claimable from the transmuter
Alice attempts to withdraw 100 alETH
_freeFunds()
only withdraws 30 alETH from unexchanged balance
The remaining 70 alETH is counted as a loss to Alice
Meanwhile, 70 WETH remains claimable in the transmuter that could have been claimed and swapped back to alETH
Either:
1 Revert when there are insufficient unexchanged funds:
2 Or implement the full withdrawal path using claiming and swaping funds from transmutter
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.