Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EBIP-0: Emergency BIP-0 #80

Merged
merged 3 commits into from Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions bips/ebip-0.md
@@ -0,0 +1,33 @@
# EBIP-0: Emergency BIP-0

## Submitter

Beanstalk Community Multisig

## Emergency Process Note

Per the process outlined in the [BCM Emergency Response Procedures](https://docs.bean.money/governance/beanstalk/bcm-process#emergency-response-procedures), an emergency hotfix may be implemented by an emergency vote of the BCM if the bug is minor and does not require significant code changes.

Note: Bugs or security vulnerabilities qualify as emergencies. Emergency action will not be taken for any reason related to the economic health of Beanstalk (like a bank run, for example).

## Links

* GitHub PR: https://github.com/BeanstalkFarms/Beanstalk/pull/80
* GitHub Commit Hash: fa8612e3698d932004f45cd3260c5ad71893b006
* Gnosis Transaction: https://etherscan.io/tx/0x7949bdea1864aa66712bac3d57b79f3030c4cafbb91cdca3d56a0921e1496402

## Issue

If a Farmer performs an action that removed all of their assets from the Silo, all their Earned Beans were forfeited.

## Fix

If a Farmer performs an action that removes all of their assets from the Silo, their Earned Beans remain constant.

## Magnitude

It is estimated that approximately 1717 Beans across 32 accounts have been forfeited so far. Forfeited Earned Beans were redistributed across remaining Stalkholders.

## Effective

Immediately upon commit by the BCM, which has already happened.
5 changes: 2 additions & 3 deletions protocol/contracts/libraries/Silo/LibSilo.sol
Expand Up @@ -91,9 +91,8 @@ library LibSilo {
AppStorage storage s = LibAppStorage.diamondStorage();
if (stalk == 0) return;

uint256 roots = stalk == s.a[account].s.stalk
? s.a[account].roots
: s.s.roots.mul(stalk).div(s.s.stalk);
uint256 roots = s.s.roots.mul(stalk).div(s.s.stalk);
if (roots > s.a[account].roots) roots = s.a[account].roots;

s.s.stalk = s.s.stalk.sub(stalk);
s.a[account].s.stalk = s.a[account].s.stalk.sub(stalk);
Expand Down