Submitted by 0xsanson
In the NativeStrategyCurve3Crv._harvest there are two instances that a bad actor could use to frontrun the harvest.
First, when we are swapping WETH to a stablecoin by calling _swapTokens(weth, _stableCoin, _remainingWeth, 1) the function isnt checking the slippage, leading to the risk to a frontun (by imbalancing the Uniswap pair) and losing part of the harvesting profits.
Second, during the _addLiquidity internal function: this calls stableSwap3Pool.add_liquidity(amounts, 1) not considering the slippage when minting the 3CRV tokens.
NativeStrategyCurve3Crv.sol L108
editor
In the function _harvest(_estimatedWETH, _estimatedYAXIS) consider adding two additional estimated quantities: one for the swapped-out stablecoin and one for the minted 3CRV.
BobbyYaxis (yAxis) acknowledged
uN2RVw5q commented:
GalloDaSballo (judge) commented:
BobbyYaxis (yAxis) noted:
