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-9: Temporarily Disable the Well Minting Oracle
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
The first stage of the BIP-38 migration process is complete. The final stage of the process is to add the BEAN and ETH in the Beanstalk Community Multisig (BCM) as liquidity in the BEANETH Well.
However, given (1) time-weighted average reserves in the Multi Flow Pump are used by Beanstalk for minting, (2) the 0.1% cap on changes in the TWA Multi Flow Pump reserves each block and (3) the extreme % increase in the Well reserves as a result of the addition of liquidity, it will take about a substantial amount of time after the addition of liquidity for the TWA Multi Flow Pump reserves to catch up to the current Well reserves. This is exaggerated if the ETH price moves up some % during the catch up period.
The reserves in the BEANETH Well are expected to increase by ~7700% as a result of adding the liquidity. Increasing at 0.1% a block, it would take 4345.98 blocks for the TWA Multi Flow Pump reserves to catch up to the current Well reserves. This is ~14.4866 hours.
Solution
Turn off minting in the BEANETH Well until Season 16665 (about 20 Seasons after the transaction was committed, in order to substantially overestimate the calculation of ~14.4866 hours) by adding a check in
LibWellMinting.initializeOracle
.All changes were reviewed by Cyfrin.
Contract Changes
Initialization Contract
The
init
function on the followingInitTurnOffBeanEthWell
contract is called:0xc42B40bb807bCCb5eae2d0279926E2c4aAbFE6cb
Season Facet
The following
SeasonFacet
is removed from Beanstalk:0x17b31771a04af17b131246c3c9d442e3c3908a27
The following
SeasonFacet
is added to Beanstalk:0x49435d19a5dcf8Ffe8a4EA5C310758784D3F4561
SeasonFacet
Function ChangesabovePeg
0x2a27c499
curveOracle
0x07a3b202
paused
0x5c975abb
plentyPerRoot
0xe60d7a83
poolDeltaB
0x471bcdbe
rain
0x43def26e
season
0xc50b0fb0
seasonTime
0xca7b7d7b
sunriseBlock
0x3b2ecb70
time
0x16ada547
totalDeltaB
0x06c499d8
weather
0x686b6159
wellOracleSnapshot
0x597490c0
gm
0x64ee4b80
sunrise
0xfc06d2a6
Event Changes
None.
Beans Minted
None.
Effective
Effective immediately upon commitment by the BCM, which has already happened.