Contract fails to deliver promised returns, but doesn't lose value
Description
Brief/Intro
The _allocate(...) function of TokeAutoETh.sol hardcodes zero as the minSharesOut leaves the deposit without slippage protection and ready to take 0 as the output shares for deposit.
Vulnerability Details
The _allocate functon calls router.depositMax but hardcodes zero as the minSharesOut.
File: TokeAutoEth.sol// @dev Implementation can alternatively make use of a multicall// Deposit weth into the autoEth vault, stake the shares in the rewarderfunction_allocate(uint256amount)internaloverridereturns(uint256){require(TokenUtils.safeBalanceOf(address(weth),address(this))>= amount,"Strategy balance is less than amount"); TokenUtils.safeApprove(address(weth),address(router), amount);uint256 shares = router.depositMax(autoEth,address(this),0);//@audit zero slippage.minShares. TokenUtils.safeApprove(address(autoEth),address(rewarder), shares); rewarder.stake(address(this), shares);return amount;}
Impact Details
No slippage protection as minSharesOut is hardcoded to zero allowing deposit take any exchange rate.
Recommendation
Consider passsing a `minSharesOUt instead of hardcoding zero.
Proof of Concept
Proof of Concept
Create a file named POC.t.sol in the directory src/test/strategies/POC.t.sol
Run forge test --match-test test_Zeroslippage -vvv