updated test: multichain constants

This commit is contained in:
pradyuman-verma 2021-12-08 13:14:19 +05:30 committed by Ishan Jain
parent c0f7261999
commit 46b0c02e18
14 changed files with 42 additions and 42 deletions

View File

@ -41,7 +41,7 @@ describe("Aave V1", function () {
masterSigner = await getMasterSigner();
instaConnectorsV2 = await ethers.getContractAt(
abis.core.connectorsV2,
addresses.core.connectorsV2
addresses.mainnet.core.connectorsV2
);
connector = await deployAndEnableConnector({
connectorName,
@ -85,7 +85,7 @@ describe("Aave V1", function () {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, amt, 0, 0],
args: [tokens.mainnet.eth.address, amt, 0, 0],
},
];
@ -110,13 +110,13 @@ describe("Aave V1", function () {
{
connector: connectorName,
method: "borrow",
args: [tokens.dai.address, amt, 0, 0],
args: [tokens.mainnet.dai.address, amt, 0, 0],
},
{
connector: connectorName,
method: "payback",
// FIXME: we need to pass max_value because of roundoff/shortfall errors
args: [tokens.dai.address, constants.max_value, 0, 0],
args: [tokens.mainnet.dai.address, constants.max_value, 0, 0],
},
];
@ -134,7 +134,7 @@ describe("Aave V1", function () {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, constants.max_value, 0, 0],
args: [tokens.mainnet.eth.address, constants.max_value, 0, 0],
},
];
@ -152,7 +152,7 @@ describe("Aave V1", function () {
{
connector: connectorName,
method: "withdraw",
args: [tokens.eth.address, constants.max_value, 0, 0],
args: [tokens.mainnet.eth.address, constants.max_value, 0, 0],
},
];

View File

@ -39,7 +39,7 @@ describe("Aave V2", function () {
masterSigner = await getMasterSigner();
instaConnectorsV2 = await ethers.getContractAt(
abis.core.connectorsV2,
addresses.core.connectorsV2
addresses.mainnet.core.connectorsV2
);
connector = await deployAndEnableConnector({
connectorName,
@ -80,7 +80,7 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, amt, 0, 0],
args: [tokens.mainnet.eth.address, amt, 0, 0],
},
];
@ -102,12 +102,12 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "borrow",
args: [tokens.dai.address, amt, 2, 0, setId],
args: [tokens.mainnet.dai.address, amt, 2, 0, setId],
},
{
connector: connectorName,
method: "payback",
args: [tokens.dai.address, amt, 2, setId, 0],
args: [tokens.mainnet.dai.address, amt, 2, setId, 0],
},
];
@ -128,12 +128,12 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "borrow",
args: [tokens.dai.address, amt, 2, 0, 0],
args: [tokens.mainnet.dai.address, amt, 2, 0, 0],
},
{
connector: connectorName,
method: "payback",
args: [tokens.dai.address, amt.div(2), 2, 0, 0],
args: [tokens.mainnet.dai.address, amt.div(2), 2, 0, 0],
},
];
@ -149,7 +149,7 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "payback",
args: [tokens.dai.address, constants.max_value, 2, 0, 0],
args: [tokens.mainnet.dai.address, constants.max_value, 2, 0, 0],
},
];
@ -167,7 +167,7 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, constants.max_value, 0, 0],
args: [tokens.mainnet.eth.address, constants.max_value, 0, 0],
},
];
@ -185,7 +185,7 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "withdraw",
args: [tokens.eth.address, constants.max_value, 0, 0],
args: [tokens.mainnet.eth.address, constants.max_value, 0, 0],
},
];
@ -205,12 +205,12 @@ describe("Aave V2", function () {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, amt, 0, setId],
args: [tokens.mainnet.eth.address, amt, 0, setId],
},
{
connector: connectorName,
method: "withdraw",
args: [tokens.eth.address, amt, setId, 0],
args: [tokens.mainnet.eth.address, amt, setId, 0],
},
];

View File

