mintFertilizer
allows users to purchase Fertilizer specifying a minimum amount of Fertilizer they expect to receive.
minLPAmountOut
.
However, despite the initial security check in the well for minLPAmountOut
below...
By the time we arrive at addUnderlying
, the timestamp is set to the maximum value, leaving the user's transaction hanging.
POC:
A user submits a tx to mintFertilizer
but with a low gas fee.
The same user specified a slippage tolerance of 1% in the minLPTokensOut
parameter.
The price in the well increases drastically, leading to increased slippage.
Now, the slippage has increased to 50%.
The user's tx is eventually included in the block.timestamp
, but the user now gets a worse execution price.
The user will receive a lower amount of Fertilizer than expected due to the increased slippage, causing
a revert. This will lead to a loss of prospective accumulated fertilizer tokens. Also considering the amount of Fertilizer issued to a buyer is determined by the oracle, if any expected price deviations occur as well, the user will receive a lower amount of Fertilizer than expected.
Manual Review
As in the IWell interface, AND Uniswap models, the timestamp should be set by the user.
function mintFertilizer(uint256 tokenAmountIn, uint256 minFertilizerOut, uint256 minLPTokensOut, uint256 deadline)
Pass in a user defined timestamp to the mintFertilizer
function, and use this timestamp in the
addLiquidity function call in addUnderlying
.
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.