added test runner scripts + test cases fix

This commit is contained in:
pradyuman-verma 2021-12-06 16:17:14 +05:30 committed by Ishan Jain
parent 2d594b0ad7
commit c2ccad9668
17 changed files with 5569 additions and 4386 deletions

878
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,12 @@
"description": "",
"directories": {},
"scripts": {
"test": "hardhat test",
"test": "hardhat run scripts/tests/global-test.ts",
"coverage": "./node_modules/.bin/solidity-coverage",
"check": "node status-checks/huskyCheck.js",
"check-husky": "node status-checks/huskyCheck.js",
"deploy": "node scripts/deployConnectorsFromCmd.js"
"deploy": "node scripts/deployConnectorsFromCmd.js",
"test:runner": "hardhat run scripts/tests/run-tests.ts"
},
"repository": {
"type": "git",
@ -29,6 +30,7 @@
"chalk": "^5.0.0",
"dotenv": "^10.0.0",
"hardhat-docgen": "^1.2.0",
"inquirer": "^8.2.0",
"minimist": "^1.2.5",
"solc": "^0.8.10",
"typechain": "^6.0.5"
@ -43,6 +45,7 @@
"@tenderly/hardhat-tenderly": "^1.0.13",
"@types/chai": "^4.2.22",
"@types/chai-as-promised": "^7.1.4",
"@types/inquirer": "^8.1.3",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.11",
"chai": "^4.3.4",

33
scripts/tests/command.ts Normal file
View File

@ -0,0 +1,33 @@
import { execFile, spawn } from "child_process";
interface ICommand {
readonly cmd: string;
readonly args: string[];
readonly env: {
[param: string]: string;
};
}
export async function execScript(input: ICommand): Promise<number> {
return new Promise((resolve, reject) => {
let cmdEnv = Object.create(process.env);
for (let param in input.env) {
cmdEnv[param] = input.env[param];
}
const proc = spawn(input.cmd, [...input.args], {
env: cmdEnv,
shell: true,
stdio: "inherit",
});
proc.on("exit", (code) => {
if (code !== 0) {
reject(code);
return;
}
resolve(code);
});
});
}

View File

@ -1,7 +1,7 @@
import hre from "hardhat";
const { web3 } = hre;
import { encodeSpells } from "./encodeSpells.js";
import { encodeSpells } from "./encodeSpells";
export default function encodeFlashcastData(spells: any) {
const encodeSpellsData = encodeSpells(spells);

View File

@ -0,0 +1,44 @@
import { promises as fs } from "fs";
import { join } from "path";
import { execScript } from "./command";
let start: number, end: number;
async function testRunner() {
const chain = ["avalanche", "mainnet", "polygon"];
start = Date.now();
for (let ch of chain) {
console.log(`📗Running test for %c${ch}: `, "blue");
let path: string;
const testsPath = join(__dirname, "../../test", ch);
await fs.access(testsPath);
const availableTests = await fs.readdir(testsPath);
if (availableTests.length !== 0) {
for (let test of availableTests) {
path = join(testsPath, test);
path += "/*";
await execScript({
cmd: "npx",
args: ["hardhat", "test", path],
env: {
networkType: ch,
},
});
}
}
}
end = Date.now();
}
testRunner()
.then(() =>
console.log(
`🙌 finished running the test, total time taken ${(end - start) /
1000} sec`
)
)
.catch((err) => console.error("❌ failed due to error: ", err));

View File

@ -0,0 +1,58 @@
import inquirer from "inquirer";
import { promises as fs } from "fs";
import { join } from "path";
import { execScript } from "./command";
let start: number, end: number;
async function testRunner() {
const { chain } = await inquirer.prompt([
{
name: "chain",
message: "What chain do you want to run tests on?",
type: "list",
choices: ["mainnet", "polygon", "avalanche", "arbitrum"],
},
]);
const testsPath = join(__dirname, "../../test", chain);
await fs.access(testsPath);
const availableTests = await fs.readdir(testsPath);
if (availableTests.length === 0) {
throw new Error(`No tests available for ${chain}`);
}
const { testName } = await inquirer.prompt([
{
name: "testName",
message: "For which resolver you want to run the tests?",
type: "list",
choices: ["all", ...availableTests],
},
]);
start = Date.now();
let path: string;
if (testName === "all") {
path = availableTests.map((file) => join(testsPath, file)).join(" ");
} else {
path = join(testsPath, testName);
}
path += "/*";
await execScript({
cmd: "npx",
args: ["hardhat", "test", path],
env: {
networkType: chain,
},
});
end = Date.now();
}
testRunner()
.then(() =>
console.log(
`🙌 finished the test runner, time taken ${(end - start) / 1000} sec`
)
)
.catch((err) => console.error("❌ failed due to error: ", err));

View File

@ -51,8 +51,8 @@ describe("Uniswap-sell-beta", function () {
}
beforeEach(async () => {
const account0 = "0x36cc7B13029B5DEe4034745FB4F24034f3F2ffc6";
const account1 = "0xce2cc46682e9c6d5f174af598fb4931a9c0be68e";
const account0 = "0xa067668661c84476afcdc6fa5d758c4c01c34352";
const account1 = "0x0db3fe3b770c95a0b99d1ed6f2627933466c0dd8";
const [owner, add1, add2] = await ethers.getSigners();
await impersonate(owner.address, account1, USDC_ADDR, 6);

View File

@ -10,7 +10,7 @@ import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
import { addresses } from "../../../scripts/constant/addresses";
import { abis } from "../../../scripts/constant/abis";
import { constants } from "../../../scripts/constant/constant";
import { ConnectV2Compound__factory } from "../../../typechain";
import { ConnectV2BCompound__factory } from "../../../typechain";
import type { Signer, Contract } from "ethers";
describe("B.Compound", function () {
@ -19,7 +19,7 @@ describe("B.Compound", function () {
let dsaWallet0: any;
let masterSigner: Signer;
let instaConnectorsV2: Contract;
let connector: any;
let connector: Contract;
const wallets = provider.getWallets()
const [wallet0, wallet1, wallet2, wallet3] = wallets
@ -40,7 +40,7 @@ describe("B.Compound", function () {
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
connector = await deployAndEnableConnector({
connectorName,
contractArtifact: ConnectV2Compound__factory,
contractArtifact: ConnectV2BCompound__factory,
signer: masterSigner,
connectors: instaConnectorsV2
})

View File

@ -56,9 +56,8 @@ describe("BASIC-ERC1155", function () {
await hre.network.provider.send("hardhat_setBalance", [
TOKEN_OWNER_ADDR,
"0x1000000000000000",
"0x10000000000000000",
]);
// get tokenOwner
tokenOwner = await ethers.getSigner(
TOKEN_OWNER_ADDR

View File

@ -55,7 +55,7 @@ describe("BASIC-ERC721", function () {
await network.provider.send("hardhat_setBalance", [
TOKEN_OWNER_ADDR,
"0x1000000000000000",
"0x10000000000000000",
]);
// get tokenOwner

View File

@ -1,95 +1,95 @@
const TROVE_MANAGER_ADDRESS = "0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2";
const TROVE_MANAGER_ABI = [
"function getTroveColl(address _borrower) external view returns (uint)",
"function getTroveDebt(address _borrower) external view returns (uint)",
"function getTroveStatus(address _borrower) external view returns (uint)",
"function redeemCollateral(uint _LUSDAmount, address _firstRedemptionHint, address _upperPartialRedemptionHint, address _lowerPartialRedemptionHint, uint _partialRedemptionHintNICR, uint _maxIterations, uint _maxFee) external returns (uint)",
"function getNominalICR(address _borrower) external view returns (uint)",
"function liquidate(address _borrower) external",
"function liquidateTroves(uint _n) external",
];
// const TROVE_MANAGER_ADDRESS = "0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2";
// const TROVE_MANAGER_ABI = [
// "function getTroveColl(address _borrower) external view returns (uint)",
// "function getTroveDebt(address _borrower) external view returns (uint)",
// "function getTroveStatus(address _borrower) external view returns (uint)",
// "function redeemCollateral(uint _LUSDAmount, address _firstRedemptionHint, address _upperPartialRedemptionHint, address _lowerPartialRedemptionHint, uint _partialRedemptionHintNICR, uint _maxIterations, uint _maxFee) external returns (uint)",
// "function getNominalICR(address _borrower) external view returns (uint)",
// "function liquidate(address _borrower) external",
// "function liquidateTroves(uint _n) external",
// ];
const BORROWER_OPERATIONS_ADDRESS =
"0x24179CD81c9e782A4096035f7eC97fB8B783e007";
const BORROWER_OPERATIONS_ABI = [
"function openTrove(uint256 _maxFee, uint256 _LUSDAmount, address _upperHint, address _lowerHint) external payable",
"function closeTrove() external",
];
// const BORROWER_OPERATIONS_ADDRESS =
// "0x24179CD81c9e782A4096035f7eC97fB8B783e007";
// const BORROWER_OPERATIONS_ABI = [
// "function openTrove(uint256 _maxFee, uint256 _LUSDAmount, address _upperHint, address _lowerHint) external payable",
// "function closeTrove() external",
// ];
const LUSD_TOKEN_ADDRESS = "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0";
const LUSD_TOKEN_ABI = [
"function transfer(address _to, uint256 _value) public returns (bool success)",
"function balanceOf(address account) external view returns (uint256)",
"function approve(address spender, uint256 amount) external returns (bool)",
];
// const LUSD_TOKEN_ADDRESS = "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0";
// const LUSD_TOKEN_ABI = [
// "function transfer(address _to, uint256 _value) public returns (bool success)",
// "function balanceOf(address account) external view returns (uint256)",
// "function approve(address spender, uint256 amount) external returns (bool)",
// ];
const ACTIVE_POOL_ADDRESS = "0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F";
const ACTIVE_POOL_ABI = ["function getLUSDDebt() external view returns (uint)"];
// const ACTIVE_POOL_ADDRESS = "0xDf9Eb223bAFBE5c5271415C75aeCD68C21fE3D7F";
// const ACTIVE_POOL_ABI = ["function getLUSDDebt() external view returns (uint)"];
const PRICE_FEED_ADDRESS = "0x4c517D4e2C851CA76d7eC94B805269Df0f2201De";
const PRICE_FEED_ABI = ["function fetchPrice() external returns (uint)"];
// const PRICE_FEED_ADDRESS = "0x4c517D4e2C851CA76d7eC94B805269Df0f2201De";
// const PRICE_FEED_ABI = ["function fetchPrice() external returns (uint)"];
const HINT_HELPERS_ADDRESS = "0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0";
const HINT_HELPERS_ABI = [
"function getRedemptionHints(uint _LUSDamount, uint _price, uint _maxIterations) external view returns (address firstRedemptionHint, uint partialRedemptionHintNICR, uint truncatedLUSDamount)",
"function getApproxHint(uint _CR, uint _numTrials, uint _inputRandomSeed) view returns (address hintAddress, uint diff, uint latestRandomSeed)",
"function computeNominalCR(uint _coll, uint _debt) external pure returns (uint)",
];
// const HINT_HELPERS_ADDRESS = "0xE84251b93D9524E0d2e621Ba7dc7cb3579F997C0";
// const HINT_HELPERS_ABI = [
// "function getRedemptionHints(uint _LUSDamount, uint _price, uint _maxIterations) external view returns (address firstRedemptionHint, uint partialRedemptionHintNICR, uint truncatedLUSDamount)",
// "function getApproxHint(uint _CR, uint _numTrials, uint _inputRandomSeed) view returns (address hintAddress, uint diff, uint latestRandomSeed)",
// "function computeNominalCR(uint _coll, uint _debt) external pure returns (uint)",
// ];
const SORTED_TROVES_ADDRESS = "0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6";
const SORTED_TROVES_ABI = [
"function findInsertPosition(uint256 _ICR, address _prevId, address _nextId) external view returns (address, address)",
"function getLast() external view returns (address)",
];
// const SORTED_TROVES_ADDRESS = "0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6";
// const SORTED_TROVES_ABI = [
// "function findInsertPosition(uint256 _ICR, address _prevId, address _nextId) external view returns (address, address)",
// "function getLast() external view returns (address)",
// ];
const STABILITY_POOL_ADDRESS = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb";
const STABILITY_POOL_ABI = [
"function getCompoundedLUSDDeposit(address _depositor) external view returns (uint)",
"function getDepositorETHGain(address _depositor) external view returns (uint)",
"function getDepositorLQTYGain(address _depositor) external view returns (uint)",
];
// const STABILITY_POOL_ADDRESS = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb";
// const STABILITY_POOL_ABI = [
// "function getCompoundedLUSDDeposit(address _depositor) external view returns (uint)",
// "function getDepositorETHGain(address _depositor) external view returns (uint)",
// "function getDepositorLQTYGain(address _depositor) external view returns (uint)",
// ];
const STAKING_ADDRESS = "0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d";
const STAKING_ABI = [
"function stake(uint _LQTYamount) external",
"function unstake(uint _LQTYamount) external",
"function getPendingETHGain(address _user) external view returns (uint)",
"function getPendingLUSDGain(address _user) external view returns (uint)",
];
// const STAKING_ADDRESS = "0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d";
// const STAKING_ABI = [
// "function stake(uint _LQTYamount) external",
// "function unstake(uint _LQTYamount) external",
// "function getPendingETHGain(address _user) external view returns (uint)",
// "function getPendingLUSDGain(address _user) external view returns (uint)",
// ];
const LQTY_TOKEN_ADDRESS = "0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D";
const LQTY_TOKEN_ABI = [
"function balanceOf(address account) external view returns (uint256)",
"function transfer(address _to, uint256 _value) public returns (bool success)",
"function approve(address spender, uint256 amount) external returns (bool)",
];
// const LQTY_TOKEN_ADDRESS = "0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D";
// const LQTY_TOKEN_ABI = [
// "function balanceOf(address account) external view returns (uint256)",
// "function transfer(address _to, uint256 _value) public returns (bool success)",
// "function approve(address spender, uint256 amount) external returns (bool)",
// ];
const COLL_SURPLUS_ADDRESS = "0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521";
const COLL_SURPLUS_ABI = [
"function getCollateral(address _account) external view returns (uint)",
];
// const COLL_SURPLUS_ADDRESS = "0x3D32e8b97Ed5881324241Cf03b2DA5E2EBcE5521";
// const COLL_SURPLUS_ABI = [
// "function getCollateral(address _account) external view returns (uint)",
// ];
module.exports = {
TROVE_MANAGER_ADDRESS,
TROVE_MANAGER_ABI,
BORROWER_OPERATIONS_ADDRESS,
BORROWER_OPERATIONS_ABI,
LUSD_TOKEN_ADDRESS,
LUSD_TOKEN_ABI,
STABILITY_POOL_ADDRESS,
STABILITY_POOL_ABI,
ACTIVE_POOL_ADDRESS,
ACTIVE_POOL_ABI,
PRICE_FEED_ADDRESS,
PRICE_FEED_ABI,
HINT_HELPERS_ADDRESS,
HINT_HELPERS_ABI,
SORTED_TROVES_ADDRESS,
SORTED_TROVES_ABI,
STAKING_ADDRESS,
STAKING_ABI,
LQTY_TOKEN_ADDRESS,
LQTY_TOKEN_ABI,
COLL_SURPLUS_ADDRESS,
COLL_SURPLUS_ABI,
};
// module.exports = {
// TROVE_MANAGER_ADDRESS,
// TROVE_MANAGER_ABI,
// BORROWER_OPERATIONS_ADDRESS,
// BORROWER_OPERATIONS_ABI,
// LUSD_TOKEN_ADDRESS,
// LUSD_TOKEN_ABI,
// STABILITY_POOL_ADDRESS,
// STABILITY_POOL_ABI,
// ACTIVE_POOL_ADDRESS,
// ACTIVE_POOL_ABI,
// PRICE_FEED_ADDRESS,
// PRICE_FEED_ABI,
// HINT_HELPERS_ADDRESS,
// HINT_HELPERS_ABI,
// SORTED_TROVES_ADDRESS,
// SORTED_TROVES_ABI,
// STAKING_ADDRESS,
// STAKING_ABI,
// LQTY_TOKEN_ADDRESS,
// LQTY_TOKEN_ABI,
// COLL_SURPLUS_ADDRESS,
// COLL_SURPLUS_ABI,
// };

View File

@ -1,343 +1,343 @@
import hre from "hardhat";
import { ethers } from "hardhat";
import hardhatConfig from "../../../hardhat.config";
// import hre from "hardhat";
// import { ethers } from "hardhat";
// import hardhatConfig from "../../../hardhat.config";
// Instadapp deployment and testing helpers
import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector.js"
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
import { encodeSpells } from "../../../scripts/tests/encodeSpells.js"
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
// // Instadapp deployment and testing helpers
// import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector.js"
// import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
// import { encodeSpells } from "../../../scripts/tests/encodeSpells.js"
// import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
// Instadapp instadappAddresses/ABIs
import { instadappAddresses } from "../../../scripts/important/addresses";
import { instadappAbi } from "../../../scripts/constant/abis";
// // Instadapp instadappAddresses/ABIs
// import { instadappAddresses } from "../../../scripts/important/addresses";
// import { instadappAbi } from "../../../scripts/constant/abis";
// Instadapp Liquity Connector artifacts
import { ConnectV2Liquity__factory, ConnectV2Basic__factory } from "../../../typechain";
// // Instadapp Liquity Connector artifacts
// import { ConnectV2Liquity__factory, ConnectV2Basic__factory } from "../../../typechain";
// Instadapp uses a fake address to represent native ETH
import { constants } from "../../../scripts/constant/constant.js";
import type { Signer, Contract } from "ethers";
// // Instadapp uses a fake address to represent native ETH
// import { constants } from "../../../scripts/constant/constant.js";
// import type { Signer, Contract } from "ethers";
const LIQUITY_CONNECTOR = "LIQUITY-v1-TEST";
const LUSD_GAS_COMPENSATION = hre.ethers.utils.parseUnits("200", 18); // 200 LUSD gas compensation repaid after loan repayment
const LIQUIDATABLE_TROVES_BLOCK_NUMBER = 12478159; // Deterministic block number for tests to run against, if you change this, tests will break.
const JUSTIN_SUN_ADDRESS = "0x903d12bf2c57a29f32365917c706ce0e1a84cce3"; // LQTY whale address
const LIQUIDATABLE_TROVE_ADDRESS = "0xafbeb4cb97f3b08ec2fe07ef0dac15d37013a347"; // Trove which is liquidatable at blockNumber: LIQUIDATABLE_TROVES_BLOCK_NUMBER
// const MAX_GAS = hardhatConfig.networks.hardhat.blockGasLimit; // Maximum gas limit (12000000)
const INSTADAPP_BASIC_V1_CONNECTOR = "Basic-v1";
// const LIQUITY_CONNECTOR = "LIQUITY-v1-TEST";
// const LUSD_GAS_COMPENSATION = hre.ethers.utils.parseUnits("200", 18); // 200 LUSD gas compensation repaid after loan repayment
// const LIQUIDATABLE_TROVES_BLOCK_NUMBER = 12478159; // Deterministic block number for tests to run against, if you change this, tests will break.
// const JUSTIN_SUN_ADDRESS = "0x903d12bf2c57a29f32365917c706ce0e1a84cce3"; // LQTY whale address
// const LIQUIDATABLE_TROVE_ADDRESS = "0xafbeb4cb97f3b08ec2fe07ef0dac15d37013a347"; // Trove which is liquidatable at blockNumber: LIQUIDATABLE_TROVES_BLOCK_NUMBER
// // const MAX_GAS = hardhatConfig.networks.hardhat.blockGasLimit; // Maximum gas limit (12000000)
// const INSTADAPP_BASIC_V1_CONNECTOR = "Basic-v1";
const openTroveSpell = async (
dsa: any,
signer: Signer,
depositAmount: any,
borrowAmount: any,
upperHint: any,
lowerHint: any,
maxFeePercentage: any
) => {
let address = await signer.getAddress();
// const openTroveSpell = async (
// dsa: any,
// signer: Signer,
// depositAmount: any,
// borrowAmount: any,
// upperHint: any,
// lowerHint: any,
// maxFeePercentage: any
// ) => {
// let address = await signer.getAddress();
const openTroveSpell = {
connector: LIQUITY_CONNECTOR,
method: "open",
args: [
depositAmount,
maxFeePercentage,
borrowAmount,
upperHint,
lowerHint,
[0, 0],
[0, 0],
],
};
// const openTroveSpell = {
// connector: LIQUITY_CONNECTOR,
// method: "open",
// args: [
// depositAmount,
// maxFeePercentage,
// borrowAmount,
// upperHint,
// lowerHint,
// [0, 0],
// [0, 0],
// ],
// };
return await dsa
.connect(signer)
.cast(...encodeSpells([openTroveSpell]), address, {
value: depositAmount,
});
};
// return await dsa
// .connect(signer)
// .cast(...encodeSpells([openTroveSpell]), address, {
// value: depositAmount,
// });
// };
const createDsaTrove = async (
dsa: any,
signer: any,
liquity: any,
depositAmount = hre.ethers.utils.parseEther("5"),
borrowAmount = hre.ethers.utils.parseUnits("2000", 18)
) => {
const maxFeePercentage = hre.ethers.utils.parseUnits("0.5", 18); // 0.5% max fee
const { upperHint, lowerHint } = await getTroveInsertionHints(
depositAmount,
borrowAmount,
liquity
);
return await openTroveSpell(
dsa,
signer,
depositAmount,
borrowAmount,
upperHint,
lowerHint,
maxFeePercentage
);
};
// const createDsaTrove = async (
// dsa: any,
// signer: any,
// liquity: any,
// depositAmount = hre.ethers.utils.parseEther("5"),
// borrowAmount = hre.ethers.utils.parseUnits("2000", 18)
// ) => {
// const maxFeePercentage = hre.ethers.utils.parseUnits("0.5", 18); // 0.5% max fee
// const { upperHint, lowerHint } = await getTroveInsertionHints(
// depositAmount,
// borrowAmount,
// liquity
// );
// return await openTroveSpell(
// dsa,
// signer,
// depositAmount,
// borrowAmount,
// upperHint,
// lowerHint,
// maxFeePercentage
// );
// };
const sendToken = async (token: any, amount: any, from: any, to: any) => {
await hre.network.provider.request({
method: "hardhat_impersonateAccount",
params: [from],
});
const signer = hre.ethers.provider.getSigner(from);
// const sendToken = async (token: any, amount: any, from: any, to: any) => {
// await hre.network.provider.request({
// method: "hardhat_impersonateAccount",
// params: [from],
// });
// const signer = hre.ethers.provider.getSigner(from);
return await token.connect(signer).transfer(to, amount, {
gasPrice: 0,
});
};
// return await token.connect(signer).transfer(to, amount, {
// gasPrice: 0,
// });
// };
const resetInitialState = async (walletAddress: any, contracts: any, isDebug = false) => {
const liquity = await deployAndConnect(contracts, isDebug);
const dsa = await buildDSAv2(walletAddress);
// const resetInitialState = async (walletAddress: any, contracts: any, isDebug = false) => {
// const liquity = await deployAndConnect(contracts, isDebug);
// const dsa = await buildDSAv2(walletAddress);
return [liquity, dsa];
};
// return [liquity, dsa];
// };
const resetHardhatBlockNumber = async (blockNumber: number) => {
return await hre.network.provider.request({
method: "hardhat_reset",
params: [
{
forking: {
// @ts-ignore
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
blockNumber,
},
},
],
});
};
// const resetHardhatBlockNumber = async (blockNumber: number) => {
// return await hre.network.provider.request({
// method: "hardhat_reset",
// params: [
// {
// forking: {
// // @ts-ignore
// jsonRpcUrl: hre.config.networks.hardhat.forking.url,
// blockNumber,
// },
// },
// ],
// });
// };
const deployAndConnect = async (contracts: any, isDebug = false) => {
// Pin Liquity tests to a particular block number to create deterministic state (Ether price etc.)
await resetHardhatBlockNumber(LIQUIDATABLE_TROVES_BLOCK_NUMBER);
let liquity = {
troveManager: Contract,
borrowerOperations: null,
stabilityPool: null,
lusdToken: null,
lqtyToken: null,
activePool: null,
priceFeed: null,
hintHelpers: null,
sortedTroves: null,
staking: null,
collSurplus: null,
};
// const deployAndConnect = async (contracts: any, isDebug = false) => {
// // Pin Liquity tests to a particular block number to create deterministic state (Ether price etc.)
// await resetHardhatBlockNumber(LIQUIDATABLE_TROVES_BLOCK_NUMBER);
// let liquity = {
// troveManager: Contract,
// borrowerOperations: null,
// stabilityPool: null,
// lusdToken: null,
// lqtyToken: null,
// activePool: null,
// priceFeed: null,
// hintHelpers: null,
// sortedTroves: null,
// staking: null,
// collSurplus: null,
// };
const masterSigner = await getMasterSigner();
const instaConnectorsV2 = await ethers.getContractAt(
instadappAbi.core.connectorsV2,
instadappAddresses.core.connectorsV2
);
const connector = await deployAndEnableConnector({
connectorName: LIQUITY_CONNECTOR,
contractArtifact: ConnectV2Liquity__factory,
signer: masterSigner,
connectors: instaConnectorsV2,
});
isDebug &&
console.log(`${LIQUITY_CONNECTOR} Connector address`, connector.address);
// const masterSigner = await getMasterSigner();
// const instaConnectorsV2 = await ethers.getContractAt(
// instadappAbi.core.connectorsV2,
// instadappAddresses.core.connectorsV2
// );
// const connector = await deployAndEnableConnector({
// connectorName: LIQUITY_CONNECTOR,
// contractArtifact: ConnectV2Liquity__factory,
// signer: masterSigner,
// connectors: instaConnectorsV2,
// });
// isDebug &&
// console.log(`${LIQUITY_CONNECTOR} Connector address`, connector.address);
const basicConnector = await deployAndEnableConnector({
connectorName: "Basic-v1",
contractArtifact: ConnectV2Basic__factory,
signer: masterSigner,
connectors: instaConnectorsV2,
});
isDebug && console.log("Basic-v1 Connector address", basicConnector.address);
// const basicConnector = await deployAndEnableConnector({
// connectorName: "Basic-v1",
// contractArtifact: ConnectV2Basic__factory,
// signer: masterSigner,
// connectors: instaConnectorsV2,
// });
// isDebug && console.log("Basic-v1 Connector address", basicConnector.address);
liquity.troveManager = new ethers.Contract(
contracts.TROVE_MANAGER_ADDRESS,
contracts.TROVE_MANAGER_ABI,
ethers.provider
);
// liquity.troveManager = new ethers.Contract(
// contracts.TROVE_MANAGER_ADDRESS,
// contracts.TROVE_MANAGER_ABI,
// ethers.provider
// );
liquity.borrowerOperations = new ethers.Contract(
contracts.BORROWER_OPERATIONS_ADDRESS,
contracts.BORROWER_OPERATIONS_ABI,
ethers.provider
);
// liquity.borrowerOperations = new ethers.Contract(
// contracts.BORROWER_OPERATIONS_ADDRESS,
// contracts.BORROWER_OPERATIONS_ABI,
// ethers.provider
// );
liquity.stabilityPool = new ethers.Contract(
contracts.STABILITY_POOL_ADDRESS,
contracts.STABILITY_POOL_ABI,
ethers.provider
);
// liquity.stabilityPool = new ethers.Contract(
// contracts.STABILITY_POOL_ADDRESS,
// contracts.STABILITY_POOL_ABI,
// ethers.provider
// );
liquity.lusdToken = new ethers.Contract(
contracts.LUSD_TOKEN_ADDRESS,
contracts.LUSD_TOKEN_ABI,
ethers.provider
);
// liquity.lusdToken = new ethers.Contract(
// contracts.LUSD_TOKEN_ADDRESS,
// contracts.LUSD_TOKEN_ABI,
// ethers.provider
// );
liquity.lqtyToken = new ethers.Contract(
contracts.LQTY_TOKEN_ADDRESS,
contracts.LQTY_TOKEN_ABI,
ethers.provider
);
// liquity.lqtyToken = new ethers.Contract(
// contracts.LQTY_TOKEN_ADDRESS,
// contracts.LQTY_TOKEN_ABI,
// ethers.provider
// );
liquity.activePool = new ethers.Contract(
contracts.ACTIVE_POOL_ADDRESS,
contracts.ACTIVE_POOL_ABI,
ethers.provider
);
// liquity.activePool = new ethers.Contract(
// contracts.ACTIVE_POOL_ADDRESS,
// contracts.ACTIVE_POOL_ABI,
// ethers.provider
// );
liquity.priceFeed = new ethers.Contract(
contracts.PRICE_FEED_ADDRESS,
contracts.PRICE_FEED_ABI,
ethers.provider
);
// liquity.priceFeed = new ethers.Contract(
// contracts.PRICE_FEED_ADDRESS,
// contracts.PRICE_FEED_ABI,
// ethers.provider
// );
liquity.hintHelpers = new ethers.Contract(
contracts.HINT_HELPERS_ADDRESS,
contracts.HINT_HELPERS_ABI,
ethers.provider
);
// liquity.hintHelpers = new ethers.Contract(
// contracts.HINT_HELPERS_ADDRESS,
// contracts.HINT_HELPERS_ABI,
// ethers.provider
// );
liquity.sortedTroves = new ethers.Contract(
contracts.SORTED_TROVES_ADDRESS,
contracts.SORTED_TROVES_ABI,
ethers.provider
);
// liquity.sortedTroves = new ethers.Contract(
// contracts.SORTED_TROVES_ADDRESS,
// contracts.SORTED_TROVES_ABI,
// ethers.provider
// );
liquity.staking = new ethers.Contract(
contracts.STAKING_ADDRESS,
contracts.STAKING_ABI,
ethers.provider
);
liquity.collSurplus = new ethers.Contract(
contracts.COLL_SURPLUS_ADDRESS,
contracts.COLL_SURPLUS_ABI,
ethers.provider
);
// liquity.staking = new ethers.Contract(
// contracts.STAKING_ADDRESS,
// contracts.STAKING_ABI,
// ethers.provider
// );
// liquity.collSurplus = new ethers.Contract(
// contracts.COLL_SURPLUS_ADDRESS,
// contracts.COLL_SURPLUS_ABI,
// ethers.provider
// );
return liquity;
};
// return liquity;
// };
const getTroveInsertionHints = async (depositAmount, borrowAmount, liquity: any) => {
const nominalCR = await liquity.hintHelpers.computeNominalCR(
depositAmount,
borrowAmount
);
// const getTroveInsertionHints = async (depositAmount, borrowAmount, liquity: any) => {
// const nominalCR = await liquity.hintHelpers.computeNominalCR(
// depositAmount,
// borrowAmount
// );
const {
hintAddress,
latestRandomSeed,
} = await liquity.hintHelpers.getApproxHint(nominalCR, 50, 1298379, {
gasLimit: MAX_GAS,
});
randomSeed = latestRandomSeed;
// const {
// hintAddress,
// latestRandomSeed,
// } = await liquity.hintHelpers.getApproxHint(nominalCR, 50, 1298379, {
// gasLimit: MAX_GAS,
// });
// randomSeed = latestRandomSeed;
const {
0: upperHint,
1: lowerHint,
} = await liquity.sortedTroves.findInsertPosition(
nominalCR,
hintAddress,
hintAddress,
{
gasLimit: MAX_GAS,
}
);
// const {
// 0: upperHint,
// 1: lowerHint,
// } = await liquity.sortedTroves.findInsertPosition(
// nominalCR,
// hintAddress,
// hintAddress,
// {
// gasLimit: MAX_GAS,
// }
// );
return {
upperHint,
lowerHint,
};
};
// return {
// upperHint,
// lowerHint,
// };
// };
let randomSeed = 4223;
// let randomSeed = 4223;
const getRedemptionHints = async (amount, liquity) => {
const ethPrice = await liquity.priceFeed.callStatic.fetchPrice();
const [
firstRedemptionHint,
partialRedemptionHintNicr,
] = await liquity.hintHelpers.getRedemptionHints(amount, ethPrice, 0);
// const getRedemptionHints = async (amount, liquity) => {
// const ethPrice = await liquity.priceFeed.callStatic.fetchPrice();
// const [
// firstRedemptionHint,
// partialRedemptionHintNicr,
// ] = await liquity.hintHelpers.getRedemptionHints(amount, ethPrice, 0);
const {
hintAddress,
latestRandomSeed,
} = await liquity.hintHelpers.getApproxHint(
partialRedemptionHintNicr,
50,
randomSeed,
{
gasLimit: MAX_GAS,
}
);
randomSeed = latestRandomSeed;
// const {
// hintAddress,
// latestRandomSeed,
// } = await liquity.hintHelpers.getApproxHint(
// partialRedemptionHintNicr,
// 50,
// randomSeed,
// {
// gasLimit: MAX_GAS,
// }
// );
// randomSeed = latestRandomSeed;
const {
0: upperHint,
1: lowerHint,
} = await liquity.sortedTroves.findInsertPosition(
partialRedemptionHintNicr,
hintAddress,
hintAddress,
{
gasLimit: MAX_GAS,
}
);
// const {
// 0: upperHint,
// 1: lowerHint,
// } = await liquity.sortedTroves.findInsertPosition(
// partialRedemptionHintNicr,
// hintAddress,
// hintAddress,
// {
// gasLimit: MAX_GAS,
// }
// );
return {
partialRedemptionHintNicr,
firstRedemptionHint,
upperHint,
lowerHint,
};
};
// return {
// partialRedemptionHintNicr,
// firstRedemptionHint,
// upperHint,
// lowerHint,
// };
// };
const redeem = async (amount, from, wallet, liquity) => {
await sendToken(liquity.lusdToken, amount, from, wallet.address);
const {
partialRedemptionHintNicr,
firstRedemptionHint,
upperHint,
lowerHint,
} = await getRedemptionHints(amount, liquity);
const maxFeePercentage = ethers.utils.parseUnits("0.5", 18); // 0.5% max fee
// const redeem = async (amount, from, wallet, liquity) => {
// await sendToken(liquity.lusdToken, amount, from, wallet.address);
// const {
// partialRedemptionHintNicr,
// firstRedemptionHint,
// upperHint,
// lowerHint,
// } = await getRedemptionHints(amount, liquity);
// const maxFeePercentage = ethers.utils.parseUnits("0.5", 18); // 0.5% max fee
return await liquity.troveManager
.connect(wallet)
.redeemCollateral(
amount,
firstRedemptionHint,
upperHint,
lowerHint,
partialRedemptionHintNicr,
0,
maxFeePercentage,
{
gasLimit: MAX_GAS, // permit max gas
}
);
};
// return await liquity.troveManager
// .connect(wallet)
// .redeemCollateral(
// amount,
// firstRedemptionHint,
// upperHint,
// lowerHint,
// partialRedemptionHintNicr,
// 0,
// maxFeePercentage,
// {
// gasLimit: MAX_GAS, // permit max gas
// }
// );
// };
module.exports = {
deployAndConnect,
resetInitialState,
createDsaTrove,
sendToken,
getTroveInsertionHints,
getRedemptionHints,
redeem,
LIQUITY_CONNECTOR,
LUSD_GAS_COMPENSATION,
JUSTIN_SUN_ADDRESS,
LIQUIDATABLE_TROVE_ADDRESS,
MAX_GAS,
INSTADAPP_BASIC_V1_CONNECTOR,
ETH_ADDRESS,
};
// module.exports = {
// deployAndConnect,
// resetInitialState,
// createDsaTrove,
// sendToken,
// getTroveInsertionHints,
// getRedemptionHints,
// redeem,
// LIQUITY_CONNECTOR,
// LUSD_GAS_COMPENSATION,
// JUSTIN_SUN_ADDRESS,
// LIQUIDATABLE_TROVE_ADDRESS,
// MAX_GAS,
// INSTADAPP_BASIC_V1_CONNECTOR,
// ETH_ADDRESS,
// };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ describe("UniswapV3", function () {
const connectorUniswap = "UniswapV3-v1"
let dsaWallet0: any
let masterSigner: any;
let masterSigner: Signer;
let instaConnectorsV2: any;
let connector: any;
let startTime: any, endTime: any;
@ -83,7 +83,7 @@ describe("UniswapV3", function () {
it("Should have contracts deployed.", async function () {
expect(!!instaConnectorsV2.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 () {
@ -183,7 +183,7 @@ describe("UniswapV3", function () {
let event = await castEvent
let balance = await nftManager.connect(wallet0).balanceOf(dsaWallet0.address)
console.log("Balance", balance)
console.log("Balance", balance.toString())
});
it("Should create incentive successfully", async function () {
@ -277,7 +277,7 @@ describe("UniswapV3", function () {
let receipt = await tx.wait()
let balance = await nftManager.connect(wallet0).balanceOf(dsaWallet0.address)
console.log("Balance", balance)
console.log("Balance", balance.toString())
});
it("Should claim rewards successfully", async function () {
@ -348,7 +348,7 @@ describe("UniswapV3", function () {
let receipt = await tx.wait()
let balance = await nftManager.connect(wallet0).balanceOf(dsaWallet0.address)
console.log("Balance", balance)
console.log("Balance", balance.toString())
});
})
})

248
yarn.lock
View File

@ -1291,6 +1291,14 @@
"@types/minimatch" "*"
"@types/node" "*"
"@types/inquirer@^8.1.3":
"integrity" "sha512-AayK4ZL5ssPzR1OtnOLGAwpT0Dda3Xi/h1G0l1oJDNrowp7T1423q4Zb8/emr7tzRlCy4ssEri0LWVexAqHyKQ=="
"resolved" "https://registry.npmjs.org/@types/inquirer/-/inquirer-8.1.3.tgz"
"version" "8.1.3"
dependencies:
"@types/through" "*"
"rxjs" "^7.2.0"
"@types/level-errors@*":
"integrity" "sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ=="
"resolved" "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz"
@ -1391,6 +1399,13 @@
dependencies:
"@sinonjs/fake-timers" "^7.0.4"
"@types/through@*":
"integrity" "sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg=="
"resolved" "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz"
"version" "0.0.30"
dependencies:
"@types/node" "*"
"@types/underscore@*":
"integrity" "sha512-Ls2ylbo7++ITrWk2Yc3G/jijwSq5V3GT0tlgVXEl2kKYXY3ImrtmTCoE2uyTWFRI5owMBriloZFWbE1SXOsE7w=="
"resolved" "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.2.tgz"
@ -1784,7 +1799,7 @@
"resolved" "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz"
"version" "3.2.3"
"ansi-escapes@^4.3.0":
"ansi-escapes@^4.2.1", "ansi-escapes@^4.3.0":
"integrity" "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="
"resolved" "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz"
"version" "4.3.2"
@ -1817,6 +1832,11 @@
"resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz"
"version" "4.1.0"
"ansi-regex@^5.0.1":
"integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
"resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz"
"version" "5.0.1"
"ansi-styles@^2.2.1":
"version" "2.2.1"
@ -2574,7 +2594,7 @@
"safe-buffer" "^5.0.1"
"unorm" "^1.3.3"
"bl@^4.0.3":
"bl@^4.0.3", "bl@^4.1.0":
"integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
"resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
"version" "4.1.0"
@ -3037,6 +3057,22 @@
"escape-string-regexp" "^1.0.5"
"supports-color" "^5.3.0"
"chalk@^4.1.0":
"integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="
"resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
"version" "4.1.2"
dependencies:
"ansi-styles" "^4.1.0"
"supports-color" "^7.1.0"
"chalk@^4.1.1":
"integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="
"resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
"version" "4.1.2"
dependencies:
"ansi-styles" "^4.1.0"
"supports-color" "^7.1.0"
"chalk@^4.1.2":
"integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="
"resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
@ -3074,6 +3110,11 @@
"upper-case" "^1.1.1"
"upper-case-first" "^1.1.0"
"chardet@^0.7.0":
"integrity" "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
"resolved" "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz"
"version" "0.7.0"
"check-error@^1.0.2":
"integrity" "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
"resolved" "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz"
@ -3213,6 +3254,23 @@
dependencies:
"source-map" "~0.6.0"
"cli-cursor@^3.1.0":
"integrity" "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="
"resolved" "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz"
"version" "3.1.0"
dependencies:
"restore-cursor" "^3.1.0"
"cli-spinners@^2.5.0":
"integrity" "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g=="
"resolved" "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz"
"version" "2.6.1"
"cli-width@^3.0.0":
"integrity" "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw=="
"resolved" "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz"
"version" "3.0.0"
"cliui@^2.1.0":
"integrity" "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE="
"resolved" "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz"
@ -3247,6 +3305,11 @@
dependencies:
"mimic-response" "^1.0.0"
"clone@^1.0.2":
"integrity" "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
"resolved" "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz"
"version" "1.0.4"
"clone@^2.0.0", "clone@2.1.2":
"version" "2.1.2"
@ -3781,6 +3844,13 @@
"resolved" "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz"
"version" "0.1.4"
"defaults@^1.0.3":
"integrity" "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730="
"resolved" "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz"
"version" "1.0.3"
dependencies:
"clone" "^1.0.2"
"defer-to-connect@^1.0.1":
"integrity" "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ=="
"resolved" "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz"
@ -4038,6 +4108,11 @@
"resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz"
"version" "7.0.3"
"emoji-regex@^8.0.0":
"integrity" "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
"resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
"version" "8.0.0"
"emojis-list@^2.0.0":
"integrity" "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
"resolved" "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz"
@ -5026,6 +5101,15 @@
"resolved" "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
"version" "3.0.2"
"external-editor@^3.0.3":
"integrity" "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew=="
"resolved" "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz"
"version" "3.1.0"
dependencies:
"chardet" "^0.7.0"
"iconv-lite" "^0.4.24"
"tmp" "^0.0.33"
"extglob@^2.0.4":
"integrity" "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw=="
"resolved" "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz"
@ -5105,6 +5189,13 @@
"resolved" "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz"
"version" "3.5.2"
"figures@^3.0.0":
"integrity" "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg=="
"resolved" "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz"
"version" "3.2.0"
dependencies:
"escape-string-regexp" "^1.0.5"
"file-uri-to-path@1.0.0":
"integrity" "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
"resolved" "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz"
@ -6147,18 +6238,18 @@
"resolved" "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz"
"version" "7.0.4"
"iconv-lite@^0.6.2":
"version" "0.6.2"
dependencies:
"safer-buffer" ">= 2.1.2 < 3.0.0"
"iconv-lite@0.4.24":
"iconv-lite@^0.4.24", "iconv-lite@0.4.24":
"integrity" "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="
"resolved" "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz"
"version" "0.4.24"
dependencies:
"safer-buffer" ">= 2.1.2 < 3"
"iconv-lite@^0.6.2":
"version" "0.6.2"
dependencies:
"safer-buffer" ">= 2.1.2 < 3.0.0"
"icss-replace-symbols@^1.1.0":
"integrity" "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0="
"resolved" "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz"
@ -6251,6 +6342,26 @@
"resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz"
"version" "1.3.8"
"inquirer@^8.2.0":
"integrity" "sha512-0crLweprevJ02tTuA6ThpoAERAGyVILC4sS74uib58Xf/zSr1/ZWtmm7D5CI+bSQEaA04f0K7idaHpQbSWgiVQ=="
"resolved" "https://registry.npmjs.org/inquirer/-/inquirer-8.2.0.tgz"
"version" "8.2.0"
dependencies:
"ansi-escapes" "^4.2.1"
"chalk" "^4.1.1"
"cli-cursor" "^3.1.0"
"cli-width" "^3.0.0"
"external-editor" "^3.0.3"
"figures" "^3.0.0"
"lodash" "^4.17.21"
"mute-stream" "0.0.8"
"ora" "^5.4.1"
"run-async" "^2.4.0"
"rxjs" "^7.2.0"
"string-width" "^4.1.0"
"strip-ansi" "^6.0.0"
"through" "^2.3.6"
"internal-slot@^1.0.3":
"integrity" "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA=="
"resolved" "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz"
@ -6454,6 +6565,11 @@
"resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz"
"version" "2.0.0"
"is-fullwidth-code-point@^3.0.0":
"integrity" "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
"resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz"
"version" "3.0.0"
"is-function@^1.0.1":
"integrity" "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ=="
"resolved" "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz"
@ -6485,6 +6601,11 @@
"resolved" "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz"
"version" "1.0.0"
"is-interactive@^1.0.0":
"integrity" "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="
"resolved" "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz"
"version" "1.0.0"
"is-lower-case@^1.1.0":
"integrity" "sha1-fhR75HaNxGbbO/shzGCzHmrWk5M="
"resolved" "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz"
@ -6600,6 +6721,11 @@
"resolved" "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
"version" "1.0.0"
"is-unicode-supported@^0.1.0":
"integrity" "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="
"resolved" "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz"
"version" "0.1.0"
"is-upper-case@^1.1.0":
"integrity" "sha1-jQsfp+eTOh5YSDYA7H2WYcuvdW8="
"resolved" "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz"
@ -7207,6 +7333,14 @@
"lodash@^4.17.4", "lodash@4.17.20":
"version" "4.17.20"
"log-symbols@^4.1.0":
"integrity" "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg=="
"resolved" "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz"
"version" "4.1.0"
dependencies:
"chalk" "^4.1.0"
"is-unicode-supported" "^0.1.0"
"log-symbols@3.0.0":
"integrity" "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ=="
"resolved" "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz"
@ -7560,6 +7694,11 @@
"resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz"
"version" "2.1.0"
"mimic-fn@^2.1.0":
"integrity" "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
"resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz"
"version" "2.1.0"
"mimic-response@^1.0.0", "mimic-response@^1.0.1":
"integrity" "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
"resolved" "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz"
@ -7790,6 +7929,11 @@
"fmix" "^0.1.0"
"imul" "^1.0.0"
"mute-stream@0.0.8":
"integrity" "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="
"resolved" "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz"
"version" "0.0.8"
"nan@^2.12.1":
"integrity" "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw=="
"resolved" "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz"
@ -8170,6 +8314,13 @@
dependencies:
"wrappy" "1"
"onetime@^5.1.0":
"integrity" "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="
"resolved" "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz"
"version" "5.1.2"
dependencies:
"mimic-fn" "^2.1.0"
"open@^7.4.2":
"integrity" "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q=="
"resolved" "https://registry.npmjs.org/open/-/open-7.4.2.tgz"
@ -8190,6 +8341,21 @@
"type-check" "~0.3.2"
"word-wrap" "~1.2.3"
"ora@^5.4.1":
"integrity" "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ=="
"resolved" "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz"
"version" "5.4.1"
dependencies:
"bl" "^4.1.0"
"chalk" "^4.1.0"
"cli-cursor" "^3.1.0"
"cli-spinners" "^2.5.0"
"is-interactive" "^1.0.0"
"is-unicode-supported" "^0.1.0"
"log-symbols" "^4.1.0"
"strip-ansi" "^6.0.0"
"wcwidth" "^1.0.1"
"os-browserify@^0.3.0":
"integrity" "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc="
"resolved" "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz"
@ -9013,7 +9179,16 @@
"string_decoder" "^1.1.1"
"util-deprecate" "^1.0.1"
"readable-stream@^3.1.1", "readable-stream@^3.4.0":
"readable-stream@^3.1.1":
"integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="
"resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
"version" "3.6.0"
dependencies:
"inherits" "^2.0.3"
"string_decoder" "^1.1.1"
"util-deprecate" "^1.0.1"
"readable-stream@^3.4.0":
"integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="
"resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
"version" "3.6.0"
@ -9239,6 +9414,14 @@
dependencies:
"lowercase-keys" "^1.0.0"
"restore-cursor@^3.1.0":
"integrity" "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="
"resolved" "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz"
"version" "3.1.0"
dependencies:
"onetime" "^5.1.0"
"signal-exit" "^3.0.2"
"resumer@~0.0.0":
"version" "0.0.0"
dependencies:
@ -9288,6 +9471,11 @@
dependencies:
"bn.js" "^4.11.1"
"run-async@^2.4.0":
"integrity" "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="
"resolved" "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz"
"version" "2.4.1"
"run-parallel@^1.1.9":
"integrity" "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="
"resolved" "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz"
@ -9307,6 +9495,13 @@
"resolved" "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz"
"version" "0.2.0"
"rxjs@^7.2.0":
"integrity" "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w=="
"resolved" "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz"
"version" "7.4.0"
dependencies:
"tslib" "~2.1.0"
"rxjs@6":
"integrity" "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ=="
"resolved" "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz"
@ -9595,7 +9790,7 @@
"get-intrinsic" "^1.0.2"
"object-inspect" "^1.9.0"
"signal-exit@^3.0.0":
"signal-exit@^3.0.0", "signal-exit@^3.0.2":
"integrity" "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
"resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz"
"version" "3.0.3"
@ -9969,6 +10164,15 @@
"is-fullwidth-code-point" "^2.0.0"
"strip-ansi" "^5.1.0"
"string-width@^4.1.0":
"integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="
"resolved" "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
"version" "4.2.3"
dependencies:
"emoji-regex" "^8.0.0"
"is-fullwidth-code-point" "^3.0.0"
"strip-ansi" "^6.0.1"
"string.prototype.trim@~1.2.1":
"version" "1.2.3"
dependencies:
@ -10025,6 +10229,13 @@
dependencies:
"ansi-regex" "^4.1.0"
"strip-ansi@^6.0.0", "strip-ansi@^6.0.1":
"integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="
"resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
"version" "6.0.1"
dependencies:
"ansi-regex" "^5.0.1"
"strip-bom@^2.0.0":
"integrity" "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4="
"resolved" "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz"
@ -10234,6 +10445,11 @@
"resolved" "https://registry.npmjs.org/testrpc/-/testrpc-0.0.1.tgz"
"version" "0.0.1"
"through@^2.3.6":
"integrity" "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
"resolved" "https://registry.npmjs.org/through/-/through-2.3.8.tgz"
"version" "2.3.8"
"through@~2.3.4", "through@~2.3.8":
"version" "2.3.8"
@ -10412,6 +10628,11 @@
"resolved" "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz"
"version" "2.3.1"
"tslib@~2.1.0":
"integrity" "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A=="
"resolved" "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz"
"version" "2.1.0"
"tsort@0.0.1":
"integrity" "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y="
"resolved" "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz"
@ -10932,6 +11153,13 @@
"chokidar" "^3.4.1"
"watchpack-chokidar2" "^2.0.1"
"wcwidth@^1.0.1":
"integrity" "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g="
"resolved" "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz"
"version" "1.0.1"
dependencies:
"defaults" "^1.0.3"
"web3-bzz@1.2.11":
"version" "1.2.11"
dependencies: