Skip to content
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
39 changes: 39 additions & 0 deletions simulations/vip-478/abi/comptroller.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "supplyCaps",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract VToken[]",
"name": "vTokens",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "newSupplyCaps",
"type": "uint256[]"
}
],
"name": "_setMarketSupplyCaps",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
37 changes: 37 additions & 0 deletions simulations/vip-478/bsctestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { expect } from "chai";
import { Contract } from "ethers";
import { parseUnits } from "ethers/lib/utils";
import { ethers } from "hardhat";
import { NETWORK_ADDRESSES } from "src/networkAddresses";
import { forking, testVip } from "src/vip-framework";

import vip478, { NEW_SUPPLY_CAP, vTUSD } from "../../vips/vip-478/bsctestnet";
import COMPTROLLER_ABI from "./abi/comptroller.json";

const { bsctestnet } = NETWORK_ADDRESSES;

const BLOCK_NUMBER = 91210770;

forking(BLOCK_NUMBER, async () => {
let comptroller: Contract;

before(async () => {
comptroller = new ethers.Contract(bsctestnet.UNITROLLER, COMPTROLLER_ABI, ethers.provider);
});

describe("Pre-VIP behavior", async () => {
it("has the old supply cap for vTUSD", async () => {
const supplyCap = await comptroller.supplyCaps(vTUSD);
expect(supplyCap).to.be.equal(parseUnits("1000000", 18));
});
});

testVip("VIP-478 Risk Parameters Adjustments (FDUSD, TUSD)", await vip478());

describe("Post-VIP behavior", async () => {
it("has the new supply cap for vTUSD", async () => {
const supplyCap = await comptroller.supplyCaps(vTUSD);
expect(supplyCap).to.be.equal(NEW_SUPPLY_CAP);
});
});
});
35 changes: 35 additions & 0 deletions vips/vip-478/bsctestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { parseUnits } from "ethers/lib/utils";
import { NETWORK_ADDRESSES } from "src/networkAddresses";
import { ProposalType } from "src/types";
import { makeProposal } from "src/utils";

const { bsctestnet } = NETWORK_ADDRESSES;

export const vTUSD = "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23";
export const OLD_SUPPLY_CAP = parseUnits("1000000", 18);
export const NEW_SUPPLY_CAP = parseUnits("1000000000", 18);

const vip478 = () => {
const meta = {
version: "v2",
title: "VIP-478 Risk Parameters Adjustments (FDUSD, TUSD)",
description: "Increase the supply cap for the TUSD market from 1,000,000 to 1,000,000,000",
forDescription: "I agree that Venus Protocol should proceed with this proposal",
againstDescription: "I do not think that Venus Protocol should proceed with this proposal",
abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not",
};

return makeProposal(
[
{
target: bsctestnet.UNITROLLER,
signature: "_setMarketSupplyCaps(address[],uint256[])",
params: [[vTUSD], [NEW_SUPPLY_CAP]],
},
],
meta,
ProposalType.REGULAR,
);
};

export default vip478;