Skip to content

Commit bc6092c

Browse files
authored
Deploy WrappedOusd and Vault upgrades - Mainnet (#2493)
* merge the deploy files into a single one * deploy WrappedOUSD and Vault cotracts * add proposal id * prettier
1 parent 497e337 commit bc6092c

11 files changed

+2609
-436
lines changed

contracts/deploy/mainnet/132_upgrade_wousd.js

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const {
2+
deploymentWithGovernanceProposal,
3+
deployWithConfirmation,
4+
} = require("../../utils/deploy");
5+
const { parseUnits } = require("ethers/lib/utils.js");
6+
7+
module.exports = deploymentWithGovernanceProposal(
8+
{
9+
deployName: "135_vault_wousd_upgrade",
10+
proposalId:
11+
"62736766423374672768580940310861921323283907575465980811344596309308068769219",
12+
},
13+
async ({ ethers }) => {
14+
const cVaultProxy = await ethers.getContract("VaultProxy");
15+
const cwOUSDProxy = await ethers.getContract("WrappedOUSDProxy");
16+
const cOUSDProxy = await ethers.getContract("OUSDProxy");
17+
18+
const cOUSDVault = await ethers.getContractAt(
19+
"IVault",
20+
cVaultProxy.address
21+
);
22+
23+
// Deploy new implementation
24+
const dOUSDVaultCore = await deployWithConfirmation("VaultCore", []);
25+
const dVaultAdmin = await deployWithConfirmation("VaultAdmin", []);
26+
27+
const dwOUSD = await deployWithConfirmation("WrappedOusd", [
28+
cOUSDProxy.address, // OUSD token
29+
]);
30+
31+
const cwOUSD = await ethers.getContractAt(
32+
"WrappedOusd",
33+
cwOUSDProxy.address
34+
);
35+
36+
// ----------------
37+
// Governance Actions
38+
// ----------------
39+
return {
40+
name: "Add rate limiting to Origin Vault and upgrade Wrapped OUSD",
41+
actions: [
42+
// 1. Upgrade Vault proxy to VaultCore
43+
{
44+
contract: cVaultProxy,
45+
signature: "upgradeTo(address)",
46+
args: [dOUSDVaultCore.address],
47+
},
48+
// 2. Set the VaultAdmin
49+
{
50+
contract: cOUSDVault,
51+
signature: "setAdminImpl(address)",
52+
args: [dVaultAdmin.address],
53+
},
54+
// 3. Default to a short dripper, since currently we are running zero dripper.
55+
{
56+
contract: cOUSDVault,
57+
signature: "setDripDuration(uint256)",
58+
args: [4 * 60 * 60],
59+
},
60+
// 4. Default to a 20% APR rebase rate cap
61+
{
62+
contract: cOUSDVault,
63+
signature: "setRebaseRateMax(uint256)",
64+
args: [parseUnits("20", 18)],
65+
},
66+
{
67+
// 5. Upgrade wOUSD proxy
68+
contract: cwOUSDProxy,
69+
signature: "upgradeTo(address)",
70+
args: [dwOUSD.address],
71+
},
72+
// 6. Run the second initializer
73+
{
74+
contract: cwOUSD,
75+
signature: "initialize2()",
76+
args: [],
77+
},
78+
],
79+
};
80+
}
81+
);

contracts/deployments/mainnet/.migrations.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
"129_oeth_vault_upgrade": 1743660383,
3030
"130_update_votemarket_addresses": 1744018070,
3131
"131_ousd_usdc_curve_amo": 1744236000,
32-
"133_omnichain_adapter": 1744785062
32+
"133_omnichain_adapter": 1744785062,
33+
"135_vault_wousd_upgrade": 1745403755
3334
}

contracts/deployments/mainnet/VaultAdmin.json

Lines changed: 261 additions & 107 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)