Skip to content

Commit

Permalink
Add governance script to wrap Morpho tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Nov 26, 2024
1 parent f7a0d5a commit 12d2796
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions contracts/deploy/mainnet/111_morpho_wrap_and_transfer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const addresses = require("../../utils/addresses");
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");

module.exports = deploymentWithGovernanceProposal(
{
deployName: "111_morpho_wrap_and_transfer",
forceDeploy: false,
// forceSkip: true,
skipSimulation: true,
reduceQueueTime: true,
deployerIsProposer: false,
proposalId: "",
},
async () => {
const { strategistAddr } = await getNamedAccounts();

const cLegacyMorpho = await ethers.getContractAt(
[
"function approve(address,uint256) external",
"function balanceOf(address) external view returns(uint256)",
],
"0x9994E35Db50125E0DF82e4c2dde62496CE330999"
);

const cWrapperContract = await ethers.getContractAt(
["function depositFor(address,uint256) external"],
"0x9D03bb2092270648d7480049d0E58d2FcF0E5123"
);

const currentBalance = await cLegacyMorpho.balanceOf(
addresses.mainnet.Timelock
);

// Governance Actions
// ----------------
return {
name: "Transfer Morpho tokens from Timelock to the Guardian",
actions: [
{
contract: cLegacyMorpho,
signature: "approve(address,uint256)",
args: [cWrapperContract.address, currentBalance],
},
{
contract: cWrapperContract,
signature: "depositFor(address,uint256)",
args: [strategistAddr, currentBalance],
},
],
};
}
);
2 changes: 1 addition & 1 deletion contracts/utils/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ const submitProposalGnosisSafe = async (
description,
opts = {}
) => {
if (!isMainnet) {
if (!isMainnet && !isFork) {
throw new Error("submitProposalGnosisSafe only works on Mainnet");
}

Expand Down

0 comments on commit 12d2796

Please sign in to comment.