Skip to content

Commit

Permalink
refactor: organize vip-015 and vip-016
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Apr 2, 2024
1 parent 2d72b03 commit 216628e
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 50 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# true or false

DEPLOYER_PRIVATE_KEY=""

## Archive nodes
Expand Down
4 changes: 2 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-ethers";
import * as dotenv from "dotenv";
import { ethers } from "ethers";
import { HardhatUserConfig, task } from "hardhat/config";

import "./type-extensions";

// eslint-disable-next-line @typescript-eslint/no-var-requires
require("dotenv").config();
dotenv.config();
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;

task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { parseUnits } from "ethers/lib/utils";

import { makeProposal } from "../../../src/utils";
import { makeProposal } from "../../../../src/utils";

export const TREASURY = "0xFD9B071168bC27DBE16406eC3Aba050Ce8Eb22FA";
export const COMMUNITY_WALLET = "0xc444949e0054a23c44fc45789738bdf64aed2391";
export const XVS = "0xd3CC9d8f3689B83c91b7B59cAB4946B063EB894A";
export const XVS_AMOUNT = parseUnits("8000", 18).toString();

export const vip015 = () => {
const vip015 = () => {
return makeProposal([
{
target: TREASURY,
Expand All @@ -16,3 +16,5 @@ export const vip015 = () => {
},
]);
};

export default vip015;
11 changes: 1 addition & 10 deletions multisig/proposals/sepolia/vip-002/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const POOL_REGISTRY = "0x758f5715d817e02857Ba40889251201A5aE3E186";
export const RESILIENT_ORACLE = "0xEF4e53a9A4565ef243A2f0ee9a7fc2410E1aA623";
export const VTREASURY = "0x3370915301E8a6A6baAe6f461af703e2498409F3";


// IL configuration
const vip002 = () => {
return makeProposal([
Expand Down Expand Up @@ -220,15 +219,7 @@ const vip002 = () => {
target: POOL_REGISTRY,
signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))",
params: [
[
VWBTC_CORE,
"750000000000000000",
"800000000000000000",
"30000000",
VTREASURY,
"30000000000",
"25000000000",
],
[VWBTC_CORE, "750000000000000000", "800000000000000000", "30000000", VTREASURY, "30000000000", "25000000000"],
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { makeProposal } from "../../../src/utils";
import { makeProposal } from "../../../../src/utils";
import {
REWARD_DISTRIBUTOR_CORE_0,
REWARD_DISTRIBUTOR_CORE_1,
Expand All @@ -15,7 +15,7 @@ import {
VWETH_CORE,
VWETH_LST,
VWSTETH_LST,
} from "../vip-006/vip-006-sepolia";
} from "../vip-006";

// Start block considered Multisig tx executed https://sepolia.etherscan.io/tx/0x9785ef7f2eed457a934b194c5697bb94e060774e3deeecf5e26d58d37c764bff
const REWARDS_START_BLOCK = 5530143;
Expand Down Expand Up @@ -61,7 +61,7 @@ const lastRewardBlockConfig: LastRewardBlockConfig[] = [
},
];

export const vip016 = () => {
const vip016 = () => {
return makeProposal([
...lastRewardBlockConfig.map(config => {
const lastRewardBlockArray = new Array(config.vTokens.length).fill(config.lastRewardBlock);
Expand All @@ -73,3 +73,5 @@ export const vip016 = () => {
}),
]);
};

export default vip016;
1 change: 1 addition & 0 deletions multisig/simulations/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ import "./vip-009";
import "./vip-010";
import "./vip-013";
import "./vip-014";
import "./vip-015";
2 changes: 0 additions & 2 deletions multisig/simulations/ethereum/vip-002/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const POOL_REGISTRY = "0x61CAff113CCaf05FFc6540302c37adcf077C5179";
const TREASURY = "0xfd9b071168bc27dbe16406ec3aba050ce8eb22fa";
const CRV_VTOKEN_RECEIVER = "0x7a16fF8270133F063aAb6C9977183D9e72835428";

const RESILIENT_ORACLE = sepolia.RESILIENT_ORACLE;
const GUARDIAN = "0x94fa6078b6b8a26F0B6EDFFBE6501B22A10470fB";
const POOL_REGISTRY = sepolia.POOL_REGISTRY;

const BLOCKS_PER_YEAR = 2_628_000; // assuming a block is mined every 12 seconds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { parseUnits } from "ethers/lib/utils";
import { ethers } from "hardhat";

import { forking, pretendExecutingVip } from "../../../../src/vip-framework";
import { COMMUNITY_WALLET, TREASURY, XVS, vip015 } from "../../../proposals/vip-015/vip-015-ethereum";
import XVS_ABI from "./abi/XVS.json";
import vip015, { COMMUNITY_WALLET, TREASURY, XVS } from "../../../proposals/ethereum/vip-015";
import XVS_ABI from "../../vip-015/vip-015-ethereum/abi/XVS.json";

forking(19474280, () => {
let xvs: Contract;
Expand Down
1 change: 1 addition & 0 deletions multisig/simulations/sepolia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ import "./vip-008";
import "./vip-009";
// import './vip-010' // passes when run separately
import "./vip-013";
import "./vip-016";
46 changes: 23 additions & 23 deletions multisig/simulations/sepolia/vip-002/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from "chai";
import { BigNumberish, BigNumber } from "ethers";
import { BigNumber, BigNumberish } from "ethers";
import { Contract } from "ethers";
import { parseUnits } from "ethers/lib/utils";
import { ethers } from "hardhat";
Expand All @@ -8,36 +8,36 @@ import { forking, pretendExecutingVip } from "../../../../src/vip-framework";
import { checkVToken } from "../../../../src/vip-framework/checks/checkVToken";
import { checkInterestRate } from "../../../../src/vip-framework/checks/interestRateModel";
import vip002, {
VWBTC_CORE,
VWETH_CORE,
VUSDT_CORE,
VUSDC_CORE,
VCRVUSD_CORE,
VCRV_CORE,
VUSDC_STABLECOINS,
VUSDT_STABLECOINS,
VCRVUSD_STABLECOINS,
VCRVUSD_CURVE,
VCRV_CURVE,
COMPTROLLER_CORE,
COMPTROLLER_CURVE,
COMPTROLLER_STABLECOINS,
MOCK_CRV,
MOCK_USDC,
MOCK_USDT,
MOCK_WBTC,
MOCK_WETH,
MOCK_USDT,
MOCK_USDC,
MOCK_CRV,
MOCK_crvUSD,
COMPTROLLER_CORE,
RESILIENT_ORACLE,
POOL_REGISTRY,
RESILIENT_ORACLE,
VCRVUSD_CORE,
VCRVUSD_CURVE,
VCRVUSD_STABLECOINS,
VCRV_CORE,
VCRV_CURVE,
VTREASURY,
COMPTROLLER_STABLECOINS,
COMPTROLLER_CURVE,
VUSDC_CORE,
VUSDC_STABLECOINS,
VUSDT_CORE,
VUSDT_STABLECOINS,
VWBTC_CORE,
VWETH_CORE,
} from "../../../proposals/sepolia/vip-002";
import COMPTROLLER_ABI from "./abi/comptroller.json";
import ERC20_ABI from "./abi/erc20.json";
import POOL_REGISTRY_ABI from "./abi/poolRegistry.json";
import VTOKEN_ABI from "./abi/vToken.json";

const BLOCKS_PER_YEAR = BigNumber.from('2252571'); // assuming a block is mined every 14 seconds
const BLOCKS_PER_YEAR = BigNumber.from("2252571"); // assuming a block is mined every 14 seconds
const GUARDIAN = "0xb15f6EfEbC276A3b9805df81b5FB3D50C2A62BDf";

type VTokenSymbol =
Expand Down Expand Up @@ -346,9 +346,9 @@ forking(4783370, () => {
poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, POOL_REGISTRY);
});

describe("Contracts setup", () => {
describe("Contracts setup", async () => {
for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) {
checkVToken(address, vTokenState[symbol]);
await checkVToken(address, vTokenState[symbol]);
}
});

Expand Down Expand Up @@ -559,4 +559,4 @@ forking(4783370, () => {
}
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {
VWETH_CORE,
VWETH_LST,
VWSTETH_LST,
} from "../../../proposals/vip-006/vip-006-sepolia";
import { vip016 } from "../../../proposals/vip-016/vip-016-sepolia";
import REWARDS_DISTRIBUTOR_ABI from "./abi/rewardsDistributor.json";
import VTOKEN_ABI from "./abi/vToken.json";
} from "../../../proposals/sepolia/vip-006";
import vip016 from "../../../proposals/sepolia/vip-016";
import REWARDS_DISTRIBUTOR_ABI from "../../vip-016/vip-016-sepolia/abi/rewardsDistributor.json";
import VTOKEN_ABI from "../../vip-016/vip-016-sepolia/abi/vToken.json";

// Start block considered Multisig tx executed https://sepolia.etherscan.io/tx/0x9785ef7f2eed457a934b194c5697bb94e060774e3deeecf5e26d58d37c764bff
const REWARDS_START_BLOCK = 5530143;
Expand Down

0 comments on commit 216628e

Please sign in to comment.