DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: medium
Invalid

[H] Hardcoded minAmountOut results in loss of funds for stakeholders

Summary

A well is an ERC20 liquidity position (similar to the Uniswap V2 Token implementation) deriving from IWell.
This is designed to be called from the Gm function flow and during the SOP process, only when the price of bean is
high and the debt of Beanstalk is low. When this happens, Beanstalk takes action and sells Beans into the pool.
This is where stakeholders can claim a pro rata share of the amount of sopToken(WETH) gained.

Vulnerability Details

However, the hardcoded minAmountOut value assigned to 0 in the swapFrom function, doesn't specify a minimum
amount of sopTokens(WETH) to be received in exchange for the Beans. This configuration eliminates any
safeguard against slippage, exposing the stakeholders to unfavorable exchange rates
during the swap from BEANs to WETH. In volatile market conditions, the lack of a minimum acceptable amount
of WETH to be received means that the swap could proceed even if the resultant exchange rate
significantly undervalues the BEANs. Reclaiming the excess WETH is not possible currently, as there is no way
to withdraw and redistribute the remaining WETH to the stakeholders.

Impact

The impact of this vulnerability can be substantial, leading to a direct loss of funds for stakeholders.
Specifically, stakeholders are positioned to receive less WETH than they might under more favorable or
controlled swap conditions.

Tools Used

Manual Review

Recommendations

Considering sopTokens are being distributed to stakeholders, it's crucial to implement a minAmountOut value
perhaps defined by the users at a time when the price of Bean is above a certain value and the debt of Beanstalk is low.
at a certain point.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

SOP swap slippage

golanger85 Submitter
about 1 year ago
0xtheblackpanther Auditor
about 1 year ago
giovannidisiena Lead Judge
about 1 year ago
giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

SOP swap slippage

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.