In the new version of Beanstalk, one of the changed contracts is LibFlood.sol.
The contract handles the logic for managing the flooding mechanism in Beanstalk. One of the main functions is handleRain()
, which manages the state of the Beanstalk protocol when it becomes "oversaturated".
The problem is that the function at the end calls sopWell()
, which has no slippage protection.
handleRain()
function call sopWell()
:
The sopWell
function manages the minting and swapping of Beans during a Season of Plenty, which is triggered when Beanstalk is oversaturated.
We can see how the function calls swapFrom()
to swap beans for the non-bean token.
But the parameter that is passed for minAmountOut
is 0. This means that the function has no slippage protection.
Without slippage, If the price of the tokens changes significantly during the swap, it could result in a large slippage, causing users to lose a significant amount of funds.
Visual Studio Code
Add slippage protection in the sopWell()
function.
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.