-
Notifications
You must be signed in to change notification settings - Fork 95
FIP-92: Vote-locking BAL #634
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
905d6d1
Add VeBalDelegatorPCVDeposit
eswak 3c1d9d0
Rename GaugeLens to AngleGaugeLens
eswak e11719b
Add CurveGaugeLens (= previous GaugeLens)
eswak 3d5afa9
Finish fixing references to GaugeLens
eswak da40379
Remove .only on e2e-fip-38-tokemak (wtf?)
eswak a51761e
Make constants public in VeBalDelegator
eswak eef820e
Refactor LiquidityGaugeManager to use Curve standard by default
eswak 894b310
Add FIP-92 script (WIP)
eswak 5d5d328
Finalize FIP-92
eswak a809d8a
Skip outdated WeightedPool e2e test
eswak e34b1da
Merge remote-tracking branch 'origin/develop' into feat/vebal
eswak 8a79aeb
Add comment on FIP-92 setup() step
eswak f904298
Rename OZGovernorVoter & add Gov Bravo capabilities
eswak 9362138
Merge origin/develop & fix proposals_config.ts conflicts
eswak 5dec2b8
deployed fip-92 to mainnet
eswak 4be0e23
Update dependencies
eswak 336c6c0
Merge remote-tracking branch 'origin/develop' into feat/vebal
eswak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import "./SnapshotDelegatorPCVDeposit.sol"; | ||
| import "./utils/VoteEscrowTokenManager.sol"; | ||
| import "./utils/LiquidityGaugeManager.sol"; | ||
| import "./utils/GovernorVoter.sol"; | ||
|
|
||
| /// @title 80-BAL-20-WETH BPT PCV Deposit | ||
| /// @author Fei Protocol | ||
| contract VeBalDelegatorPCVDeposit is | ||
| SnapshotDelegatorPCVDeposit, | ||
| VoteEscrowTokenManager, | ||
| LiquidityGaugeManager, | ||
| GovernorVoter | ||
| { | ||
| address public constant B_80BAL_20WETH = | ||
| 0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56; | ||
| address public constant VE_BAL = 0xC128a9954e6c874eA3d62ce62B468bA073093F25; | ||
| address public constant BALANCER_GAUGE_CONTROLLER = | ||
| 0xC128468b7Ce63eA702C1f104D55A2566b13D3ABD; | ||
|
|
||
| /// @notice veBAL token manager | ||
| /// @param _core Fei Core for reference | ||
| /// @param _initialDelegate initial delegate for snapshot votes | ||
| constructor(address _core, address _initialDelegate) | ||
| SnapshotDelegatorPCVDeposit( | ||
| _core, | ||
| IERC20(B_80BAL_20WETH), // token used in reporting | ||
| "balancer.eth", // initial snapshot spaceId | ||
| _initialDelegate | ||
| ) | ||
| VoteEscrowTokenManager( | ||
| IERC20(B_80BAL_20WETH), // liquid token | ||
| IVeToken(VE_BAL), // vote-escrowed token | ||
| 365 * 86400 // vote-escrow time = 1 year | ||
eswak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| LiquidityGaugeManager(BALANCER_GAUGE_CONTROLLER) | ||
| GovernorVoter() | ||
| {} | ||
|
|
||
| /// @notice returns total balance of PCV in the Deposit | ||
| function balance() public view override returns (uint256) { | ||
| return _totalTokensManaged(); // liquid and vote-escrowed tokens | ||
| } | ||
| } | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
| pragma solidity ^0.8.4; | ||
|
|
||
| import "./MockCoreRef.sol"; | ||
| import "../metagov/utils/GovernorVoter.sol"; | ||
|
|
||
| contract MockGovernorVoter is GovernorVoter, MockCoreRef { | ||
| constructor(address core) MockCoreRef(core) GovernorVoter() {} | ||
| } |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
| pragma solidity ^0.8.10; | ||
|
|
||
| import "../../metagov/utils/LiquidityGaugeManager.sol"; | ||
| import "../IPCVDepositBalances.sol"; | ||
|
|
||
| /// @title AngleGaugeLens | ||
| /// @author Fei Protocol | ||
| /// @notice a contract to read tokens held in a gauge. | ||
| /// Angle has a small modification in their Curve fork : they name a | ||
| /// variable staking_token() instead of lp_token() as in the original Curve code. | ||
| contract AngleGaugeLens is IPCVDepositBalances { | ||
| /// @notice FEI token address | ||
| address private constant FEI = 0x956F47F50A910163D8BF957Cf5846D573E7f87CA; | ||
|
|
||
| /// @notice the gauge inspected | ||
| address public immutable gaugeAddress; | ||
|
|
||
| /// @notice the address of the contract staking in the gauge | ||
| address public immutable stakerAddress; | ||
|
|
||
| /// @notice the token the lens reports balances in | ||
| address public immutable override balanceReportedIn; | ||
|
|
||
| constructor(address _gaugeAddress, address _stakerAddress) { | ||
| gaugeAddress = _gaugeAddress; | ||
| stakerAddress = _stakerAddress; | ||
| balanceReportedIn = ILiquidityGauge(_gaugeAddress).staking_token(); | ||
| } | ||
|
|
||
| /// @notice returns the amount of tokens staked by stakerAddress in | ||
| /// the gauge gaugeAddress. | ||
| function balance() public view override returns (uint256) { | ||
| return ILiquidityGauge(gaugeAddress).balanceOf(stakerAddress); | ||
| } | ||
|
|
||
| /// @notice returns the amount of tokens staked by stakerAddress in | ||
| /// the gauge gaugeAddress. | ||
| /// In the case where an LP token between XYZ and FEI is staked in | ||
| /// the gauge, this lens reports the amount of LP tokens staked, not the | ||
| /// underlying amounts of XYZ and FEI tokens held within the LP tokens. | ||
| /// This lens can be coupled with another lens in order to compute the | ||
| /// underlying amounts of FEI and XYZ held inside the LP tokens. | ||
| function resistantBalanceAndFei() | ||
| public | ||
| view | ||
| override | ||
| returns (uint256, uint256) | ||
| { | ||
| uint256 stakedBalance = balance(); | ||
| if (balanceReportedIn == FEI) { | ||
| return (stakedBalance, stakedBalance); | ||
| } else { | ||
| return (stakedBalance, 0); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this include governor bravo compatibility? Vote escrow is a hard action to undo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add OZGovernor capability (that have a contract ready & tested), but when I asked Kia he said that Balancer does everything with snapshot + multisigs, no governor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you follow up and make sure they have no intentions of putting anything on-chain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
including for example a nope-dao?