mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
updated scripts
This commit is contained in:
parent
06e5295533
commit
ec124db7a1
|
@ -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",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -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,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -4,7 +4,7 @@ const { deploy } = deployments;
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const deployer = (await getUnnamedAccounts())[0];
|
const deployer = (await getUnnamedAccounts())[0];
|
||||||
const connector = "ConnectV2InstaPoolV3Avalanche";
|
const connector = "// Add connector name over here Eg: ConnectV2InstaPoolV3Avalanche"
|
||||||
|
|
||||||
const connectorInstance = await deploy(connector, {
|
const connectorInstance = await deploy(connector, {
|
||||||
from: deployer,
|
from: deployer,
|
||||||
|
|
11
scripts/tests/arbitrum/addresses.ts
Normal file
11
scripts/tests/arbitrum/addresses.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export default {
|
||||||
|
connectors: {
|
||||||
|
// basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7",
|
||||||
|
// auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D",
|
||||||
|
// "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b",
|
||||||
|
},
|
||||||
|
core: {
|
||||||
|
connectorsV2: "0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B",
|
||||||
|
instaIndex: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288",
|
||||||
|
},
|
||||||
|
};
|
23
scripts/tests/arbitrum/tokens.ts
Normal file
23
scripts/tests/arbitrum/tokens.ts
Normal file
|
@ -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,
|
||||||
|
},
|
||||||
|
};
|
11
scripts/tests/avalanche/addresses.ts
Normal file
11
scripts/tests/avalanche/addresses.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export default {
|
||||||
|
connectors: {
|
||||||
|
// basic: "0x6214f9c4F9700fc7a50B5f9aEEB819d647406Ac7",
|
||||||
|
// auth: "0xD6daA927ad756a4022858dddcc4E26137b30DB4D",
|
||||||
|
// "INSTAPOOL-A": "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b",
|
||||||
|
},
|
||||||
|
core: {
|
||||||
|
connectorsV2: "0x67fCE99Dd6d8d659eea2a1ac1b8881c57eb6592B",
|
||||||
|
instaIndex: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288",
|
||||||
|
},
|
||||||
|
};
|
23
scripts/tests/avalanche/tokens.ts
Normal file
23
scripts/tests/avalanche/tokens.ts
Normal file
|
@ -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,
|
||||||
|
},
|
||||||
|
};
|
|
@ -7,8 +7,8 @@ import { abi } from "../../deployements/mainnet/Implementation_m1.sol/InstaImple
|
||||||
|
|
||||||
function getAddress(network: string | undefined) {
|
function getAddress(network: string | undefined) {
|
||||||
if (network === "polygon") return addressesPolygon.core.instaIndex;
|
if (network === "polygon") return addressesPolygon.core.instaIndex;
|
||||||
// else if (network === "arbitrum") return addressesPolygon.core.instaIndex;
|
else if (network === "arbitrum") return addressesPolygon.core.instaIndex;
|
||||||
// else if (network === "avalanche") return addressesPolygon.core.instaIndex;
|
else if (network === "avalanche") return addressesPolygon.core.instaIndex;
|
||||||
else return addresses.core.instaIndex;
|
else return addresses.core.instaIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@ import { encodeSpells } from "./encodeSpells";
|
||||||
|
|
||||||
export default function encodeFlashcastData(spells: any) {
|
export default function encodeFlashcastData(spells: any) {
|
||||||
const encodeSpellsData = encodeSpells(spells);
|
const encodeSpellsData = encodeSpells(spells);
|
||||||
const targetType = "string[]";
|
let argTypes = ["string[]", "bytes[]"];
|
||||||
let argTypes = [targetType, "bytes[]"];
|
|
||||||
return web3.eth.abi.encodeParameters(argTypes, [
|
return web3.eth.abi.encodeParameters(argTypes, [
|
||||||
encodeSpellsData[0],
|
encodeSpellsData[0],
|
||||||
encodeSpellsData[1],
|
encodeSpellsData[1],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const addresses: Record<string, any> = {
|
export default {
|
||||||
"connectors": {
|
"connectors": {
|
||||||
"basic": "0xe5398f279175962E56fE4c5E0b62dc7208EF36c6",
|
"basic": "0xe5398f279175962E56fE4c5E0b62dc7208EF36c6",
|
||||||
"auth": "0xd1aff9f2acf800c876c409100d6f39aea93fc3d9",
|
"auth": "0xd1aff9f2acf800c876c409100d6f39aea93fc3d9",
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
export const constants = {
|
|
||||||
address_zero: "0x0000000000000000000000000000000000000000",
|
|
||||||
native_address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
||||||
max_value:
|
|
||||||
"115792089237316195423570985008687907853269984665640564039457584007913129639935",
|
|
||||||
};
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const addresses: Record<string, any> = {
|
export default {
|
||||||
connectors: {
|
connectors: {
|
||||||
basic: "0x1cAF5EC802ca602E98139AD96A8f2B7BC524264E",
|
basic: "0x1cAF5EC802ca602E98139AD96A8f2B7BC524264E",
|
||||||
auth: "0xf6474aD0dA75A0dE15D2c915e601D9f754B9e6fe",
|
auth: "0xf6474aD0dA75A0dE15D2c915e601D9f754B9e6fe",
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
export const constant = {
|
|
||||||
address_zero: "0x0000000000000000000000000000000000000000",
|
|
||||||
eth_addr: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
||||||
matic_addr: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
||||||
max_value:
|
|
||||||
"115792089237316195423570985008687907853269984665640564039457584007913129639935",
|
|
||||||
};
|
|
|
@ -1,14 +1,14 @@
|
||||||
import hre from "hardhat";
|
import hre from "hardhat";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import abis from "../../../scripts/constant/abis";
|
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 { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { ConnectV2AaveV1, ConnectV2AaveV1__factory } from "../../../typechain";
|
import { ConnectV2AaveV1, ConnectV2AaveV1__factory } from "../../../typechain";
|
||||||
import { parseEther } from "@ethersproject/units";
|
import { parseEther } from "@ethersproject/units";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
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 { constants } from "../../../scripts/constant/constant";
|
||||||
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
||||||
const { ethers } = hre;
|
const { ethers } = hre;
|
||||||
|
@ -41,7 +41,7 @@ describe("Aave V1", function () {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.mainnet.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
|
@ -85,7 +85,7 @@ describe("Aave V1", function () {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
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,
|
connector: connectorName,
|
||||||
method: "borrow",
|
method: "borrow",
|
||||||
args: [tokens.mainnet.dai.address, amt, 0, 0],
|
args: [tokens.dai.address, amt, 0, 0],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "payback",
|
method: "payback",
|
||||||
// FIXME: we need to pass max_value because of roundoff/shortfall errors
|
// 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,
|
connector: connectorName,
|
||||||
method: "deposit",
|
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,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
method: "withdraw",
|
||||||
args: [tokens.mainnet.eth.address, constants.max_value, 0, 0],
|
args: [tokens.eth.address, constants.max_value, 0, 0],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import hre from "hardhat";
|
import hre from "hardhat";
|
||||||
import abis from "../../../scripts/constant/abis";
|
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 { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { ConnectV2AaveV2, ConnectV2AaveV2__factory } from "../../../typechain";
|
import { ConnectV2AaveV2, ConnectV2AaveV2__factory } from "../../../typechain";
|
||||||
import { parseEther } from "@ethersproject/units";
|
import { parseEther } from "@ethersproject/units";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
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 { constants } from "../../../scripts/constant/constant";
|
||||||
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
||||||
const { ethers } = hre;
|
const { ethers } = hre;
|
||||||
|
@ -39,7 +39,7 @@ describe("Aave V2", function () {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.mainnet.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
|
@ -80,7 +80,7 @@ describe("Aave V2", function () {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
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,
|
connector: connectorName,
|
||||||
method: "borrow",
|
method: "borrow",
|
||||||
args: [tokens.mainnet.dai.address, amt, 2, 0, setId],
|
args: [tokens.dai.address, amt, 2, 0, setId],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "payback",
|
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,
|
connector: connectorName,
|
||||||
method: "borrow",
|
method: "borrow",
|
||||||
args: [tokens.mainnet.dai.address, amt, 2, 0, 0],
|
args: [tokens.dai.address, amt, 2, 0, 0],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "payback",
|
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,
|
connector: connectorName,
|
||||||
method: "payback",
|
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,
|
connector: connectorName,
|
||||||
method: "deposit",
|
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,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
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,
|
connector: connectorName,
|
||||||
method: "deposit",
|
method: "deposit",
|
||||||
args: [tokens.mainnet.eth.address, amt, 0, setId],
|
args: [tokens.eth.address, amt, 0, setId],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
method: "withdraw",
|
||||||
args: [tokens.mainnet.eth.address, amt, setId, 0],
|
args: [tokens.eth.address, amt, setId, 0],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
import { constants } from "../../../scripts/constant/constant";
|
||||||
import { ConnectV2BCompound__factory } from "../../../typechain";
|
import { ConnectV2BCompound__factory } from "../../../typechain";
|
||||||
|
@ -37,7 +37,7 @@ describe("B.Compound", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2BCompound__factory,
|
contractArtifact: ConnectV2BCompound__factory,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
||||||
import abis from "../../../scripts/constant/abis";
|
import abis from "../../../scripts/constant/abis";
|
||||||
import { ConnectV2BLiquity__factory } from "../../../typechain";
|
import { ConnectV2BLiquity__factory } from "../../../typechain";
|
||||||
import type { Signer, Contract } from "ethers";
|
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 LUSD_WHALE = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb" // stability pool
|
||||||
const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598"
|
const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598"
|
||||||
|
@ -45,7 +45,7 @@ describe("B.Liquity", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2BLiquity__factory,
|
contractArtifact: ConnectV2BLiquity__factory,
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import { tokens } from "../../../scripts/constant/tokens";
|
import { tokens } from "../../../scripts/tests/mainnet/tokens";
|
||||||
import { ConnectV2BMakerDAO__factory } from "../../../typechain";
|
import { ConnectV2BMakerDAO__factory } from "../../../typechain";
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ describe("B.Maker", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2BMakerDAO__factory,
|
contractArtifact: ConnectV2BMakerDAO__factory,
|
||||||
|
@ -51,7 +51,7 @@ describe("B.Maker", function () {
|
||||||
|
|
||||||
manager = await ethers.getContractAt("BManagerLike", "0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed")
|
manager = await ethers.getContractAt("BManagerLike", "0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed")
|
||||||
vat = await ethers.getContractAt("../artifacts/contracts/mainnet/connectors/b.protocol/makerdao/interface.sol:VatLike", await manager.vat())
|
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)
|
console.log("Connector address", connector.address)
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis"
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
|
@ -64,11 +64,11 @@ describe("BASIC-ERC1155", function () {
|
||||||
);
|
);
|
||||||
nftContract = await ethers.getContractAt(IERC1155__factory.abi, TOKEN_CONTRACT_ADDR)
|
nftContract = await ethers.getContractAt(IERC1155__factory.abi, TOKEN_CONTRACT_ADDR)
|
||||||
masterSigner = await getMasterSigner()
|
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);
|
instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr);
|
||||||
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
|
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
|
||||||
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex);
|
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex);
|
||||||
await instaAccountV2DefaultImpl.deployed()
|
await instaAccountV2DefaultImpl.deployed()
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis"
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
|
@ -64,11 +64,11 @@ describe("BASIC-ERC721", function () {
|
||||||
);
|
);
|
||||||
nftContract = await ethers.getContractAt(IERC721__factory.abi, TOKEN_CONTRACT_ADDR)
|
nftContract = await ethers.getContractAt(IERC721__factory.abi, TOKEN_CONTRACT_ADDR)
|
||||||
masterSigner = await getMasterSigner()
|
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);
|
instaImplementationsMapping = await ethers.getContractAt(abi, implementationsMappingAddr);
|
||||||
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
|
InstaAccountV2DefaultImpl = await ethers.getContractFactory("InstaDefaultImplementation")
|
||||||
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.mainnet.core.instaIndex);
|
instaAccountV2DefaultImpl = await InstaAccountV2DefaultImpl.deploy(addresses.core.instaIndex);
|
||||||
await instaAccountV2DefaultImpl.deployed()
|
await instaAccountV2DefaultImpl.deployed()
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
import { constants } from "../../../scripts/constant/constant";
|
||||||
import { ConnectV2Compound__factory } from "../../../typechain";
|
import { ConnectV2Compound__factory } from "../../../typechain";
|
||||||
|
@ -38,7 +38,7 @@ describe("Compound", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2Compound__factory,
|
contractArtifact: ConnectV2Compound__factory,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import encodeFlashcastData from "../../../scripts/tests/encodeFlashcastData"
|
import encodeFlashcastData from "../../../scripts/tests/encodeFlashcastData"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
import { ConnectV2Compound__factory } from "../../../typechain";
|
import { ConnectV2Compound__factory } from "../../../typechain";
|
||||||
|
@ -38,7 +38,7 @@ describe("Instapool", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2Compound__factory,
|
contractArtifact: ConnectV2Compound__factory,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
||||||
|
|
||||||
// Instadapp instadappAddresses/ABIs
|
// Instadapp instadappAddresses/ABIs
|
||||||
import instadappAddresses from "../../../scripts/constant/addresses";
|
import instadappAddresses from "../../../scripts/tests/mainnet/addresses";
|
||||||
import abis from "../../../scripts/constant/abis";
|
import abis from "../../../scripts/constant/abis";
|
||||||
|
|
||||||
// Instadapp Liquity Connector artifacts
|
// Instadapp Liquity Connector artifacts
|
||||||
|
@ -138,7 +138,7 @@ const deployAndConnect = async (contracts: any, isDebug = false) => {
|
||||||
const masterSigner = await getMasterSigner();
|
const masterSigner = await getMasterSigner();
|
||||||
const instaConnectorsV2 = await ethers.getContractAt(
|
const instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
instadappAddresses.mainnet.core.connectorsV2
|
instadappAddresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
const connector = await deployAndEnableConnector({
|
const connector = await deployAndEnableConnector({
|
||||||
connectorName: LIQUITY_CONNECTOR,
|
connectorName: LIQUITY_CONNECTOR,
|
||||||
|
|
|
@ -8,10 +8,10 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
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 type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -20,7 +20,7 @@ import {
|
||||||
ConnectV2UniswapV2__factory,
|
ConnectV2UniswapV2__factory,
|
||||||
} from "../../../typechain";
|
} 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
|
// PoolTogether Address: https://docs.pooltogether.com/resources/networks/ethereum
|
||||||
const DAI_PRIZE_POOL_ADDR = "0xEBfb47A7ad0FD6e57323C8A42B2E5A6a4F68fc1a"; // DAI Prize Pool
|
const DAI_PRIZE_POOL_ADDR = "0xEBfb47A7ad0FD6e57323C8A42B2E5A6a4F68fc1a"; // DAI Prize Pool
|
||||||
|
@ -98,7 +98,7 @@ describe("PoolTogether", function() {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.mainnet.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
|
|
||||||
// Deploy and enable Compound Connector
|
// Deploy and enable Compound Connector
|
||||||
|
@ -770,7 +770,7 @@ describe("PoolTogether", function() {
|
||||||
method: "buy",
|
method: "buy",
|
||||||
args: [
|
args: [
|
||||||
POOL_TOKEN_ADDRESS,
|
POOL_TOKEN_ADDRESS,
|
||||||
tokens.mainnet.eth.address,
|
tokens.eth.address,
|
||||||
amount,
|
amount,
|
||||||
unitAmount,
|
unitAmount,
|
||||||
0,
|
0,
|
||||||
|
@ -782,7 +782,7 @@ describe("PoolTogether", function() {
|
||||||
method: "deposit",
|
method: "deposit",
|
||||||
args: [
|
args: [
|
||||||
POOL_TOKEN_ADDRESS,
|
POOL_TOKEN_ADDRESS,
|
||||||
tokens.mainnet.eth.address,
|
tokens.eth.address,
|
||||||
amount,
|
amount,
|
||||||
unitAmount,
|
unitAmount,
|
||||||
slippage,
|
slippage,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
||||||
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ describe("UniswapV3", function() {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.mainnet.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
nftManager = await ethers.getContractAt(
|
nftManager = await ethers.getContractAt(
|
||||||
abi,
|
abi,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
||||||
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
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 abis from "../../../scripts/constant/abis";
|
||||||
import { abi } from "@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"
|
import { abi } from "@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"
|
||||||
import type { Signer, Contract } from "ethers";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
@ -62,7 +62,7 @@ describe("UniswapV3", function () {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner()
|
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");
|
nftManager = await ethers.getContractAt(abi, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88");
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName: connectorStaker,
|
connectorName: connectorStaker,
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
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 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 { Signer, Contract, BigNumber } from "ethers";
|
||||||
|
|
||||||
import { ConnectV2YearnV2__factory } from "../../../typechain";
|
import { ConnectV2YearnV2__factory } from "../../../typechain";
|
||||||
|
@ -50,7 +50,7 @@ describe("Yearn", function() {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.mainnet.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
|
|
|
@ -10,14 +10,14 @@ import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
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 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 type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
import { ConnectV2AaveV2Polygon__factory, ConnectV2PoolTogetherPolygon__factory } from "../../../typechain";
|
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
|
// PoolTogether Address: https://docs.pooltogether.com/resources/networks/matic
|
||||||
const USDC_PRIZE_POOL_ADDR = "0xEE06AbE9e2Af61cabcb13170e01266Af2DEFa946"; // USDC Prize Pool
|
const USDC_PRIZE_POOL_ADDR = "0xEE06AbE9e2Af61cabcb13170e01266Af2DEFa946"; // USDC Prize Pool
|
||||||
const PT_USDC_TICKET_ADDR = "0x473E484c722EF9ec6f63B509b07Bb9cfB258820b"; // PT USDC Ticket
|
const PT_USDC_TICKET_ADDR = "0x473E484c722EF9ec6f63B509b07Bb9cfB258820b"; // PT USDC Ticket
|
||||||
|
@ -69,7 +69,7 @@ describe("PoolTogether", function() {
|
||||||
masterSigner = await getMasterSigner();
|
masterSigner = await getMasterSigner();
|
||||||
instaConnectorsV2 = await ethers.getContractAt(
|
instaConnectorsV2 = await ethers.getContractAt(
|
||||||
abis.core.connectorsV2,
|
abis.core.connectorsV2,
|
||||||
addresses.polygon.core.connectorsV2
|
addresses.core.connectorsV2
|
||||||
);
|
);
|
||||||
|
|
||||||
// Deploy and enable Compound Connector
|
// Deploy and enable Compound Connector
|
||||||
|
@ -120,7 +120,7 @@ describe("PoolTogether", function() {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
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,
|
connector: connectorName,
|
||||||
method: "borrow",
|
method: "borrow",
|
||||||
args: [tokens.polygon.usdc.address, amount, 2, 0, setId],
|
args: [tokens.usdc.address, amount, 2, 0, setId],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: ptConnectorName,
|
connector: ptConnectorName,
|
||||||
|
@ -158,7 +158,7 @@ describe("PoolTogether", function() {
|
||||||
// Before Spell
|
// Before Spell
|
||||||
let usdcToken = await ethers.getContractAt(
|
let usdcToken = await ethers.getContractAt(
|
||||||
abis.basic.erc20,
|
abis.basic.erc20,
|
||||||
tokens.polygon.usdc.address
|
tokens.usdc.address
|
||||||
);
|
);
|
||||||
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
||||||
expect(usdcBalance, `USDC balance is 0`).to.be.eq(
|
expect(usdcBalance, `USDC balance is 0`).to.be.eq(
|
||||||
|
@ -239,7 +239,7 @@ describe("PoolTogether", function() {
|
||||||
// Before spell
|
// Before spell
|
||||||
let usdcToken = await ethers.getContractAt(
|
let usdcToken = await ethers.getContractAt(
|
||||||
abis.basic.erc20,
|
abis.basic.erc20,
|
||||||
tokens.polygon.usdc.address
|
tokens.usdc.address
|
||||||
);
|
);
|
||||||
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
||||||
expect(usdcBalance, `USDC balance equals 0`).to.be.eq(
|
expect(usdcBalance, `USDC balance equals 0`).to.be.eq(
|
||||||
|
@ -330,7 +330,7 @@ describe("PoolTogether", function() {
|
||||||
// Before spell
|
// Before spell
|
||||||
let usdcToken = await ethers.getContractAt(
|
let usdcToken = await ethers.getContractAt(
|
||||||
abis.basic.erc20,
|
abis.basic.erc20,
|
||||||
tokens.polygon.usdc.address
|
tokens.usdc.address
|
||||||
);
|
);
|
||||||
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
||||||
expect(usdcBalance, `USDC Balance equals 100`).to.be.eq(
|
expect(usdcBalance, `USDC Balance equals 100`).to.be.eq(
|
||||||
|
@ -394,7 +394,7 @@ describe("PoolTogether", function() {
|
||||||
// Before spell
|
// Before spell
|
||||||
let usdcToken = await ethers.getContractAt(
|
let usdcToken = await ethers.getContractAt(
|
||||||
abis.basic.erc20,
|
abis.basic.erc20,
|
||||||
tokens.polygon.usdc.address
|
tokens.usdc.address
|
||||||
);
|
);
|
||||||
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
let usdcBalance = await usdcToken.balanceOf(dsaWallet0.address);
|
||||||
expect(usdcBalance, `USDC balance less than 10`).to.be.lt(
|
expect(usdcBalance, `USDC balance less than 10`).to.be.lt(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user