From e4ca700b6da9ec1c5bdcab065e55ae054bf15217 Mon Sep 17 00:00:00 2001 From: pradyuman-verma Date: Sat, 11 Dec 2021 00:40:45 +0530 Subject: [PATCH] updated scripts --- scripts/constant/addresses.ts | 41 ----------- scripts/constant/tokens.ts | 71 ------------------- .../deployment/deployAndVerifyOnSourcify.ts | 2 +- scripts/tests/arbitrum/addresses.ts | 11 +++ scripts/tests/arbitrum/tokens.ts | 23 ++++++ scripts/tests/avalanche/addresses.ts | 11 +++ scripts/tests/avalanche/tokens.ts | 23 ++++++ scripts/tests/buildDSAv2.ts | 4 +- scripts/tests/encodeFlashcastData.ts | 3 +- scripts/tests/mainnet/addresses.ts | 2 +- scripts/tests/mainnet/constant.ts | 6 -- scripts/tests/polygon/addresses.ts | 4 +- scripts/tests/polygon/constant.ts | 7 -- test/mainnet/aave/v1.test.ts | 16 ++--- test/mainnet/aave/v2.test.ts | 26 +++---- test/mainnet/b.protocol/b.compound.test.ts | 4 +- test/mainnet/b.protocol/b.liquity.test.ts | 4 +- test/mainnet/b.protocol/b.maker.test.ts | 8 +-- .../mainnet/basic-ERC1155/ERC1155-transfer.ts | 6 +- test/mainnet/basic-ERC721/ERC721-transfer.ts | 6 +- test/mainnet/compound/compound.test.ts | 4 +- test/mainnet/instapool/instapool.test.ts | 4 +- test/mainnet/liquity/liquity.helpers.ts | 4 +- .../mainnet/pooltogether/pooltogether.test.ts | 12 ++-- test/mainnet/uniswap/uniswap.test.ts | 4 +- .../mainnet/uniswapStake/uniswapStake.test.ts | 4 +- test/mainnet/yearn/yearn.test.ts | 6 +- .../polygon/pooltogether/pooltogether.test.ts | 20 +++--- 28 files changed, 139 insertions(+), 197 deletions(-) delete mode 100644 scripts/constant/addresses.ts delete mode 100644 scripts/constant/tokens.ts create mode 100644 scripts/tests/arbitrum/addresses.ts create mode 100644 scripts/tests/arbitrum/tokens.ts create mode 100644 scripts/tests/avalanche/addresses.ts create mode 100644 scripts/tests/avalanche/tokens.ts delete mode 100644 scripts/tests/mainnet/constant.ts delete mode 100644 scripts/tests/polygon/constant.ts diff --git a/scripts/constant/addresses.ts b/scripts/constant/addresses.ts deleted file mode 100644 index fd69c32b..00000000 --- a/scripts/constant/addresses.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default { - mainnet: { - connectors: { - basic: "0xe5398f279175962E56fE4c5E0b62dc7208EF36c6", - auth: "0xd1aff9f2acf800c876c409100d6f39aea93fc3d9", - "INSTAPOOL-A": "0x5806af7ab22e2916fa582ff05731bf7c682387b2", - }, - core: { - connectorsV2: "0x97b0B3A8bDeFE8cB9563a3c610019Ad10DB8aD11", - instaIndex: "0x2971AdFa57b20E5a416aE5a708A8655A9c74f723", - }, - }, - polygon: { - connectors: { - basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7", - auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D", - "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b", - }, - core: { - connectorsV2: "0x2A00684bFAb9717C21271E0751BCcb7d2D763c88", - instaIndex: "0xA9B99766E6C676Cf1975c0D3166F96C0848fF5ad", - }, - }, - avalanche: { - connectors: { - // basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7", - // auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D", - // "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b", - }, - core: { - connectorsV2: "0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B", - instaIndex: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288", - }, - }, - arbitrum: { - core: { - connectorsV2: "0x127d8cD0E2b2E0366D522DeA53A787bfE9002C14", - instaIndex: "0x6CE3e607C808b4f4C26B7F6aDAeB619e49CAbb25", - }, - } -}; diff --git a/scripts/constant/tokens.ts b/scripts/constant/tokens.ts deleted file mode 100644 index d10feb48..00000000 --- a/scripts/constant/tokens.ts +++ /dev/null @@ -1,71 +0,0 @@ -export const tokens = { - mainnet: { - eth: { - type: "token", - symbol: "ETH", - name: "Ethereum", - address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", - decimals: 18, - }, - dai: { - type: "token", - symbol: "DAI", - name: "DAI Stable", - address: "0x6B175474E89094C44Da98b954EedeAC495271d0F", - decimals: 18, - }, - usdc: { - type: "token", - symbol: "USDC", - name: "USD Coin", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - decimals: 6, - }, - }, - polygon: { - eth: { - type: "token", - symbol: "ETH", - name: "Ethereum", - address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", - decimals: 18, - }, - dai: { - type: "token", - symbol: "DAI", - name: "DAI Stable", - address: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", - decimals: 18, - }, - usdc: { - type: "token", - symbol: "USDC", - name: "USD Coin", - address: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", - decimals: 6, - }, - }, - avalanche: { - eth: { - type: "token", - symbol: "ETH", - name: "Ethereum", - address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", - decimals: 18, - }, - dai: { - type: "token", - symbol: "DAI", - name: "DAI Stable", - address: "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", - decimals: 18, - }, - usdc: { - type: "token", - symbol: "USDC", - name: "USD Coin", - address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664", - decimals: 6, - }, - } -}; diff --git a/scripts/deployment/deployAndVerifyOnSourcify.ts b/scripts/deployment/deployAndVerifyOnSourcify.ts index 4aee27e8..50e877d0 100644 --- a/scripts/deployment/deployAndVerifyOnSourcify.ts +++ b/scripts/deployment/deployAndVerifyOnSourcify.ts @@ -4,7 +4,7 @@ const { deploy } = deployments; async function main() { const deployer = (await getUnnamedAccounts())[0]; - const connector = "ConnectV2InstaPoolV3Avalanche"; + const connector = "// Add connector name over here Eg: ConnectV2InstaPoolV3Avalanche" const connectorInstance = await deploy(connector, { from: deployer, diff --git a/scripts/tests/arbitrum/addresses.ts b/scripts/tests/arbitrum/addresses.ts new file mode 100644 index 00000000..3687449b --- /dev/null +++ b/scripts/tests/arbitrum/addresses.ts @@ -0,0 +1,11 @@ +export default { + connectors: { + // basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7", + // auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D", + // "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b", + }, + core: { + connectorsV2: "0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B", + instaIndex: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288", + }, +}; diff --git a/scripts/tests/arbitrum/tokens.ts b/scripts/tests/arbitrum/tokens.ts new file mode 100644 index 00000000..fc679ab4 --- /dev/null +++ b/scripts/tests/arbitrum/tokens.ts @@ -0,0 +1,23 @@ +export const tokens = { + eth: { + type: "token", + symbol: "ETH", + name: "Ethereum", + address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + decimals: 18, + }, + dai: { + type: "token", + symbol: "DAI", + name: "DAI Stable", + address: "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + decimals: 18, + }, + usdc: { + type: "token", + symbol: "USDC", + name: "USD Coin", + address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664", + decimals: 6, + }, +}; diff --git a/scripts/tests/avalanche/addresses.ts b/scripts/tests/avalanche/addresses.ts new file mode 100644 index 00000000..3687449b --- /dev/null +++ b/scripts/tests/avalanche/addresses.ts @@ -0,0 +1,11 @@ +export default { + connectors: { + // basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7", + // auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D", + // "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b", + }, + core: { + connectorsV2: "0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B", + instaIndex: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288", + }, +}; diff --git a/scripts/tests/avalanche/tokens.ts b/scripts/tests/avalanche/tokens.ts new file mode 100644 index 00000000..fc679ab4 --- /dev/null +++ b/scripts/tests/avalanche/tokens.ts @@ -0,0 +1,23 @@ +export const tokens = { + eth: { + type: "token", + symbol: "ETH", + name: "Ethereum", + address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + decimals: 18, + }, + dai: { + type: "token", + symbol: "DAI", + name: "DAI Stable", + address: "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + decimals: 18, + }, + usdc: { + type: "token", + symbol: "USDC", + name: "USD Coin", + address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664", + decimals: 6, + }, +}; diff --git a/scripts/tests/buildDSAv2.ts b/scripts/tests/buildDSAv2.ts index d8a95ee1..1729b8e0 100644 --- a/scripts/tests/buildDSAv2.ts +++ b/scripts/tests/buildDSAv2.ts @@ -7,8 +7,8 @@ import { abi } from "../../deployements/mainnet/Implementation_m1.sol/InstaImple function getAddress(network: string | undefined) { if (network === "polygon") return addressesPolygon.core.instaIndex; - // else if (network === "arbitrum") return addressesPolygon.core.instaIndex; - // else if (network === "avalanche") return addressesPolygon.core.instaIndex; + else if (network === "arbitrum") return addressesPolygon.core.instaIndex; + else if (network === "avalanche") return addressesPolygon.core.instaIndex; else return addresses.core.instaIndex; } diff --git a/scripts/tests/encodeFlashcastData.ts b/scripts/tests/encodeFlashcastData.ts index 8e4b9d9f..759b9de9 100644 --- a/scripts/tests/encodeFlashcastData.ts +++ b/scripts/tests/encodeFlashcastData.ts @@ -5,8 +5,7 @@ import { encodeSpells } from "./encodeSpells"; export default function encodeFlashcastData(spells: any) { const encodeSpellsData = encodeSpells(spells); - const targetType = "string[]"; - let argTypes = [targetType, "bytes[]"]; + let argTypes = ["string[]", "bytes[]"]; return web3.eth.abi.encodeParameters(argTypes, [ encodeSpellsData[0], encodeSpellsData[1], diff --git a/scripts/tests/mainnet/addresses.ts b/scripts/tests/mainnet/addresses.ts index 9a6012ba..ec5b38f4 100644 --- a/scripts/tests/mainnet/addresses.ts +++ b/scripts/tests/mainnet/addresses.ts @@ -1,4 +1,4 @@ -export const addresses: Record = { +export default { "connectors": { "basic": "0xe5398f279175962E56fE4c5E0b62dc7208EF36c6", "auth": "0xd1aff9f2acf800c876c409100d6f39aea93fc3d9", diff --git a/scripts/tests/mainnet/constant.ts b/scripts/tests/mainnet/constant.ts deleted file mode 100644 index 9e659d77..00000000 --- a/scripts/tests/mainnet/constant.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const constants = { - address_zero: "0x0000000000000000000000000000000000000000", - native_address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - max_value: - "115792089237316195423570985008687907853269984665640564039457584007913129639935", -}; diff --git a/scripts/tests/polygon/addresses.ts b/scripts/tests/polygon/addresses.ts index cb4af74b..fb0de779 100644 --- a/scripts/tests/polygon/addresses.ts +++ b/scripts/tests/polygon/addresses.ts @@ -1,4 +1,4 @@ -export const addresses: Record = { +export default { connectors: { basic: "0x1cAF5EC802ca602E98139AD96A8f2B7BC524264E", auth: "0xf6474aD0dA75A0dE15D2c915e601D9f754B9e6fe", @@ -7,4 +7,4 @@ export const addresses: Record = { connectorsV2: "0x2A00684bFAb9717C21271E0751BCcb7d2D763c88", instaIndex: "0xA9B99766E6C676Cf1975c0D3166F96C0848fF5ad", }, -}; +}; \ No newline at end of file diff --git a/scripts/tests/polygon/constant.ts b/scripts/tests/polygon/constant.ts deleted file mode 100644 index 4059e9e5..00000000 --- a/scripts/tests/polygon/constant.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const constant = { - address_zero: "0x0000000000000000000000000000000000000000", - eth_addr: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - matic_addr: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - max_value: - "115792089237316195423570985008687907853269984665640564039457584007913129639935", -}; diff --git a/test/mainnet/aave/v1.test.ts b/test/mainnet/aave/v1.test.ts index bdf7c22e..14ba5a14 100644 --- a/test/mainnet/aave/v1.test.ts +++ b/test/mainnet/aave/v1.test.ts @@ -1,14 +1,14 @@ import hre from "hardhat"; import { expect } from "chai"; import abis from "../../../scripts/constant/abis"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { ConnectV2AaveV1, ConnectV2AaveV1__factory } from "../../../typechain"; import { parseEther } from "@ethersproject/units"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/mainnet/tokens"; import { constants } from "../../../scripts/constant/constant"; import { addLiquidity } from "../../../scripts/tests/addLiquidity"; const { ethers } = hre; @@ -41,7 +41,7 @@ describe("Aave V1", function () { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.mainnet.core.connectorsV2 + addresses.core.connectorsV2 ); connector = await deployAndEnableConnector({ connectorName, @@ -85,7 +85,7 @@ describe("Aave V1", function () { { connector: connectorName, method: "deposit", - args: [tokens.mainnet.eth.address, amt, 0, 0], + args: [tokens.eth.address, amt, 0, 0], }, ]; @@ -110,13 +110,13 @@ describe("Aave V1", function () { { connector: connectorName, method: "borrow", - args: [tokens.mainnet.dai.address, amt, 0, 0], + args: [tokens.dai.address, amt, 0, 0], }, { connector: connectorName, method: "payback", // FIXME: we need to pass max_value because of roundoff/shortfall errors - args: [tokens.mainnet.dai.address, constants.max_value, 0, 0], + args: [tokens.dai.address, constants.max_value, 0, 0], }, ]; @@ -134,7 +134,7 @@ describe("Aave V1", function () { { connector: connectorName, method: "deposit", - args: [tokens.mainnet.eth.address, constants.max_value, 0, 0], + args: [tokens.eth.address, constants.max_value, 0, 0], }, ]; @@ -152,7 +152,7 @@ describe("Aave V1", function () { { connector: connectorName, method: "withdraw", - args: [tokens.mainnet.eth.address, constants.max_value, 0, 0], + args: [tokens.eth.address, constants.max_value, 0, 0], }, ]; diff --git a/test/mainnet/aave/v2.test.ts b/test/mainnet/aave/v2.test.ts index 7348555a..b04c3568 100644 --- a/test/mainnet/aave/v2.test.ts +++ b/test/mainnet/aave/v2.test.ts @@ -1,14 +1,14 @@ import { expect } from "chai"; import hre from "hardhat"; import abis from "../../../scripts/constant/abis"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { ConnectV2AaveV2, ConnectV2AaveV2__factory } from "../../../typechain"; import { parseEther } from "@ethersproject/units"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/mainnet/tokens"; import { constants } from "../../../scripts/constant/constant"; import { addLiquidity } from "../../../scripts/tests/addLiquidity"; const { ethers } = hre; @@ -39,7 +39,7 @@ describe("Aave V2", function () { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.mainnet.core.connectorsV2 + addresses.core.connectorsV2 ); connector = await deployAndEnableConnector({ connectorName, @@ -80,7 +80,7 @@ describe("Aave V2", function () { { connector: connectorName, method: "deposit", - args: [tokens.mainnet.eth.address, amt, 0, 0], + args: [tokens.eth.address, amt, 0, 0], }, ]; @@ -102,12 +102,12 @@ describe("Aave V2", function () { { connector: connectorName, method: "borrow", - args: [tokens.mainnet.dai.address, amt, 2, 0, setId], + args: [tokens.dai.address, amt, 2, 0, setId], }, { connector: connectorName, method: "payback", - args: [tokens.mainnet.dai.address, amt, 2, setId, 0], + args: [tokens.dai.address, amt, 2, setId, 0], }, ]; @@ -128,12 +128,12 @@ describe("Aave V2", function () { { connector: connectorName, method: "borrow", - args: [tokens.mainnet.dai.address, amt, 2, 0, 0], + args: [tokens.dai.address, amt, 2, 0, 0], }, { connector: connectorName, method: "payback", - args: [tokens.mainnet.dai.address, amt.div(2), 2, 0, 0], + args: [tokens.dai.address, amt.div(2), 2, 0, 0], }, ]; @@ -149,7 +149,7 @@ describe("Aave V2", function () { { connector: connectorName, method: "payback", - args: [tokens.mainnet.dai.address, constants.max_value, 2, 0, 0], + args: [tokens.dai.address, constants.max_value, 2, 0, 0], }, ]; @@ -167,7 +167,7 @@ describe("Aave V2", function () { { connector: connectorName, method: "deposit", - args: [tokens.mainnet.eth.address, constants.max_value, 0, 0], + args: [tokens.eth.address, constants.max_value, 0, 0], }, ]; @@ -185,7 +185,7 @@ describe("Aave V2", function () { { connector: connectorName, method: "withdraw", - args: [tokens.mainnet.eth.address, constants.max_value, 0, 0], + args: [tokens.eth.address, constants.max_value, 0, 0], }, ]; @@ -205,12 +205,12 @@ describe("Aave V2", function () { { connector: connectorName, method: "deposit", - args: [tokens.mainnet.eth.address, amt, 0, setId], + args: [tokens.eth.address, amt, 0, setId], }, { connector: connectorName, method: "withdraw", - args: [tokens.mainnet.eth.address, amt, setId, 0], + args: [tokens.eth.address, amt, setId, 0], }, ]; diff --git a/test/mainnet/b.protocol/b.compound.test.ts b/test/mainnet/b.protocol/b.compound.test.ts index 743c8012..8214f41d 100644 --- a/test/mainnet/b.protocol/b.compound.test.ts +++ b/test/mainnet/b.protocol/b.compound.test.ts @@ -7,7 +7,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2" import { encodeSpells } from "../../../scripts/tests/encodeSpells" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import { constants } from "../../../scripts/constant/constant"; import { ConnectV2BCompound__factory } from "../../../typechain"; @@ -37,7 +37,7 @@ describe("B.Compound", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); connector = await deployAndEnableConnector({ connectorName, contractArtifact: ConnectV2BCompound__factory, diff --git a/test/mainnet/b.protocol/b.liquity.test.ts b/test/mainnet/b.protocol/b.liquity.test.ts index 007605a4..ce0e1a48 100644 --- a/test/mainnet/b.protocol/b.liquity.test.ts +++ b/test/mainnet/b.protocol/b.liquity.test.ts @@ -10,7 +10,7 @@ import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" import abis from "../../../scripts/constant/abis"; import { ConnectV2BLiquity__factory } from "../../../typechain"; import type { Signer, Contract } from "ethers"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; const LUSD_WHALE = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb" // stability pool const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598" @@ -45,7 +45,7 @@ describe("B.Liquity", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); connector = await deployAndEnableConnector({ connectorName, contractArtifact: ConnectV2BLiquity__factory, diff --git a/test/mainnet/b.protocol/b.maker.test.ts b/test/mainnet/b.protocol/b.maker.test.ts index 84b8df36..e919283a 100644 --- a/test/mainnet/b.protocol/b.maker.test.ts +++ b/test/mainnet/b.protocol/b.maker.test.ts @@ -7,9 +7,9 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2" import { encodeSpells } from "../../../scripts/tests/encodeSpells" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/mainnet/tokens"; import { ConnectV2BMakerDAO__factory } from "../../../typechain"; import type { Signer, Contract } from "ethers"; @@ -41,7 +41,7 @@ describe("B.Maker", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); connector = await deployAndEnableConnector({ connectorName, contractArtifact: ConnectV2BMakerDAO__factory, @@ -51,7 +51,7 @@ describe("B.Maker", function () { manager = await ethers.getContractAt("BManagerLike", "0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed") vat = await ethers.getContractAt("../artifacts/contracts/mainnet/connectors/b.protocol/makerdao/interface.sol:VatLike", await manager.vat()) - dai = await ethers.getContractAt("../artifacts/contracts/mainnet/common/interfaces.sol:TokenInterface", tokens.mainnet.dai.address) + dai = await ethers.getContractAt("../artifacts/contracts/mainnet/common/interfaces.sol:TokenInterface", tokens.dai.address) console.log("Connector address", connector.address) }) diff --git a/test/mainnet/basic-ERC1155/ERC1155-transfer.ts b/test/mainnet/basic-ERC1155/ERC1155-transfer.ts index df9490a3..f8a138bc 100644 --- a/test/mainnet/basic-ERC1155/ERC1155-transfer.ts +++ b/test/mainnet/basic-ERC1155/ERC1155-transfer.ts @@ -8,7 +8,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2" import { encodeSpells } from "../../../scripts/tests/encodeSpells" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses" +import addresses from "../../../scripts/tests/mainnet/addresses" import abis from "../../../scripts/constant/abis" import type { Signer, Contract } from "ethers"; @@ -64,11 +64,11 @@ describe("BASIC-ERC1155", function () { ); nftContract = await ethers.getContractAt(IERC1155__factory.abi, TOKEN_CONTRACT_ADDR) masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr); InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation") - instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex); + instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex); await instaAccountV2DefaultImpl.deployed() connector = await deployAndEnableConnector({ connectorName, diff --git a/test/mainnet/basic-ERC721/ERC721-transfer.ts b/test/mainnet/basic-ERC721/ERC721-transfer.ts index 6139449d..908d9f21 100644 --- a/test/mainnet/basic-ERC721/ERC721-transfer.ts +++ b/test/mainnet/basic-ERC721/ERC721-transfer.ts @@ -8,7 +8,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2" import { encodeSpells } from "../../../scripts/tests/encodeSpells" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses" +import addresses from "../../../scripts/tests/mainnet/addresses" import abis from "../../../scripts/constant/abis" import type { Signer, Contract } from "ethers"; @@ -64,11 +64,11 @@ describe("BASIC-ERC721", function () { ); nftContract = await ethers.getContractAt(IERC721__factory.abi, TOKEN_CONTRACT_ADDR) masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr); InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation") - instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex); + instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex); await instaAccountV2DefaultImpl.deployed() connector = await deployAndEnableConnector({ connectorName, diff --git a/test/mainnet/compound/compound.test.ts b/test/mainnet/compound/compound.test.ts index 0a92eb49..383ee12d 100644 --- a/test/mainnet/compound/compound.test.ts +++ b/test/mainnet/compound/compound.test.ts @@ -9,7 +9,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2" import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import { constants } from "../../../scripts/constant/constant"; import { ConnectV2Compound__factory } from "../../../typechain"; @@ -38,7 +38,7 @@ describe("Compound", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); connector = await deployAndEnableConnector({ connectorName, contractArtifact: ConnectV2Compound__factory, diff --git a/test/mainnet/instapool/instapool.test.ts b/test/mainnet/instapool/instapool.test.ts index a30a612e..99fe80de 100644 --- a/test/mainnet/instapool/instapool.test.ts +++ b/test/mainnet/instapool/instapool.test.ts @@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells" import encodeFlashcastData from "../../../scripts/tests/encodeFlashcastData" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import type { Signer, Contract } from "ethers"; import { ConnectV2Compound__factory } from "../../../typechain"; @@ -38,7 +38,7 @@ describe("Instapool", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); connector = await deployAndEnableConnector({ connectorName, contractArtifact: ConnectV2Compound__factory, diff --git a/test/mainnet/liquity/liquity.helpers.ts b/test/mainnet/liquity/liquity.helpers.ts index e1cf4c54..14c1abaf 100644 --- a/test/mainnet/liquity/liquity.helpers.ts +++ b/test/mainnet/liquity/liquity.helpers.ts @@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells" import { getMasterSigner } from "../../../scripts/tests/getMasterSigner" // Instadapp instadappAddresses/ABIs -import instadappAddresses from "../../../scripts/constant/addresses"; +import instadappAddresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; // Instadapp Liquity Connector artifacts @@ -138,7 +138,7 @@ const deployAndConnect = async (contracts: any, isDebug = false) => { const masterSigner = await getMasterSigner(); const instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - instadappAddresses.mainnet.core.connectorsV2 + instadappAddresses.core.connectorsV2 ); const connector = await deployAndEnableConnector({ connectorName: LIQUITY_CONNECTOR, diff --git a/test/mainnet/pooltogether/pooltogether.test.ts b/test/mainnet/pooltogether/pooltogether.test.ts index 6482118f..1bca8b79 100644 --- a/test/mainnet/pooltogether/pooltogether.test.ts +++ b/test/mainnet/pooltogether/pooltogether.test.ts @@ -8,10 +8,10 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import { constants } from "../../../scripts/constant/constant"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/mainnet/tokens"; import type { Signer, Contract } from "ethers"; import { @@ -20,7 +20,7 @@ import { ConnectV2UniswapV2__factory, } from "../../../typechain"; -const DAI_TOKEN_ADDR = tokens.mainnet.dai.address; // DAI Token +const DAI_TOKEN_ADDR = tokens.dai.address; // DAI Token // PoolTogether Address: https://docs.pooltogether.com/resources/networks/ethereum const DAI_PRIZE_POOL_ADDR = "0xEBfb47A7ad0FD6e57323C8A42B2E5A6a4F68fc1a"; // DAI Prize Pool @@ -98,7 +98,7 @@ describe("PoolTogether", function() { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.mainnet.core.connectorsV2 + addresses.core.connectorsV2 ); // Deploy and enable Compound Connector @@ -770,7 +770,7 @@ describe("PoolTogether", function() { method: "buy", args: [ POOL_TOKEN_ADDRESS, - tokens.mainnet.eth.address, + tokens.eth.address, amount, unitAmount, 0, @@ -782,7 +782,7 @@ describe("PoolTogether", function() { method: "deposit", args: [ POOL_TOKEN_ADDRESS, - tokens.mainnet.eth.address, + tokens.eth.address, amount, unitAmount, slippage, diff --git a/test/mainnet/uniswap/uniswap.test.ts b/test/mainnet/uniswap/uniswap.test.ts index 92d1288a..93a87dec 100644 --- a/test/mainnet/uniswap/uniswap.test.ts +++ b/test/mainnet/uniswap/uniswap.test.ts @@ -8,7 +8,7 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; import { addLiquidity } from "../../../scripts/tests/addLiquidity"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import type { Signer, Contract } from "ethers"; @@ -61,7 +61,7 @@ describe("UniswapV3", function() { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.mainnet.core.connectorsV2 + addresses.core.connectorsV2 ); nftManager = await ethers.getContractAt( abi, diff --git a/test/mainnet/uniswapStake/uniswapStake.test.ts b/test/mainnet/uniswapStake/uniswapStake.test.ts index 8236cd0a..67889420 100644 --- a/test/mainnet/uniswapStake/uniswapStake.test.ts +++ b/test/mainnet/uniswapStake/uniswapStake.test.ts @@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; import { addLiquidity } from "../../../scripts/tests/addLiquidity"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; import { abi } from "@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json" import type { Signer, Contract } from "ethers"; @@ -62,7 +62,7 @@ describe("UniswapV3", function () { ], }); masterSigner = await getMasterSigner() - instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2); + instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2); nftManager = await ethers.getContractAt(abi, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"); connector = await deployAndEnableConnector({ connectorName: connectorStaker, diff --git a/test/mainnet/yearn/yearn.test.ts b/test/mainnet/yearn/yearn.test.ts index 624c30a6..a7a27464 100644 --- a/test/mainnet/yearn/yearn.test.ts +++ b/test/mainnet/yearn/yearn.test.ts @@ -8,9 +8,9 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/mainnet/addresses"; import abis from "../../../scripts/constant/abis"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/mainnet/tokens"; import { Signer, Contract, BigNumber } from "ethers"; import { ConnectV2YearnV2__factory } from "../../../typechain"; @@ -50,7 +50,7 @@ describe("Yearn", function() { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.mainnet.core.connectorsV2 + addresses.core.connectorsV2 ); connector = await deployAndEnableConnector({ connectorName, diff --git a/test/polygon/pooltogether/pooltogether.test.ts b/test/polygon/pooltogether/pooltogether.test.ts index e5bdbc24..04b9f821 100644 --- a/test/polygon/pooltogether/pooltogether.test.ts +++ b/test/polygon/pooltogether/pooltogether.test.ts @@ -10,14 +10,14 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"; import { encodeSpells } from "../../../scripts/tests/encodeSpells"; import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"; -import addresses from "../../../scripts/constant/addresses"; +import addresses from "../../../scripts/tests/polygon/addresses"; import abis from "../../../scripts/constant/abis"; -import { tokens } from "../../../scripts/constant/tokens"; +import { tokens } from "../../../scripts/tests/polygon/tokens"; import type { Signer, Contract } from "ethers"; import { ConnectV2AaveV2Polygon__factory, ConnectV2PoolTogetherPolygon__factory } from "../../../typechain"; -const DAI_TOKEN_ADDR = tokens.polygon.dai.address; // DAI Token +const DAI_TOKEN_ADDR = tokens.dai.address; // DAI Token // PoolTogether Address: https://docs.pooltogether.com/resources/networks/matic const USDC_PRIZE_POOL_ADDR = "0xEE06AbE9e2Af61cabcb13170e01266Af2DEFa946"; // USDC Prize Pool const PT_USDC_TICKET_ADDR = "0x473E484c722EF9ec6f63B509b07Bb9cfB258820b"; // PT USDC Ticket @@ -69,7 +69,7 @@ describe("PoolTogether", function() { masterSigner = await getMasterSigner(); instaConnectorsV2 = await ethers.getContractAt( abis.core.connectorsV2, - addresses.polygon.core.connectorsV2 + addresses.core.connectorsV2 ); // Deploy and enable Compound Connector @@ -120,7 +120,7 @@ describe("PoolTogether", function() { { connector: connectorName, method: "deposit", - args: [tokens.polygon.eth.address, amount, 0, 0], + args: [tokens.eth.address, amount, 0, 0], }, ]; @@ -141,7 +141,7 @@ describe("PoolTogether", function() { { connector: connectorName, method: "borrow", - args: [tokens.polygon.usdc.address, amount, 2, 0, setId], + args: [tokens.usdc.address, amount, 2, 0, setId], }, { connector: ptConnectorName, @@ -158,7 +158,7 @@ describe("PoolTogether", function() { // Before Spell let usdcToken = await ethers.getContractAt( abis.basic.erc20, - tokens.polygon.usdc.address + tokens.usdc.address ); let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address); expect(usdcBalance, `USDC balance is 0`).to.be.eq( @@ -239,7 +239,7 @@ describe("PoolTogether", function() { // Before spell let usdcToken = await ethers.getContractAt( abis.basic.erc20, - tokens.polygon.usdc.address + tokens.usdc.address ); let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address); expect(usdcBalance, `USDC balance equals 0`).to.be.eq( @@ -330,7 +330,7 @@ describe("PoolTogether", function() { // Before spell let usdcToken = await ethers.getContractAt( abis.basic.erc20, - tokens.polygon.usdc.address + tokens.usdc.address ); let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address); expect(usdcBalance, `USDC Balance equals 100`).to.be.eq( @@ -394,7 +394,7 @@ describe("PoolTogether", function() { // Before spell let usdcToken = await ethers.getContractAt( abis.basic.erc20, - tokens.polygon.usdc.address + tokens.usdc.address ); let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address); expect(usdcBalance, `USDC balance less than 10`).to.be.lt(