FIP-5 Update Bonding Curve Allocation#98
Merged
Joeysantoro merged 9 commits intomasterfrom May 19, 2021
Merged
Conversation
Add PCV adapter contracts
|
Looks good to me! |
Bobface
approved these changes
May 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR mitigates manipulation on the ETH-FEI pair before calling the
deposit()function on the EthUniswapPCVDeposit. It adds slippage protection so new deposits can only occur when FEI is trading within a specified percent from the peg. The percent will be set to 1% in the DAO vote.As part of the fix, we will update the bonding curve so it sends new ETH to the EthReserveStabilizer via the dripper rather than depositing to Uniswap. This removes the attack vector as a malicious actor can no longer deposit arbitrarily large amounts of ETH through the protocol.
This code was reviewed by OpenZeppelin as a part of the issue disclosed here: https://medium.com/fei-protocol/fei-bonding-curve-bug-post-mortem-98d2c6f271e9
Contract Changes
EthUniswapPCVDeposit - 0x5d6446880FCD004c851EA8920a628c70Ca101117
maxBasisPointsFromPegLPbasis points from the oracle price.maxBasisPointsFromPegLPis settable by governanceEthPCVDepositAdapter - 0x4c52aD4Ad171a58B57592893c37Cc81655e11611 (pointing to new EthUniswapPCVDeposit) and 0xB72dDeD4Fa321e093E2083B596404A56ffC5b574 (pointing to EthPCVDripper)
RatioPCVController - 0xfC1aD6eb84351597cD3b9B65179633697d65B920
DAO Proposal Steps
target: 0xe1578B4a32Eaefcd563a9E6d0dc02a4213f673B7
method: setAllocation
pcvDeposits: [0xB72dDeD4Fa321e093E2083B596404A56ffC5b574]
ratios: [10000]
target: 0x8d5ED43dCa8C2F7dFB20CF7b53CC7E593635d7b9
method: grantPCVController
pcvController: 0xfC1aD6eb84351597cD3b9B65179633697d65B920
target: 0x8d5ED43dCa8C2F7dFB20CF7b53CC7E593635d7b9
method: grantMinter
minter: 0x5d6446880FCD004c851EA8920a628c70Ca101117
target: 0x8d5ED43dCa8C2F7dFB20CF7b53CC7E593635d7b9
method: revokeMinter
minter: 0x9b0C6299D08fe823f2C0598d97A1141507e4ad86
target: 0x9b0C6299D08fe823f2C0598d97A1141507e4ad86
method: unpause
target: 0xfC1aD6eb84351597cD3b9B65179633697d65B920
method: withdrawRatio
from: 0x9b0C6299D08fe823f2C0598d97A1141507e4ad86
to: 0x4c52aD4Ad171a58B57592893c37Cc81655e11611
amount: 10000
target: 0x5d6446880FCD004c851EA8920a628c70Ca101117
method: setMaxBasisPointsFromPegLP
amount: 100