mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Update to typescript compat
This commit is contained in:
parent
45ab9219ba
commit
1375296859
|
@ -1,16 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
"matic": {
|
|
||||||
"type": "token",
|
|
||||||
"symbol": "MATIC",
|
|
||||||
"name": "Matic",
|
|
||||||
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
||||||
"decimals": 18
|
|
||||||
},
|
|
||||||
"link": {
|
|
||||||
"type": "token",
|
|
||||||
"symbol": "LINK",
|
|
||||||
"name": "ChainLink Token",
|
|
||||||
"address": "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39",
|
|
||||||
"decimals": 18
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export const vaults = {
|
||||||
matic: {
|
matic: {
|
||||||
address: "0xa3fa99a148fa48d14ed51d610c367c61876997f1"
|
address: "0xa3fa99a148fa48d14ed51d610c367c61876997f1"
|
||||||
},
|
},
|
|
@ -65,10 +65,10 @@ const tokenMapping: Record<string, any> = {
|
||||||
},
|
},
|
||||||
polygon: {
|
polygon: {
|
||||||
link: {
|
link: {
|
||||||
impersonateSigner: "0x7d3a61907f6e2ef5ed901b6d9e5baf36827625af",
|
impersonateSigner: "0x54fa8b5918b00f0e5024a2e5255af61bd8ba7b95",
|
||||||
abi: ["function transfer(address to, uint value)"],
|
abi: ["function transfer(address to, uint value)"],
|
||||||
address: "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39",
|
address: "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39",
|
||||||
process: async function (owner, to, amt) {
|
process: async function (owner: Signer | Provider, to: any, amt: any) {
|
||||||
const contract = new ethers.Contract(this.address, this.abi, owner);
|
const contract = new ethers.Contract(this.address, this.abi, owner);
|
||||||
await mineTx(contract.transfer(to, amt));
|
await mineTx(contract.transfer(to, amt));
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,4 +27,11 @@ export const tokens = {
|
||||||
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
||||||
decimals: 6,
|
decimals: 6,
|
||||||
},
|
},
|
||||||
|
link: {
|
||||||
|
type: "token",
|
||||||
|
symbol: "LINK",
|
||||||
|
name: "ChainLink Token",
|
||||||
|
address: "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39",
|
||||||
|
decimals: 18
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,27 +1,28 @@
|
||||||
|
import {Contract, Signer} from "ethers";
|
||||||
|
|
||||||
const { expect } = require("chai");
|
const { expect } = require("chai");
|
||||||
const hre = require("hardhat");
|
const hre = require("hardhat");
|
||||||
const abis = require("../../scripts/constant/abis");
|
const { abis } = require("../../../scripts/constant/abis");
|
||||||
const addresses = require("../../scripts/constant/addresses");
|
const { addresses } = require("../../../scripts/tests/polygon/addresses");
|
||||||
const deployAndEnableConnector = require("../../scripts/deployAndEnableConnector");
|
const { tokens } = require("../../../scripts/tests/polygon/tokens");
|
||||||
const getMasterSigner = require("../../scripts/getMasterSigner");
|
const { deployAndEnableConnector } = require("../../../scripts/tests/deployAndEnableConnector");
|
||||||
const buildDSAv2 = require("../../scripts/buildDSAv2");
|
const { getMasterSigner } = require("../../../scripts/tests/getMasterSigner");
|
||||||
const ConnectV2QiDaoPolygon = require("../../artifacts/contracts/polygon/connectors/qidao/main.sol/ConnectV2QiDaoPolygon.json");
|
const { buildDSAv2 } = require("../../../scripts/tests/buildDSAv2");
|
||||||
|
const ConnectV2QiDaoPolygon = require("../../../artifacts/contracts/polygon/connectors/qidao/main.sol/ConnectV2QiDaoPolygon.json");
|
||||||
const { parseEther } = require("@ethersproject/units");
|
const { parseEther } = require("@ethersproject/units");
|
||||||
const encodeSpells = require("../../scripts/encodeSpells");
|
const { encodeSpells } = require("../../../scripts/tests/encodeSpells");
|
||||||
const polygonTokens = require("../../scripts/constant/qidao/polygonTokens");
|
const { vaults } = require("../../../scripts/constant/qidao/vaults");
|
||||||
const vaults = require("../../scripts/constant/qidao/vaults");
|
const { addLiquidity } = require("../../../scripts/tests/addLiquidity");
|
||||||
const constants = require("../../scripts/constant/constant");
|
|
||||||
const addLiquidity = require("../../scripts/addLiquidity");
|
|
||||||
const { ethers } = hre;
|
const { ethers } = hre;
|
||||||
|
|
||||||
describe("QiDao", function() {
|
describe("QiDao", function() {
|
||||||
const connectorName = "QIDAO-TEST-A";
|
const connectorName = "QIDAO-TEST-A";
|
||||||
|
|
||||||
let wallet0, wallet1;
|
let wallet0: any, wallet1: any;
|
||||||
let dsaWallet0;
|
let dsaWallet0: any;
|
||||||
let instaConnectorsV2;
|
let instaConnectorsV2: Contract;
|
||||||
let connector;
|
let connector: any;
|
||||||
let masterSigner;
|
let masterSigner: Signer;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await hre.network.provider.request({
|
await hre.network.provider.request({
|
||||||
|
@ -51,7 +52,7 @@ describe("QiDao", function() {
|
||||||
it("should have contracts deployed", async () => {
|
it("should have contracts deployed", async () => {
|
||||||
expect(!!instaConnectorsV2.address).to.be.true;
|
expect(!!instaConnectorsV2.address).to.be.true;
|
||||||
expect(!!connector.address).to.be.true;
|
expect(!!connector.address).to.be.true;
|
||||||
expect(!!masterSigner.address).to.be.true;
|
expect(!!await masterSigner.getAddress()).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("DSA wallet setup", function() {
|
describe("DSA wallet setup", function() {
|
||||||
|
@ -88,7 +89,7 @@ describe("QiDao", function() {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
method: "deposit",
|
||||||
args: [polygonTokens.matic.address, vaults.matic.address, 0, amt, setVaultId, 0, 0, 0],
|
args: [tokens.matic.address, vaults.matic.address, 0, amt, setVaultId, 0, 0, 0],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
|
@ -103,7 +104,7 @@ describe("QiDao", function() {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
method: "withdraw",
|
||||||
args: [polygonTokens.matic.address, vaults.matic.address, 0, amt.mul(995).div(1000), setVaultId, 0, 0, 0],
|
args: [tokens.matic.address, vaults.matic.address, 0, amt.mul(995).div(1000), setVaultId, 0, 0, 0],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -132,7 +133,7 @@ describe("QiDao", function() {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
method: "deposit",
|
||||||
args: [polygonTokens.link.address, vaults.link.address, 0, amt, setVaultId, 0, 0, 0],
|
args: [tokens.link.address, vaults.link.address, 0, amt, setVaultId, 0, 0, 0],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
|
@ -147,7 +148,7 @@ describe("QiDao", function() {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
method: "withdraw",
|
||||||
args: [polygonTokens.link.address, vaults.link.address, 0, amt.mul(995).div(1000), setVaultId, 0, 0, 0],
|
args: [tokens.link.address, vaults.link.address, 0, amt.mul(995).div(1000), setVaultId, 0, 0, 0],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user