Submitted by Ruhum
YearnTokenAdapter.sol#L13
YearnTokenAdapter.sol#L43
YearnTokenAdapter allows slippage of 100% when withdrawing from the vault which will cause a loss of funds.
Heres the documentation straight from the vault contract: https://github.com/yearn/yearn-vaults/blob/main/contracts/Vault.vy#L1025-L1073
It allows the user to specify the maxLoss as the last parameter. It determines how many shares can be burned to fulfill the withdrawal. Currently, the contract uses 10.000 which is 100%. Meaning there is no slippage check at all. This is bound to cause a loss of funds.
Id suggest letting the user determine the slippage check themselves instead of hardcoding it.
Current maxLoss value: https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/adapters/yearn/YearnTokenAdapter.sol#L13
call to Yearn vaults withdraw() function: https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/adapters/yearn/YearnTokenAdapter.sol#L43
Allow the user to specify the slippage value themselves:
If you dont want to change the ITokenAdapter interface you can also leave the value blank. The vault will then use the default value (0.01%)
0xfoobar (Alchemix) acknowledged, disagreed with severity and commented:
0xleastwood (judge) decreased severity to Medium and commented:
