-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add 2 claimant proposals #24
Open
toninorair
wants to merge
2
commits into
main
Choose a base branch
from
feat/add-proposals-epoch-12
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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,90 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity 0.8.23; | ||
|
||
import { Script, console2 } from "../lib/forge-std/src/Script.sol"; | ||
|
||
import { IGovernor } from "../lib/ttg/src/abstract/interfaces/IGovernor.sol"; | ||
import { IStandardGovernor } from "../lib/ttg/src/interfaces/IStandardGovernor.sol"; | ||
|
||
import { DeployBase } from "./DeployBase.sol"; | ||
|
||
contract CreateProposals is Script, DeployBase { | ||
address internal constant _STANDARD_GOVERNOR = 0xB024aC5a7c6bC92fbACc8C3387E628a07e1Da016; // Mainnet Standard Governor | ||
//address internal constant _STANDARD_GOVERNOR = 0x89C867D0a4B2d4Adc6DFD00d2f153D7794Bf9Fef; // Testnet Standard Governor | ||
|
||
bytes32 internal constant _CLAIM_OVERRIDE_RECIPIENT_PREFIX = "wm_claim_override_recipient"; | ||
|
||
// Proposal descriptions | ||
string internal constant _EARNER1_CLAIMANT_DESC = | ||
"# Add M^0 Foundation as Yield Claimant for wM in the UniV3 wM/USDC Pool\n\nThis will send the yield earned on wM in the UniV3 wM/USDC Pool to the M^0 Foundation until a more sophisticated yield distribution mechanism can be put in place."; | ||
|
||
string internal constant _EARNER2_CLAIMANT_DESC = | ||
"# Add Usual as Yield Claimant for Morpho Blue singleton contract\n\nAdd Usual as claimant for Morpho Blue contract(0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb). Incentivize first lending market utilizing Morpho Blue with the goal of enabling cheap and efficient borrowing and looping strategies. See more details https://governance.m0.org/proposal/69189574147850718380572151444818943505159503261517402970976070874593534300442"; | ||
|
||
function run() external { | ||
address deployer_ = vm.rememberKey(vm.envUint("PRIVATE_KEY")); | ||
|
||
console2.log("Deployer:", deployer_); | ||
|
||
address standardGovernor_ = _STANDARD_GOVERNOR; | ||
|
||
vm.startBroadcast(deployer_); | ||
|
||
address earner1_ = 0x970A7749EcAA4394C8B2Bf5F2471F41FD6b79288; // Uniswap V3 wM/USDC pool | ||
address earner2_ = 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb; // Morpho Blue Contract | ||
|
||
bytes32 earnerKey1_ = keccak256(abi.encode(_CLAIM_OVERRIDE_RECIPIENT_PREFIX, earner1_)); | ||
bytes32 earnerKey2_ = keccak256(abi.encode(_CLAIM_OVERRIDE_RECIPIENT_PREFIX, earner2_)); | ||
|
||
address claimant1_ = 0xE0663f2372cAa1459b7ade90812Dc737CE587FA6; // M^0 Foundation address | ||
address claimant2_ = 0xdd82875f0840AAD58a455A70B88eEd9F59ceC7c7; // Usual Earner address | ||
|
||
// Wrapped M override recipients - 2 proposals | ||
uint256 claimant1ProposalId_ = _propose( | ||
deployer_, | ||
standardGovernor_, | ||
_encodeSet(earnerKey1_, claimant1_), | ||
_EARNER1_CLAIMANT_DESC | ||
); | ||
|
||
uint256 claimant2ProposalId_ = _propose( | ||
deployer_, | ||
standardGovernor_, | ||
_encodeSet(earnerKey2_, claimant2_), | ||
_EARNER2_CLAIMANT_DESC | ||
); | ||
|
||
vm.stopBroadcast(); | ||
|
||
console2.log("EarnerClaimant 1 Proposal ID:", claimant1ProposalId_); | ||
console2.log("EarnerClaimant 2 Proposal ID:", claimant2ProposalId_); | ||
} | ||
|
||
function _propose( | ||
address proposer_, | ||
address governor_, | ||
bytes memory callData_, | ||
string memory description_ | ||
) internal returns (uint256 proposalId_) { | ||
address[] memory targets_ = new address[](1); | ||
targets_[0] = governor_; | ||
|
||
bytes[] memory callDatas_ = new bytes[](1); | ||
callDatas_[0] = callData_; | ||
|
||
proposalId_ = IGovernor(governor_).propose(targets_, new uint256[](1), callDatas_, description_); | ||
} | ||
|
||
function _encodeSet(bytes32 key_, uint256 value_) internal pure returns (bytes memory) { | ||
return abi.encodeWithSelector(IStandardGovernor.setKey.selector, key_, value_); | ||
} | ||
|
||
function _encodeSet(bytes32 key_, address value_) internal pure returns (bytes memory) { | ||
return abi.encodeWithSelector(IStandardGovernor.setKey.selector, key_, value_); | ||
} | ||
|
||
function _addToList(bytes32 listName_, address actor_) internal pure returns (bytes memory) { | ||
return abi.encodeWithSelector(IStandardGovernor.addToList.selector, listName_, actor_); | ||
} | ||
} |
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 be kept to not break the integration tests.