Skip to content

Deploy WrappedOusd and Vault upgrades - Mainnet #2493

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 4 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions contracts/deploy/mainnet/132_upgrade_wousd.js

This file was deleted.

81 changes: 81 additions & 0 deletions contracts/deploy/mainnet/135_vault_wousd_upgrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
const {
deploymentWithGovernanceProposal,
deployWithConfirmation,
} = require("../../utils/deploy");
const { parseUnits } = require("ethers/lib/utils.js");

module.exports = deploymentWithGovernanceProposal(
{
deployName: "135_vault_wousd_upgrade",
proposalId:
"62736766423374672768580940310861921323283907575465980811344596309308068769219",
},
async ({ ethers }) => {
const cVaultProxy = await ethers.getContract("VaultProxy");
const cwOUSDProxy = await ethers.getContract("WrappedOUSDProxy");
const cOUSDProxy = await ethers.getContract("OUSDProxy");

const cOUSDVault = await ethers.getContractAt(
"IVault",
cVaultProxy.address
);

// Deploy new implementation
const dOUSDVaultCore = await deployWithConfirmation("VaultCore", []);
const dVaultAdmin = await deployWithConfirmation("VaultAdmin", []);

const dwOUSD = await deployWithConfirmation("WrappedOusd", [
cOUSDProxy.address, // OUSD token
]);

const cwOUSD = await ethers.getContractAt(
"WrappedOusd",
cwOUSDProxy.address
);

// ----------------
// Governance Actions
// ----------------
return {
name: "Add rate limiting to Origin Vault and upgrade Wrapped OUSD",
actions: [
// 1. Upgrade Vault proxy to VaultCore
{
contract: cVaultProxy,
signature: "upgradeTo(address)",
args: [dOUSDVaultCore.address],
},
// 2. Set the VaultAdmin
{
contract: cOUSDVault,
signature: "setAdminImpl(address)",
args: [dVaultAdmin.address],
},
// 3. Default to a short dripper, since currently we are running zero dripper.
{
contract: cOUSDVault,
signature: "setDripDuration(uint256)",
args: [4 * 60 * 60],
},
// 4. Default to a 20% APR rebase rate cap
{
contract: cOUSDVault,
signature: "setRebaseRateMax(uint256)",
args: [parseUnits("20", 18)],
},
{
// 5. Upgrade wOUSD proxy
contract: cwOUSDProxy,
signature: "upgradeTo(address)",
args: [dwOUSD.address],
},
// 6. Run the second initializer
{
contract: cwOUSD,
signature: "initialize2()",
args: [],
},
],
};
}
);
3 changes: 2 additions & 1 deletion contracts/deployments/mainnet/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"129_oeth_vault_upgrade": 1743660383,
"130_update_votemarket_addresses": 1744018070,
"131_ousd_usdc_curve_amo": 1744236000,
"133_omnichain_adapter": 1744785062
"133_omnichain_adapter": 1744785062,
"135_vault_wousd_upgrade": 1745403755
}
368 changes: 261 additions & 107 deletions contracts/deployments/mainnet/VaultAdmin.json

Large diffs are not rendered by default.

Loading
Loading