@ -37,7 +37,7 @@ describe("B.Compound", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
connector = await deployAndEnableConnector({
connectorName,
contractArtifact: ConnectV2BCompound__factory,

View File

@ -45,7 +45,7 @@ describe("B.Liquity", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
connector = await deployAndEnableConnector({
connectorName,
contractArtifact: ConnectV2BLiquity__factory,

View File

@ -41,7 +41,7 @@ describe("B.Maker", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.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.dai.address)
dai = await ethers.getContractAt("../artifacts/contracts/mainnet/common/interfaces.sol:TokenInterface", tokens.mainnet.dai.address)
console.log("Connector address", connector.address)
})

View File

@ -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.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr);
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex);
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex);
await instaAccountV2DefaultImpl.deployed()
connector = await deployAndEnableConnector({
connectorName,

View File

@ -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.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr);
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex);
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex);
await instaAccountV2DefaultImpl.deployed()
connector = await deployAndEnableConnector({
connectorName,

View File

@ -38,7 +38,7 @@ describe("Compound", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
connector = await deployAndEnableConnector({
connectorName,
contractArtifact: ConnectV2Compound__factory,

View File

@ -38,7 +38,7 @@ describe("Instapool", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
connector = await deployAndEnableConnector({
connectorName,
contractArtifact: ConnectV2Compound__factory,

View File

@ -20,7 +20,7 @@ import {
ConnectV2UniswapV2__factory,
} from "../../../typechain";
const DAI_TOKEN_ADDR = tokens.dai.address; // DAI Token
const DAI_TOKEN_ADDR = tokens.mainnet.dai.address; // DAI Token
// PoolTogether Address: https://docs.pooltogether.com/resources/networks/ethereum
const DAI_PRIZE_POOL_ADDR = "0xEBfb47A7ad0FD6e57323C8A42B2E5A6a4F68fc1a"; // DAI Prize Pool
@ -85,7 +85,7 @@ describe("PoolTogether", function() {
masterSigner = await getMasterSigner();
instaConnectorsV2 = await ethers.getContractAt(
abis.core.connectorsV2,
addresses.core.connectorsV2
addresses.mainnet.core.connectorsV2
);
// Deploy and enable Compound Connector
@ -757,7 +757,7 @@ describe("PoolTogether", function() {
method: "buy",
args: [
POOL_TOKEN_ADDRESS,
tokens.eth.address,
tokens.mainnet.eth.address,
amount,
unitAmount,
0,
@ -769,7 +769,7 @@ describe("PoolTogether", function() {
method: "deposit",
args: [
POOL_TOKEN_ADDRESS,
tokens.eth.address,
tokens.mainnet.eth.address,
amount,
unitAmount,
slippage,

View File

@ -61,7 +61,7 @@ describe("UniswapV3", function() {
masterSigner = await getMasterSigner();
instaConnectorsV2 = await ethers.getContractAt(
abis.core.connectorsV2,
addresses.core.connectorsV2
addresses.mainnet.core.connectorsV2
);
nftManager = await ethers.getContractAt(
abi,

View File

@ -62,7 +62,7 @@ describe("UniswapV3", function () {
],
});
masterSigner = await getMasterSigner()
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.mainnet.core.connectorsV2);
nftManager = await ethers.getContractAt(abi, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88");
connector = await deployAndEnableConnector({
connectorName: connectorStaker,

View File

@ -50,7 +50,7 @@ describe("Yearn", function() {
masterSigner = await getMasterSigner();
instaConnectorsV2 = await ethers.getContractAt(
abis.core.connectorsV2,
addresses.core.connectorsV2
addresses.mainnet.core.connectorsV2
);
connector = await deployAndEnableConnector({
connectorName,

View File

@ -17,7 +17,7 @@ import type { Signer, Contract } from "ethers";
import { ConnectV2AaveV2Polygon__factory, ConnectV2PoolTogetherPolygon__factory } from "../../../typechain";
const DAI_TOKEN_ADDR = tokens.dai.address; // DAI Token
const DAI_TOKEN_ADDR = tokens.polygon.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.core.connectorsV2
addresses.polygon.core.connectorsV2
);
// Deploy and enable Compound Connector
@ -120,7 +120,7 @@ describe("PoolTogether", function() {
{
connector: connectorName,
method: "deposit",
args: [tokens.eth.address, amount, 0, 0],
args: [tokens.polygon.eth.address, amount, 0, 0],
},
];
@ -141,7 +141,7 @@ describe("PoolTogether", function() {
{
connector: connectorName,
method: "borrow",
args: [tokens.usdc.address, amount, 2, 0, setId],
args: [tokens.polygon.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.usdc.address
tokens.polygon.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.usdc.address
tokens.polygon.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.usdc.address
tokens.polygon.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.usdc.address
tokens.polygon.usdc.address
);
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
expect(usdcBalance, `USDC balance less than 10`).to.be.lt(