-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from moonwell-fi/feat/mip-b26
Safety Module Activation
- Loading branch information
Showing
9 changed files
with
229 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,49 @@ | ||
# MIP-B16 Base Safety Module Activation Resubmission | ||
|
||
**Authors**: Elliot, Ana | ||
|
||
## Simple Summary | ||
|
||
The original proposal was approved but contained an error that prevented | ||
successful execution on Moonbeam. This issue has been corrected in this | ||
resubmission. If this proposal passes, the community can expect to have rewards | ||
enabled for the Safety Module on Base on Thursday. | ||
|
||
## Summary | ||
|
||
This proposal aims to activate reward emissions for the new Safety Module on | ||
Base, incentivizing users to help secure the Moonwell protocol through staking | ||
and participate in onchain governance. | ||
|
||
## Overview | ||
|
||
The Moonwell community has recently approved the implementation of a new | ||
multichain governor contract to govern the Moonwell protocol. Additionally, a | ||
new Base native WELL token utilizing the xERC20 token standard has been approved | ||
for usage, which is a significant milestone for the community. By adopting this | ||
new Base native WELL token, tokenholders will soon be able to stake their WELL | ||
directly on Base and vote in onchain governance. A new Safety Module has already | ||
been deployed on Base and is registered in the Multichain Vote Collection | ||
contract as a source of voting power, allowing users securing the protocol to | ||
participate in governance. Initially, rewards were set to 0 on the new Safety | ||
Module on Base. This proposal aims to enable rewards for users in the Safety | ||
Module with the new Base native WELL token. | ||
|
||
## Implementation | ||
|
||
This proposal will set and fund rewards that will be distributed to all Safety | ||
Module stakers on Base. Initial reward speeds will be set to the value | ||
recommended by emissions admin Warden Finance of 0.8962755116489610000 WELL per | ||
second. **Voting** | ||
|
||
A "Yay" vote indicates your support for enabling reward emissions for the Safety | ||
Module on Base, as outlined in this proposal. A "Nay" vote indicates your | ||
opposition to enabling reward emissions for the Safety Module on Base. | ||
|
||
## Conclusion | ||
|
||
Adding rewards to the Safety Module on Base creates incentives for users to | ||
backstop the protocol with the new Base native WELL token. Staking WELL in the | ||
Safety Module not only gives community members the ability to earn native yield | ||
on their holdings, but also presents an easy way to get involved in governance | ||
as WELL is automatically self delegated. |
This file contains 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,123 @@ | ||
//SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity 0.8.19; | ||
|
||
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
import "@forge-std/Test.sol"; | ||
|
||
import {Addresses} from "@proposals/Addresses.sol"; | ||
import {IStakedWell} from "@protocol/IStakedWell.sol"; | ||
import {HybridProposal} from "@proposals/proposalTypes/HybridProposal.sol"; | ||
import {ParameterValidation} from "@proposals/utils/ParameterValidation.sol"; | ||
import {MultichainGovernorDeploy} from "@protocol/governance/multichain/MultichainGovernorDeploy.sol"; | ||
|
||
/// DO_VALIDATE=true DO_PRINT=true DO_BUILD=true DO_RUN=true forge script | ||
/// src/proposals/mips/mip-b16/mip-b16.sol:mipb16 | ||
contract mipb16 is | ||
HybridProposal, | ||
MultichainGovernorDeploy, | ||
ParameterValidation | ||
{ | ||
string public constant name = "MIP-B16 Resubmission"; | ||
|
||
/// @notice this is based on Warden Finance's recommendation for reward speeds | ||
uint256 public constant REWARD_SPEED = 896275511648961000; | ||
|
||
/// @notice the amount of WELL to be sent to the Safety Module for funding 38 days of rewards | ||
/// 36*86400*.896275511648961000 = 2,787,775.3514329283 WELL, round up to 2,787,776 | ||
uint256 public constant WELL_AMOUNT = 2_787_776 * 1e18; | ||
|
||
constructor() { | ||
bytes memory proposalDescription = abi.encodePacked( | ||
vm.readFile("./src/proposals/mips/mip-b16/MIP-B16.md") | ||
); | ||
|
||
_setProposalDescription(proposalDescription); | ||
} | ||
|
||
/// @notice proposal's actions happen only on base | ||
function primaryForkId() public view override returns (uint256) { | ||
return baseForkId; | ||
} | ||
|
||
function teardown(Addresses addresses, address) public override {} | ||
|
||
/// run this action through the Multichain Governor | ||
function build(Addresses addresses) public override { | ||
/// Base actions | ||
|
||
_pushHybridAction( | ||
addresses.getAddress("xWELL_PROXY"), | ||
abi.encodeWithSignature( | ||
"transferFrom(address,address,uint256)", | ||
addresses.getAddress("FOUNDATION_MULTISIG"), | ||
addresses.getAddress("ECOSYSTEM_RESERVE_PROXY"), | ||
WELL_AMOUNT | ||
), | ||
"Transfer xWELL rewards to Ecosystem Reserve Proxy on Base", | ||
false | ||
); | ||
|
||
_pushHybridAction( | ||
addresses.getAddress("stkWELL_PROXY"), | ||
abi.encodeWithSignature( | ||
"configureAsset(uint128,address)", | ||
REWARD_SPEED, | ||
addresses.getAddress("stkWELL_PROXY") | ||
), | ||
"Set reward speed for the Safety Module on Base", | ||
false | ||
); | ||
} | ||
|
||
function run(Addresses addresses, address) public override { | ||
/// safety check to ensure no moonbeam actions are run | ||
require( | ||
baseActions.length == 2, | ||
"MIP-B16: should have two base actions" | ||
); | ||
|
||
require( | ||
moonbeamActions.length == 0, | ||
"MIP-B16: should have no moonbeam actions" | ||
); | ||
vm.selectFork(moonbeamForkId); | ||
|
||
_runMoonbeamMultichainGovernor(addresses, address(1000000000)); | ||
|
||
vm.selectFork(baseForkId); | ||
|
||
_runBase(addresses, addresses.getAddress("TEMPORAL_GOVERNOR")); | ||
} | ||
|
||
/// @notice validations on Base | ||
function validate(Addresses addresses, address) public override { | ||
vm.selectFork(baseForkId); | ||
|
||
address stkWellProxy = addresses.getAddress("stkWELL_PROXY"); | ||
( | ||
uint128 emissionsPerSecond, | ||
uint128 lastUpdateTimestamp, | ||
|
||
) = IStakedWell(stkWellProxy).assets(stkWellProxy); | ||
|
||
assertEq( | ||
emissionsPerSecond, | ||
REWARD_SPEED, | ||
"MIP-B16: emissionsPerSecond incorrect" | ||
); | ||
|
||
assertGt( | ||
lastUpdateTimestamp, | ||
0, | ||
"MIP-B16: lastUpdateTimestamp not set" | ||
); | ||
assertEq( | ||
ERC20(addresses.getAddress("xWELL_PROXY")).balanceOf( | ||
addresses.getAddress("ECOSYSTEM_RESERVE_PROXY") | ||
), | ||
WELL_AMOUNT, | ||
"MIP-B16: ecosystem reserve not funded" | ||
); | ||
} | ||
} |
This file contains 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 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