From b0abb2f9470cd5c42b385af512222e7628ff0350 Mon Sep 17 00:00:00 2001 From: 0xLucian <0xluciandev@gmail.com> Date: Tue, 3 Oct 2023 16:10:02 +0300 Subject: [PATCH 1/5] chore: add vip for audit payments --- vips/vip-180.ts | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vips/vip-180.ts diff --git a/vips/vip-180.ts b/vips/vip-180.ts new file mode 100644 index 000000000..a6bc24e03 --- /dev/null +++ b/vips/vip-180.ts @@ -0,0 +1,59 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { ProposalType } from "../src/types"; +import { makeProposal } from "../src/utils"; + +const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; +export const USDC = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; +export const USDT = "0x55d398326f99059ff775485246999027b3197955"; +export const PECKSHIELD_RECEIVER = "0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1"; +export const CERTIK_RECEIVER = "0x4cf605b238e9c3c72d0faed64d12426e4a54ee12"; + +export const vip180 = () => { + const meta = { + version: "v2", + title: "VIP-180 Payments Issuance for performed Audits and Retainer Program", + description: `**Description** + +If passed this VIP will perform the following actions: + +* Transfer 7,000 USDC to Peckshield for the BUSDLiquidator audit +* Transfer 19,000 USDT to Certik for the retainer program subscription + + +#### Details + +Peckshield - BUSDLiquidator + +- Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) +- Payload: BUSDLiquidator - contract used to perform the forced liquidations on BUSD positions +- Status: audit starts on October 3rd, 2023. ETA: October 6th, 2023 +- Cost: 7,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 + +Certik - retainer program + +- Auditor: Certik ([https://certik.com](https://certik.com/)) +- Concept: Retainer program - monthly payment of October 2023. Scheduled audits by Certik in October: Token converter +- Cost: 19,000 USDT, to be sent to the BEP20 address 0x4cf605b238e9c3c72d0faed64d12426e4a54ee12`, + forDescription: "I agree that Venus Protocol should proceed with these payments", + againstDescription: "I do not think that Venus Protocol should proceed with these payments", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with these payments", + }; + + return makeProposal( + [ + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("7900", 18), PECKSHIELD_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("19000", 18), CERTIK_RECEIVER], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; From 1b9c95e8ffff586b0a3bf5b985d4da6ff776223b Mon Sep 17 00:00:00 2001 From: 0xLucian <0xluciandev@gmail.com> Date: Tue, 3 Oct 2023 16:10:50 +0300 Subject: [PATCH 2/5] feat: adding mainnet simulation for audit payments VIP --- .../vip-180/abi/IERC20UpgradableAbi.json | 295 ++++++++++++++++++ simulations/vip-180/abi/VTreasury.json | 154 +++++++++ simulations/vip-180/simulations.ts | 48 +++ 3 files changed, 497 insertions(+) create mode 100644 simulations/vip-180/abi/IERC20UpgradableAbi.json create mode 100644 simulations/vip-180/abi/VTreasury.json create mode 100644 simulations/vip-180/simulations.ts diff --git a/simulations/vip-180/abi/IERC20UpgradableAbi.json b/simulations/vip-180/abi/IERC20UpgradableAbi.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-180/abi/IERC20UpgradableAbi.json @@ -0,0 +1,295 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "userAddress", "type": "address" }, + { "indexed": false, "internalType": "address payable", "name": "relayerAddress", "type": "address" }, + { "indexed": false, "internalType": "bytes", "name": "functionSignature", "type": "bytes" } + ], + "name": "MetaTransactionExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC712_VERSION", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PREDICATE_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "userAddress", "type": "address" }, + { "internalType": "bytes", "name": "functionSignature", "type": "bytes" }, + { "internalType": "bytes32", "name": "sigR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "sigS", "type": "bytes32" }, + { "internalType": "uint8", "name": "sigV", "type": "uint8" } + ], + "name": "executeMetaTransaction", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeperator", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "getNonce", + "outputs": [{ "internalType": "uint256", "name": "nonce", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "getRoleMember", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleMemberCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-180/abi/VTreasury.json b/simulations/vip-180/abi/VTreasury.json new file mode 100644 index 000000000..4df72989d --- /dev/null +++ b/simulations/vip-180/abi/VTreasury.json @@ -0,0 +1,154 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "withdrawAddress", + "type": "address" + } + ], + "name": "WithdrawTreasuryBEP20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "withdrawAddress", + "type": "address" + } + ], + "name": "WithdrawTreasuryBNB", + "type": "event" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "withdrawAddress", + "type": "address" + } + ], + "name": "withdrawTreasuryBEP20", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "withdrawAddress", + "type": "address" + } + ], + "name": "withdrawTreasuryBNB", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + } +] diff --git a/simulations/vip-180/simulations.ts b/simulations/vip-180/simulations.ts new file mode 100644 index 000000000..b1368ed59 --- /dev/null +++ b/simulations/vip-180/simulations.ts @@ -0,0 +1,48 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { expect } from "chai"; +import { BigNumber } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; + +import { expectEvents } from "../../src/utils"; +import { forking, testVip } from "../../src/vip-framework"; +import { CERTIK_RECEIVER, PECKSHIELD_RECEIVER, USDC, USDT, vip180 } from "../../vips/vip-180"; +import IERC20_ABI from "./abi/IERC20UpgradableAbi.json"; +import VTREASURY_ABI from "./abi/VTreasury.json"; + +const PECKSHIELD_AMOUNT = parseUnits("7900", 18); +const CERTIK_AMOUNT = parseUnits("19000", 18); + +forking(32280000, () => { + let usdc: ethers.Contract; + let usdt: ethers.Contract; + let prevBalancePeckShield: BigNumber; + let prevBalanceCertik: BigNumber; + + before(async () => { + usdc = new ethers.Contract(USDC, IERC20_ABI, ethers.provider); + usdt = new ethers.Contract(USDT, IERC20_ABI, ethers.provider); + prevBalancePeckShield = await usdc.balanceOf(PECKSHIELD_RECEIVER); + prevBalanceCertik = await usdt.balanceOf(CERTIK_RECEIVER); + }); + + testVip("VIP-180 Security audits payments", vip180(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents(txResponse, [VTREASURY_ABI], ["WithdrawTreasuryBEP20"], [2]); + }, + }); + + describe("Post-VIP behavior", async () => { + it("Should increase balances of Peckshield receiver", async () => { + const currentBalance = await usdc.balanceOf(PECKSHIELD_RECEIVER); + const delta = currentBalance.sub(prevBalancePeckShield); + expect(delta).equals(PECKSHIELD_AMOUNT); + }); + + it("Should increase balances of Certik receiver", async () => { + const currentBalance = await usdt.balanceOf(CERTIK_RECEIVER); + const delta = currentBalance.sub(prevBalanceCertik); + expect(delta).equals(CERTIK_AMOUNT); + }); + }); +}); From ad5bcf03ef86c39bbcc72192c107e9a6ef88b6b3 Mon Sep 17 00:00:00 2001 From: 0xLucian <0xluciandev@gmail.com> Date: Tue, 10 Oct 2023 11:34:40 +0300 Subject: [PATCH 3/5] refactor: add more payments to the VIP --- vips/vip-180.ts | 94 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 21 deletions(-) diff --git a/vips/vip-180.ts b/vips/vip-180.ts index a6bc24e03..8dd8d8000 100644 --- a/vips/vip-180.ts +++ b/vips/vip-180.ts @@ -6,8 +6,13 @@ import { makeProposal } from "../src/utils"; const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; export const USDC = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; export const USDT = "0x55d398326f99059ff775485246999027b3197955"; +export const VAI = "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"; export const PECKSHIELD_RECEIVER = "0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1"; export const CERTIK_RECEIVER = "0x4cf605b238e9c3c72d0faed64d12426e4a54ee12"; +export const QUANTSTAMP_RECEIVER = "0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2"; +export const OZ_RECEIVER = "0xc444949e0054a23c44fc45789738bdf64aed2391"; +export const CHAOSLABS_RECEIVER = "0xfb1912af5b9d3fb678f801bf764e98f1c217ef35"; +export const STEAKHOUSE_RECEIVER = "0x0780c26389aca2B42ad9e4D5356804A9dEf80757"; export const vip180 = () => { const meta = { @@ -15,26 +20,48 @@ export const vip180 = () => { title: "VIP-180 Payments Issuance for performed Audits and Retainer Program", description: `**Description** -If passed this VIP will perform the following actions: - -* Transfer 7,000 USDC to Peckshield for the BUSDLiquidator audit -* Transfer 19,000 USDT to Certik for the retainer program subscription - - -#### Details - -Peckshield - BUSDLiquidator - -- Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) -- Payload: BUSDLiquidator - contract used to perform the forced liquidations on BUSD positions -- Status: audit starts on October 3rd, 2023. ETA: October 6th, 2023 -- Cost: 7,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 - -Certik - retainer program - -- Auditor: Certik ([https://certik.com](https://certik.com/)) -- Concept: Retainer program - monthly payment of October 2023. Scheduled audits by Certik in October: Token converter -- Cost: 19,000 USDT, to be sent to the BEP20 address 0x4cf605b238e9c3c72d0faed64d12426e4a54ee12`, + #### Description + If passed this VIP will perform the following actions: + - Transfer 7,000 USDC to Peckshield for the BUSDLiquidator audit + - Transfer 24,000 USDC to Peckshield for the Multichain deployment audit + - Transfer 25,000 USDT to Quantstamp for the Multichain deployment audit + - Transfer 19,000 USDT to Certik for the retainer program + - Transfer 277,200 USDC to OpenZeppelin + - Transfer 200,000 USDT to Chaos Labs + - Transfer 50,000 VAI to Steakhouse Financial + #### Details + Peckshield - BUSDLiquidator + - Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) + - Payload: BUSDLiquidator - contract used to perform the forced liquidations on BUSD positions + - Status: audit starts on October 3rd, 2023. ETA: October 6th, 2023 + - Cost: 7,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 + Peckshield - Multichain deployment + - Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) + - Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains + - Status: audit starts on October 12th, 2023. ETA: October 18th, 2023 + - Cost: 24,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 + Quantstamp - Multichain deployment + - Auditor: Quantstamp ([https://quantstamp.com](https://quantstamp.com/)) + - Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains. + - Status: audit started on August 28th, 2023. ETA: September 18th, 2023 + - Cost: 25,000 USDT, to be sent to the BEP20 address 0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2 + - The total cost of the audit is 55,000 USDT. The audit of Prime by Quantstamp, paid in the [VIP-164](https://app.venus.io/#/governance/proposal/164), was not finally performed because it was replaced by the Code4rena contest, see [VIP-173](https://app.venus.io/#/governance/proposal/173). The cost of the Prime audit by Quantstamp was 30,000 USDC, that is discounted from the cost of this audit. For that reason, in this VIP, 25,000 USDT will be transferred to Quantstamp (55,000 USDT - 30,000 USDC). + Certik - retainer program + - Auditor: Certik ([https://certik.com](https://certik.com/)) + - Concept: Retainer program - monthly payment of October 2023. Scheduled audits by Certik in October: Token converter + - Cost: 19,000 USDT, to be sent to the BEP20 address 0x4cf605b238e9c3c72d0faed64d12426e4a54ee12 + OpenZeppelin - retainer program + - Auditor: OpenZeppelin ([OpenZeppelin](https://www.openzeppelin.com/)) + - Concept: Retainer program - Quarterly payment for Q3 2023. The first payment was done in [VIP-138](https://app.venus.io/#/governance/proposal/138) + - Cost: 277,200 USDC, to be sent to BEP20 address to be forwarded as ERC20 0xc444949e0054a23c44fc45789738bdf64aed2391 + Chaos Labs - retainer program + - Provider: [ChaosLabs.xyz](http://chaoslabs.xys/) + - Concept: Retainer program - Quarterly payment of Q3 2023 and Q4 2024 + - Cost: 200,000 USDT to be sent to the BEP20 address 0xfb1912af5b9d3fb678f801bf764e98f1c217ef35 + Steakhouse Financial - retainer program + - Provider: [Steakhouse Financial](https://www.steakhouse.financial/) + - Concept: Retainer Program - Quarterly Payment for Q4 2023 + - Cost: 50,000 VAI to be sent to the BEP20 address 0x0780c26389aca2B42ad9e4D5356804A9dEf80757`, forDescription: "I agree that Venus Protocol should proceed with these payments", againstDescription: "I do not think that Venus Protocol should proceed with these payments", abstainDescription: "I am indifferent to whether Venus Protocol proceeds with these payments", @@ -45,13 +72,38 @@ Certik - retainer program { target: TREASURY, signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDC, parseUnits("7900", 18), PECKSHIELD_RECEIVER], + params: [USDC, parseUnits("7000", 18), PECKSHIELD_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("24000", 18), PECKSHIELD_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("25000", 18), QUANTSTAMP_RECEIVER], }, { target: TREASURY, signature: "withdrawTreasuryBEP20(address,uint256,address)", params: [USDT, parseUnits("19000", 18), CERTIK_RECEIVER], }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("277200", 18), OZ_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("200000", 18), CHAOSLABS_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [VAI, parseUnits("50000", 18), STEAKHOUSE_RECEIVER], + }, ], meta, ProposalType.REGULAR, From b362d179f4636ef81b1b1d301112b1c339cb1101 Mon Sep 17 00:00:00 2001 From: 0xLucian <0xluciandev@gmail.com> Date: Tue, 10 Oct 2023 11:35:05 +0300 Subject: [PATCH 4/5] refactor: adjust simulation to the new VIP --- simulations/vip-180/simulations.ts | 57 ++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/simulations/vip-180/simulations.ts b/simulations/vip-180/simulations.ts index b1368ed59..7c5779a4d 100644 --- a/simulations/vip-180/simulations.ts +++ b/simulations/vip-180/simulations.ts @@ -6,29 +6,56 @@ import { ethers } from "hardhat"; import { expectEvents } from "../../src/utils"; import { forking, testVip } from "../../src/vip-framework"; -import { CERTIK_RECEIVER, PECKSHIELD_RECEIVER, USDC, USDT, vip180 } from "../../vips/vip-180"; +import { + CERTIK_RECEIVER, + CHAOSLABS_RECEIVER, + OZ_RECEIVER, + PECKSHIELD_RECEIVER, + QUANTSTAMP_RECEIVER, + STEAKHOUSE_RECEIVER, + USDC, + USDT, + VAI, + vip180, +} from "../../vips/vip-180"; import IERC20_ABI from "./abi/IERC20UpgradableAbi.json"; import VTREASURY_ABI from "./abi/VTreasury.json"; -const PECKSHIELD_AMOUNT = parseUnits("7900", 18); +const PECKSHIELD_AMOUNT = parseUnits("31000", 18); // 24,000 + 7,000 = 31,000 const CERTIK_AMOUNT = parseUnits("19000", 18); +const QUANTSTAMP_AMOUNT = parseUnits("25000", 18); +const OZ_AMOUNT = parseUnits("277200", 18); +const CHAOSLABS_AMOUNT = parseUnits("200000", 18); +const STEAKHOUSE_AMOUNT = parseUnits("50000", 18); forking(32280000, () => { let usdc: ethers.Contract; let usdt: ethers.Contract; + let vai: ethers.Contract; + let prevBalancePeckShield: BigNumber; let prevBalanceCertik: BigNumber; + let prevBalanceQuantStamp: BigNumber; + let prevBalanceOz: BigNumber; + let prevBalanceChaosLabs: BigNumber; + let prevBalanceSteakHouse: BigNumber; before(async () => { usdc = new ethers.Contract(USDC, IERC20_ABI, ethers.provider); usdt = new ethers.Contract(USDT, IERC20_ABI, ethers.provider); + vai = new ethers.Contract(VAI, IERC20_ABI, ethers.provider); + prevBalancePeckShield = await usdc.balanceOf(PECKSHIELD_RECEIVER); prevBalanceCertik = await usdt.balanceOf(CERTIK_RECEIVER); + prevBalanceQuantStamp = await usdt.balanceOf(QUANTSTAMP_RECEIVER); + prevBalanceOz = await usdc.balanceOf(OZ_RECEIVER); + prevBalanceChaosLabs = await usdt.balanceOf(CHAOSLABS_RECEIVER); + prevBalanceSteakHouse = await vai.balanceOf(STEAKHOUSE_RECEIVER); }); testVip("VIP-180 Security audits payments", vip180(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { - await expectEvents(txResponse, [VTREASURY_ABI], ["WithdrawTreasuryBEP20"], [2]); + await expectEvents(txResponse, [VTREASURY_ABI], ["WithdrawTreasuryBEP20"], [7]); }, }); @@ -44,5 +71,29 @@ forking(32280000, () => { const delta = currentBalance.sub(prevBalanceCertik); expect(delta).equals(CERTIK_AMOUNT); }); + + it("Should increase balances of Quantstamp receiver", async () => { + const currentBalance = await usdt.balanceOf(QUANTSTAMP_RECEIVER); + const delta = currentBalance.sub(prevBalanceQuantStamp); + expect(delta).equals(QUANTSTAMP_AMOUNT); + }); + + it("Should increase balances of OZ receiver", async () => { + const currentBalance = await usdc.balanceOf(OZ_RECEIVER); + const delta = currentBalance.sub(prevBalanceOz); + expect(delta).equals(OZ_AMOUNT); + }); + + it("Should increase balances of Chaos Labs receiver", async () => { + const currentBalance = await usdt.balanceOf(CHAOSLABS_RECEIVER); + const delta = currentBalance.sub(prevBalanceChaosLabs); + expect(delta).equals(CHAOSLABS_AMOUNT); + }); + + it("Should increase balances of Steakhouse receiver", async () => { + const currentBalance = await vai.balanceOf(STEAKHOUSE_RECEIVER); + const delta = currentBalance.sub(prevBalanceSteakHouse); + expect(delta).equals(STEAKHOUSE_AMOUNT); + }); }); }); From c5ac408cc9d29d1baff791f54cf8ec139a63714a Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Wed, 11 Oct 2023 19:51:46 +0200 Subject: [PATCH 5/5] chore: set final number for VIP 184 and its description --- .../abi/IERC20UpgradableAbi.json | 0 .../{vip-180 => vip-184}/abi/VTreasury.json | 0 .../{vip-180 => vip-184}/simulations.ts | 8 +- vips/vip-180.ts | 111 --------------- vips/vip-184.ts | 126 ++++++++++++++++++ 5 files changed, 130 insertions(+), 115 deletions(-) rename simulations/{vip-180 => vip-184}/abi/IERC20UpgradableAbi.json (100%) rename simulations/{vip-180 => vip-184}/abi/VTreasury.json (100%) rename simulations/{vip-180 => vip-184}/simulations.ts (96%) delete mode 100644 vips/vip-180.ts create mode 100644 vips/vip-184.ts diff --git a/simulations/vip-180/abi/IERC20UpgradableAbi.json b/simulations/vip-184/abi/IERC20UpgradableAbi.json similarity index 100% rename from simulations/vip-180/abi/IERC20UpgradableAbi.json rename to simulations/vip-184/abi/IERC20UpgradableAbi.json diff --git a/simulations/vip-180/abi/VTreasury.json b/simulations/vip-184/abi/VTreasury.json similarity index 100% rename from simulations/vip-180/abi/VTreasury.json rename to simulations/vip-184/abi/VTreasury.json diff --git a/simulations/vip-180/simulations.ts b/simulations/vip-184/simulations.ts similarity index 96% rename from simulations/vip-180/simulations.ts rename to simulations/vip-184/simulations.ts index 7c5779a4d..f3d36a451 100644 --- a/simulations/vip-180/simulations.ts +++ b/simulations/vip-184/simulations.ts @@ -16,8 +16,8 @@ import { USDC, USDT, VAI, - vip180, -} from "../../vips/vip-180"; + vip184, +} from "../../vips/vip-184"; import IERC20_ABI from "./abi/IERC20UpgradableAbi.json"; import VTREASURY_ABI from "./abi/VTreasury.json"; @@ -28,7 +28,7 @@ const OZ_AMOUNT = parseUnits("277200", 18); const CHAOSLABS_AMOUNT = parseUnits("200000", 18); const STEAKHOUSE_AMOUNT = parseUnits("50000", 18); -forking(32280000, () => { +forking(32516199, () => { let usdc: ethers.Contract; let usdt: ethers.Contract; let vai: ethers.Contract; @@ -53,7 +53,7 @@ forking(32280000, () => { prevBalanceSteakHouse = await vai.balanceOf(STEAKHOUSE_RECEIVER); }); - testVip("VIP-180 Security audits payments", vip180(), { + testVip("VIP-184 Security audits payments", vip184(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { await expectEvents(txResponse, [VTREASURY_ABI], ["WithdrawTreasuryBEP20"], [7]); }, diff --git a/vips/vip-180.ts b/vips/vip-180.ts deleted file mode 100644 index 8dd8d8000..000000000 --- a/vips/vip-180.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { parseUnits } from "ethers/lib/utils"; - -import { ProposalType } from "../src/types"; -import { makeProposal } from "../src/utils"; - -const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; -export const USDC = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; -export const USDT = "0x55d398326f99059ff775485246999027b3197955"; -export const VAI = "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"; -export const PECKSHIELD_RECEIVER = "0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1"; -export const CERTIK_RECEIVER = "0x4cf605b238e9c3c72d0faed64d12426e4a54ee12"; -export const QUANTSTAMP_RECEIVER = "0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2"; -export const OZ_RECEIVER = "0xc444949e0054a23c44fc45789738bdf64aed2391"; -export const CHAOSLABS_RECEIVER = "0xfb1912af5b9d3fb678f801bf764e98f1c217ef35"; -export const STEAKHOUSE_RECEIVER = "0x0780c26389aca2B42ad9e4D5356804A9dEf80757"; - -export const vip180 = () => { - const meta = { - version: "v2", - title: "VIP-180 Payments Issuance for performed Audits and Retainer Program", - description: `**Description** - - #### Description - If passed this VIP will perform the following actions: - - Transfer 7,000 USDC to Peckshield for the BUSDLiquidator audit - - Transfer 24,000 USDC to Peckshield for the Multichain deployment audit - - Transfer 25,000 USDT to Quantstamp for the Multichain deployment audit - - Transfer 19,000 USDT to Certik for the retainer program - - Transfer 277,200 USDC to OpenZeppelin - - Transfer 200,000 USDT to Chaos Labs - - Transfer 50,000 VAI to Steakhouse Financial - #### Details - Peckshield - BUSDLiquidator - - Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) - - Payload: BUSDLiquidator - contract used to perform the forced liquidations on BUSD positions - - Status: audit starts on October 3rd, 2023. ETA: October 6th, 2023 - - Cost: 7,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 - Peckshield - Multichain deployment - - Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) - - Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains - - Status: audit starts on October 12th, 2023. ETA: October 18th, 2023 - - Cost: 24,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 - Quantstamp - Multichain deployment - - Auditor: Quantstamp ([https://quantstamp.com](https://quantstamp.com/)) - - Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains. - - Status: audit started on August 28th, 2023. ETA: September 18th, 2023 - - Cost: 25,000 USDT, to be sent to the BEP20 address 0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2 - - The total cost of the audit is 55,000 USDT. The audit of Prime by Quantstamp, paid in the [VIP-164](https://app.venus.io/#/governance/proposal/164), was not finally performed because it was replaced by the Code4rena contest, see [VIP-173](https://app.venus.io/#/governance/proposal/173). The cost of the Prime audit by Quantstamp was 30,000 USDC, that is discounted from the cost of this audit. For that reason, in this VIP, 25,000 USDT will be transferred to Quantstamp (55,000 USDT - 30,000 USDC). - Certik - retainer program - - Auditor: Certik ([https://certik.com](https://certik.com/)) - - Concept: Retainer program - monthly payment of October 2023. Scheduled audits by Certik in October: Token converter - - Cost: 19,000 USDT, to be sent to the BEP20 address 0x4cf605b238e9c3c72d0faed64d12426e4a54ee12 - OpenZeppelin - retainer program - - Auditor: OpenZeppelin ([OpenZeppelin](https://www.openzeppelin.com/)) - - Concept: Retainer program - Quarterly payment for Q3 2023. The first payment was done in [VIP-138](https://app.venus.io/#/governance/proposal/138) - - Cost: 277,200 USDC, to be sent to BEP20 address to be forwarded as ERC20 0xc444949e0054a23c44fc45789738bdf64aed2391 - Chaos Labs - retainer program - - Provider: [ChaosLabs.xyz](http://chaoslabs.xys/) - - Concept: Retainer program - Quarterly payment of Q3 2023 and Q4 2024 - - Cost: 200,000 USDT to be sent to the BEP20 address 0xfb1912af5b9d3fb678f801bf764e98f1c217ef35 - Steakhouse Financial - retainer program - - Provider: [Steakhouse Financial](https://www.steakhouse.financial/) - - Concept: Retainer Program - Quarterly Payment for Q4 2023 - - Cost: 50,000 VAI to be sent to the BEP20 address 0x0780c26389aca2B42ad9e4D5356804A9dEf80757`, - forDescription: "I agree that Venus Protocol should proceed with these payments", - againstDescription: "I do not think that Venus Protocol should proceed with these payments", - abstainDescription: "I am indifferent to whether Venus Protocol proceeds with these payments", - }; - - return makeProposal( - [ - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDC, parseUnits("7000", 18), PECKSHIELD_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDC, parseUnits("24000", 18), PECKSHIELD_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDT, parseUnits("25000", 18), QUANTSTAMP_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDT, parseUnits("19000", 18), CERTIK_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDC, parseUnits("277200", 18), OZ_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [USDT, parseUnits("200000", 18), CHAOSLABS_RECEIVER], - }, - { - target: TREASURY, - signature: "withdrawTreasuryBEP20(address,uint256,address)", - params: [VAI, parseUnits("50000", 18), STEAKHOUSE_RECEIVER], - }, - ], - meta, - ProposalType.REGULAR, - ); -}; diff --git a/vips/vip-184.ts b/vips/vip-184.ts new file mode 100644 index 000000000..ac83bbe9d --- /dev/null +++ b/vips/vip-184.ts @@ -0,0 +1,126 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { ProposalType } from "../src/types"; +import { makeProposal } from "../src/utils"; + +const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; +export const USDC = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; +export const USDT = "0x55d398326f99059ff775485246999027b3197955"; +export const VAI = "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"; +export const PECKSHIELD_RECEIVER = "0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1"; +export const CERTIK_RECEIVER = "0x4cf605b238e9c3c72d0faed64d12426e4a54ee12"; +export const QUANTSTAMP_RECEIVER = "0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2"; +export const OZ_RECEIVER = "0xc444949e0054a23c44fc45789738bdf64aed2391"; +export const CHAOSLABS_RECEIVER = "0xfb1912af5b9d3fb678f801bf764e98f1c217ef35"; +export const STEAKHOUSE_RECEIVER = "0x0780c26389aca2B42ad9e4D5356804A9dEf80757"; + +export const vip184 = () => { + const meta = { + version: "v2", + title: "VIP-184 Payments Issuance for performed Audits and Services", + description: `#### Description + +If passed this VIP will perform the following actions: + +- Transfer 7,000 USDC to Peckshield for the BUSDLiquidator audit +- Transfer 24,000 USDC to Peckshield for the Multichain deployment audit +- Transfer 25,000 USDT to Quantstamp for the Multichain deployment audit +- Transfer 19,000 USDT to Certik for the retainer program +- Transfer 277,200 USDC to OpenZeppelin +- Transfer 200,000 USDT to Chaos Labs +- Transfer 50,000 VAI to Steakhouse Financial + +#### Details + +Peckshield - BUSDLiquidator + +- Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) +- Payload: BUSDLiquidator - contract used to perform the forced liquidations on BUSD positions +- Status: audit starts on October 3rd, 2023. ETA: October 6th, 2023 +- Cost: 7,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 + +Peckshield - Multichain deployment + +- Auditor: Peckshield ([https://peckshield.com](https://peckshield.com/)) +- Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains +- Status: audit starts on October 12th, 2023. ETA: October 18th, 2023 +- Cost: 24,000 USDC, to be sent to the BEP20 address 0x24ee02a67c64f66ca5bcf9352f6701b46dcedff1 + +Quantstamp - Multichain deployment + +- Auditor: Quantstamp ([https://quantstamp.com](https://quantstamp.com/)) +- Payload: Multichain deployment - update of the protocol contracts to be deployed to different chains. +- Status: audit starts on October 12th, 2023. ETA: November 9th, 2023 +- Cost: 25,000 USDT, to be sent to the BEP20 address 0xf6323183A6537CAC30b95f4fAd2a236e0CbED2E2 +- The total cost of the audit is 55,000 USDT. The audit of Prime by Quantstamp, paid in the [VIP-164](https://app.venus.io/#/governance/proposal/164), was not finally performed because it was replaced by the Code4rena contest (see [VIP-173](https://app.venus.io/#/governance/proposal/173)). The cost of the Prime audit by Quantstamp was 30,000 USDC, that is discounted from the cost of this audit. For that reason, in this VIP, 25,000 USDT will be transferred to Quantstamp (55,000 USDT - 30,000 USDC). + +Certik - retainer program + +- Auditor: Certik ([https://certik.com](https://certik.com/)) +- Concept: Retainer program - monthly payment of October 2023. Scheduled audits by Certik in October: Token converter +- Cost: 19,000 USDT, to be sent to the BEP20 address 0x4cf605b238e9c3c72d0faed64d12426e4a54ee12 + +OpenZeppelin - retainer program + +- Auditor: OpenZeppelin ([OpenZeppelin](https://www.openzeppelin.com/)) +- Concept: Retainer program - Quarterly payment for Q3 2023. The first payment was done in [VIP-138](https://app.venus.io/#/governance/proposal/138) +- Cost: 277,200 USDC, to be sent to BEP20 address to be forwarded as ERC20 0xc444949e0054a23c44fc45789738bdf64aed2391 + +Chaos Labs - retainer program + +- Provider: [ChaosLabs.xyz](http://chaoslabs.xys/) +- Concept: Retainer program - Quarterly payment of Q3 2023 and Q4 2024 +- Cost: 200,000 USDT to be sent to the BEP20 address 0xfb1912af5b9d3fb678f801bf764e98f1c217ef35 + +Steakhouse Financial - retainer program + +- Provider: [Steakhouse Financial](https://www.steakhouse.financial/) +- Concept: Retainer Program - Quarterly Payment for Q4 2023 +- Cost: 50,000 VAI to be sent to the BEP20 address 0x0780c26389aca2B42ad9e4D5356804A9dEf80757`, + forDescription: "I agree that Venus Protocol should proceed with these payments", + againstDescription: "I do not think that Venus Protocol should proceed with these payments", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with these payments", + }; + + return makeProposal( + [ + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("7000", 18), PECKSHIELD_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("24000", 18), PECKSHIELD_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("25000", 18), QUANTSTAMP_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("19000", 18), CERTIK_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDC, parseUnits("277200", 18), OZ_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, parseUnits("200000", 18), CHAOSLABS_RECEIVER], + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [VAI, parseUnits("50000", 18), STEAKHOUSE_RECEIVER], + }, + ], + meta, + ProposalType.REGULAR, + ); +};