There is no slippage when swapping bean for SOP token
In the sopWell function, we are swapping bean for a SOP token which will be distributed to the stalkholders during a season of plenty (flood). The problem arises because there is no slippage control when we swap beans for the SOP token.
here is the interface for IWell
as we can see from the snippet above we have set the slippage parameter to 0, this will allow the swap to be sandwiched by a malicious user. Additionally the deadline has been set to uint256 max, this furthers the problem and makes it easier for a sandwich attack to happen/ swapping at an unfavorable price if the transaction pending for a long time and the slippage setting is outdated.
Because the swapped funds or SOP tokens go directly to stalkholders, the lack of slippage in this critical function will cuase the amount of SOP token that is paid out to the stalkholders to be alot lower than it should, and it some cases almost 0. Loss of funds
manual review
Allow for slippage to be set and do not have such a long deadline to ensure we are swapping beans for SOP tokens at the optimal price.
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.