Report ID
#31664
Report type
Smart Contract
Has PoC?
Yes
Target
https://etherscan.io/address/0xC1E088fC1323b20BCBee9bd1B9fC9546db5624C5
Impacts
Wrong Contract Implimentation Logic
Description
Wrong logic Implementation not accounting for inlationary measures and controls.
Vulnerability Details
When beanstalk price falls below peg, the bean in circulation is increased (scaled up) leading to more minting of bean and supply of more bean in circulation. And then when the bean price is above peg, the soil is scaled down reducing the bean in circulation.
This should be the other way round -When beanstalk price falls below peg, the bean in circulation should be reduced by creating a credit facility and burning circulating beans in
order to gain more value and strength against it peg.
And then when the bean price is above peg, the soil should be scaled up to enable more minting of bean and create more bean in circulation.
In essence, the logic should have been accounted for using inflationary measures, design and controls.
Impact Details
This would have an effect on the soil scalling and leading to wrong calculations
References
https://github.com/Cyfrin/2024-04-beanstalk-2/blob/27ff8c87c9164c1fbff054be5f22e56f86cdf127/protocol/contracts/beanstalk/field/FieldFacet.sol#L320-L332
Proof of concept