Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EBIP-10: Fix Bean to LP Well Convert
Submitter
Beanstalk Community Multisig
Emergency Process Note
Per the process outlined in the BCM Emergency Response Procedures, the BCM can take swift action to protect Beanstalk in the event of a bug or security vulnerability.
Links
Problem
Since BIP-38 was committed and prior to this EBIP, in Wells (i.e., only BEANETH currently), Farmers could Convert Deposited Beans to Deposited LP tokens past peg. Additionally, If a Farmer had enough Deposited Beans to Convert past peg, it was possible for that Farmer to Convert Deposited Beans to Deposited LP tokens up to the total amount of Beans in the Beanstalk contract.
This was because Beanstalk was Converting (1) the amount the user input, rather than (2) the minimum of the amount the user input and the amount required to Convert to peg.
Solution
Upgrade Beanstalk to only allow Converts up to (2).
All changes were reviewed by Cyfrin.
Contract Changes
Convert Facet
The following
ConvertFacet
is removed from Beanstalk:0xDc6B4ef6bA55706B19Bd389eA446d232eFb4E5D4
The following
ConvertFacet
is added to Beanstalk:0x08342a9e47d9a48f6a94823344fafd24fb55266f
ConvertFacet
Function Changesconvert
0xb362a6e8
Event Changes
None.
Beans Minted
None.
Effective
Effective immediately upon commitment by the BCM, which has already happened.