Skip to content

Commit

Permalink
chore: npm clean up (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
rotnes authored Feb 9, 2023
1 parent 6f6065a commit 6f4360d
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 29 deletions.
4 changes: 2 additions & 2 deletions deploy/ArrakisV2.deploy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deployments, getNamedAccounts, ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { getAddresses } from "../src";
import { getAddresses, Addresses } from "../src/addresses";
import { sleep } from "../src/utils";

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
Expand All @@ -18,7 +18,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await sleep(10000);
}

const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy("ArrakisV2", {
Expand Down
4 changes: 2 additions & 2 deletions deploy/ArrakisV2Helper.deploy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deployments, getNamedAccounts, ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { getAddresses } from "../src";
import { getAddresses, Addresses } from "../src/addresses";
import { sleep } from "../src/utils";

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
Expand All @@ -18,7 +18,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await sleep(10000);
}

const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy("ArrakisV2Helper", {
Expand Down
4 changes: 2 additions & 2 deletions deploy/ArrakisV2Resolver.deploy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deployments, getNamedAccounts, ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { getAddresses } from "../src";
import { getAddresses, Addresses } from "../src/addresses";
import { sleep } from "../src/utils";

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
Expand All @@ -18,7 +18,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await sleep(10000);
}

const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy("ArrakisV2Resolver", {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@arrakisfi/v2-core",
"version": "1.1.3",
"version": "1.1.9",
"description": "Arrakis V2 Automated Market Maker",
"license": "BUSL-1.1",
"main": "dist/src/index",
"types": "dist/src/index",
"main": "dist/src/addresses.js",
"types": "dist/src/addresses.d.ts",
"files": [
"contracts",
"!contracts/__mocks__",
"src"
"dist/src"
],
"scripts": {
"build": "yarn compile && npx tsc",
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify/verifyVaultV2.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hre from "hardhat";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";

async function main() {
const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);

await hre.run("verify:verify", {
address: (await hre.ethers.getContract("ArrakisV2")).address,
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify/verifyVaultV2Helper.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hre from "hardhat";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";

async function main() {
const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);

await hre.run("verify:verify", {
address: (await hre.ethers.getContract("ArrakisV2Helper")).address,
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify/verifyVaultV2Resolver.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hre from "hardhat";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";

async function main() {
const addresses = getAddresses(hre.network.name);
const addresses: Addresses = getAddresses(hre.network.name);

await hre.run("verify:verify", {
address: (await hre.ethers.getContract("ArrakisV2Resolver")).address,
Expand Down
15 changes: 14 additions & 1 deletion src/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
/* eslint-disable @typescript-eslint/naming-convention */
export const getAddresses = (network: string): any => {
export interface Addresses {
UniswapV3Factory: string;
SwapRouter: string;
WETH: string;
WMATIC: string;
USDC: string;
ArrakisV2Implementation: string;
ArrakisV2Beacon: string;
ArrakisV2Factory: string;
ArrakisV2Helper: string;
ArrakisV2Resolver: string;
}

export const getAddresses = (network: string): Addresses => {
switch (network) {
case "hardhat":
return {
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions test/integration_tests/ArrakisV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ArrakisV2Resolver,
Position,
} from "../../typechain";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";
import { Signer } from "ethers";
import { Contract } from "ethers";
import { ManagerProxyMock } from "../../typechain/contracts/__mocks__/ManagerProxyMock";
Expand All @@ -33,7 +33,7 @@ describe("Arrakis V2 integration test!!!", async function () {
let wMatic: Contract;
let wEth: Contract;
let usdc: Contract;
let addresses: any;
let addresses: Addresses;
let lowerTick: number;
let upperTick: number;

Expand Down
4 changes: 2 additions & 2 deletions test/unit_tests/ArrakisV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from "chai";
import { Signer } from "ethers";
import hre = require("hardhat");
import { ArrakisV2, IUniswapV3Factory } from "../../typechain";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";
const { ethers, deployments } = hre;

describe("ArrakisV2 functions unit test", function () {
Expand All @@ -15,7 +15,7 @@ describe("ArrakisV2 functions unit test", function () {
let manager: Signer;
let managerAddr: string;
let arrakisV2: ArrakisV2;
let addresses: any;
let addresses: Addresses;

before("Setting up for ArrakisV2 function test", async function () {
if (hre.network.name !== "hardhat") {
Expand Down
4 changes: 2 additions & 2 deletions test/unit_tests/ArrakisV2Factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ArrakisV2Resolver,
ArrakisV2Beacon,
} from "../../typechain";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";
const { ethers, deployments } = hre;

describe("Factory function unit test", function () {
Expand All @@ -21,7 +21,7 @@ describe("Factory function unit test", function () {
let arrakisV2Factory: ArrakisV2Factory;
let uniswapV3Pool: IUniswapV3Pool;
let arrakisV2Resolver: ArrakisV2Resolver;
let addresses: any;
let addresses: Addresses;
let owner: Signer;

beforeEach("Setting up for Factory view function test", async function () {
Expand Down
4 changes: 2 additions & 2 deletions test/unit_tests/ArrakisV2Helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
IUniswapV3Pool,
ManagerProxyMock,
} from "../../typechain";
import { getAddresses } from "../../src";
import { getAddresses, Addresses } from "../../src/addresses";
const { ethers, deployments } = hre;

describe("ArrakisV2Helper functions unit test", function () {
Expand All @@ -27,7 +27,7 @@ describe("ArrakisV2Helper functions unit test", function () {
let managerProxyMock: ManagerProxyMock;
let arrakisV2Resolver: ArrakisV2Resolver;
let swapRouter: ISwapRouter;
let addresses: any;
let addresses: Addresses;
let wEth: Contract;
let usdc: Contract;
let wMatic: Contract;
Expand Down

0 comments on commit 6f4360d

Please sign in to comment.