DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: medium
Invalid

The `WellPrice` contract uses an incorrect address for `BEANSTALK`.

Github link

https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/9c7b9fd521ad7cbe65cc788df181887c0eb39c6d/protocol/contracts/ecosystem/price/WellPrice.sol#L27

https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/9c7b9fd521ad7cbe65cc788df181887c0eb39c6d/protocol/contracts/ecosystem/price/WellPrice.sol#L76

Summary

The WellPrice contract uses an incorrect address for BEANSTALK.

Vulnerability Details

The WellPrice contract has a constant address of BEANSTALK but it won't be valid for L2 because this address is for Eth mainnet.

contract WellPrice {
using LibRedundantMath256 for uint256;
using SafeCast for uint256;
IBeanstalk private constant BEANSTALK = IBeanstalk(0xC1E088fC1323b20BCBee9bd1B9fC9546db5624C5);

So getConstantProductWell() wouldn't calculate bdv properly.

As a result, BeanstalkPrice.price() might return incorrect beanstalk prices.

Impact

Beanstalk prices wouldn't be calculated properly.

Tools Used

Manual Review

Recommendations

We should use a proper BEANSTALK address for L2.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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