diff --git a/multisig/simulations/basemainnet/vip-005/abis/WETH.json b/multisig/simulations/basemainnet/vip-005/abis/WETH.json deleted file mode 100644 index 5e2e37081..000000000 --- a/multisig/simulations/basemainnet/vip-005/abis/WETH.json +++ /dev/null @@ -1,557 +0,0 @@ -[ - { - "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": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "Transfer", - "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": "DOMAIN_SEPARATOR", - "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": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "bridgeBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "bridgeMint", - "outputs": [], - "stateMutability": "nonpayable", - "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": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "depositTo", - "outputs": [], - "stateMutability": "payable", - "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": "string", - "name": "name_", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol_", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - }, - { - "internalType": "address", - "name": "l2Gateway_", - "type": "address" - }, - { - "internalType": "address", - "name": "l1Address_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "l1Address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2Gateway", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "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": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "transferAndCall", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } -] diff --git a/multisig/simulations/basemainnet/vip-005/index.ts b/multisig/simulations/basemainnet/vip-005/index.ts index 3404a6b29..a7abd42ad 100644 --- a/multisig/simulations/basemainnet/vip-005/index.ts +++ b/multisig/simulations/basemainnet/vip-005/index.ts @@ -1,23 +1,21 @@ -import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { impersonateAccount } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { Contract, Signer } from "ethers"; +import { Contract } from "ethers"; import { parseUnits } from "ethers/lib/utils"; import { ethers, network } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip } from "src/vip-framework"; import { checkXVSVault } from "src/vip-framework/checks/checkXVSVault"; -import vip000 from "../../../proposals/basemainnet/vip-000"; import vip001 from "../../../proposals/basemainnet/vip-001"; import vip002 from "../../../proposals/basemainnet/vip-002"; import vip003 from "../../../proposals/basemainnet/vip-003"; -import vip004, { USDC, WETH, cbBTC } from "../../../proposals/basemainnet/vip-004"; +import vip004 from "../../../proposals/basemainnet/vip-004"; import { vip005 } from "../../../proposals/basemainnet/vip-005"; import COMPTROLLER_ABI from "./abis/Comptroller.json"; import ERC20_ABI from "./abis/ERC20.json"; import PRIME_ABI from "./abis/Prime.json"; import PRIME_LIQUIDITY_PROVIDER_ABI from "./abis/PrimeLiquidityProvider.json"; -import TOKEN_ABI from "./abis/WETH.json"; import XVS_ABI from "./abis/XVS.json"; import XVS_VAULT_ABI from "./abis/XVSVault.json"; @@ -32,7 +30,7 @@ const COMPTROLLER_CORE = "0x0C7973F9598AA62f9e03B94E92C967fD5437426C"; const basemainnet = NETWORK_ADDRESSES.basemainnet; -forking(23475595, async () => { +forking(23711533, async () => { describe("Pre-VIP behavior", () => { let prime: Contract; let primeLiquidityProvider: Contract; @@ -40,33 +38,9 @@ forking(23475595, async () => { let xvs: Contract; before(async () => { - await pretendExecutingVip(await vip000()); await pretendExecutingVip(await vip001()); await pretendExecutingVip(await vip002()); await pretendExecutingVip(await vip003()); - - const WETH_ACCOUNT = "0x6446021F4E396dA3df4235C62537431372195D38"; - const USDC_ACCOUNT = "0x0B0A5886664376F59C351ba3f598C8A8B4D0A6f3"; - const cbBTC_ACCOUNT = "0xF877ACaFA28c19b96727966690b2f44d35aD5976"; - - await impersonateAccount(WETH_ACCOUNT); - await impersonateAccount(USDC_ACCOUNT); - await impersonateAccount(cbBTC_ACCOUNT); - await setBalance(WETH_ACCOUNT, ethers.utils.parseEther("1")); - await setBalance(USDC_ACCOUNT, ethers.utils.parseEther("1")); - await setBalance(cbBTC_ACCOUNT, ethers.utils.parseEther("1")); - - const WETHSigner: Signer = await ethers.getSigner(WETH_ACCOUNT); - const USDCSigner: Signer = await ethers.getSigner(USDC_ACCOUNT); - const cbBTCSigner: Signer = await ethers.getSigner(cbBTC_ACCOUNT); - const wethToken = await ethers.getContractAt(TOKEN_ABI, WETH, WETHSigner); - const usdcToken = await ethers.getContractAt(TOKEN_ABI, USDC, USDCSigner); - const cbBTCToken = await ethers.getContractAt(TOKEN_ABI, cbBTC, cbBTCSigner); - - await wethToken.connect(WETHSigner).transfer(basemainnet.VTREASURY, parseUnits("2", 18)); - await usdcToken.connect(USDCSigner).transfer(basemainnet.VTREASURY, parseUnits("5000", 6)); - await cbBTCToken.connect(cbBTCSigner).transfer(basemainnet.VTREASURY, parseUnits("0.05", 8)); - await pretendExecutingVip(await vip004()); await impersonateAccount(GUARDIAN);