From 5247b5deff8da951303ca63a8aae3c21e03b8690 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Wed, 20 Oct 2021 17:36:54 +0100 Subject: [PATCH] docs(amm,flash-swap,protocol,proxy-target): change "artifacts" to "smart contract ABIs" build: set "@ethersproject/wallet" resolution in core "package.json" build: upgrade dev deps chore(amm,flash-swap,helpers,protocol,proxy-target,tasks): use "import type" instead of "import" --- package.json | 3 ++ packages/amm/README.md | 4 +-- packages/amm/hardhat.config.ts | 2 +- .../integration/hifiPool/effects/buyHToken.ts | 2 +- .../hifiPool/effects/buyUnderlying.ts | 2 +- .../hifiPool/effects/sellHToken.ts | 2 +- .../hifiPool/effects/sellUnderlying.ts | 2 +- packages/amm/test/shared/contexts.ts | 2 +- packages/amm/test/shared/deployers.ts | 12 +++---- packages/amm/test/shared/fixtures.ts | 16 ++++----- packages/amm/test/shared/mocks.ts | 4 +-- packages/amm/test/shared/types.ts | 16 ++++----- packages/flash-swap/README.md | 4 +-- packages/flash-swap/hardhat.config.ts | 2 +- .../effects/uniswapV2Call.ts | 2 +- packages/flash-swap/test/shared/contexts.ts | 2 +- packages/flash-swap/test/shared/deployers.ts | 8 ++--- packages/flash-swap/test/shared/fixtures.ts | 18 +++++----- packages/flash-swap/test/shared/types.ts | 12 +++---- packages/helpers/src/chains.ts | 2 +- packages/protocol/README.md | 4 +-- packages/protocol/hardhat.config.ts | 2 +- .../protocol/tasks/deploy/balanceSheet.ts | 4 +-- packages/protocol/tasks/deploy/fintroller.ts | 4 +-- packages/protocol/test/shared/contexts.ts | 12 +++---- packages/protocol/test/shared/deployers.ts | 4 +-- packages/protocol/test/shared/fixtures.ts | 20 +++++------ packages/protocol/test/shared/mocks.ts | 4 +-- packages/protocol/test/shared/types.ts | 22 ++++++------- .../unit/balanceSheet/deployment/proxy.ts | 6 ++-- .../test/unit/fintroller/deployment/proxy.ts | 4 +-- .../unit/hToken/deployment/constructor.ts | 4 +-- .../test/unit/hToken/effects/redeem.ts | 2 +- .../hToken/view/underlyingPrecisionScalar.ts | 4 +-- packages/proxy-target/README.md | 4 +-- packages/proxy-target/hardhat.config.ts | 2 +- packages/tasks/hardhat.config.ts | 2 +- .../tasks/src/deploy/chainlinkOperator.ts | 6 ++-- packages/tasks/src/deploy/hToken.ts | 6 ++-- .../tasks/src/deploy/hifiFlashUniswapV2.ts | 6 ++-- packages/tasks/src/deploy/hifiPool.ts | 4 +-- packages/tasks/src/deploy/hifiPoolRegistry.ts | 6 ++-- packages/tasks/src/deploy/hifiProxyTarget.ts | 2 +- packages/tasks/src/deploy/simplePriceFeed.ts | 6 ++-- .../tasks/src/deploy/stablecoinPriceFeed.ts | 6 ++-- packages/tasks/src/init/addLiquidity.ts | 10 +++--- yarn.lock | 33 +++---------------- 47 files changed, 142 insertions(+), 164 deletions(-) diff --git a/package.json b/package.json index e04f307d..0d32b833 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,9 @@ }, "packageManager": "yarn@3.1.0-rc.6", "private": true, + "resolutions": { + "@ethersproject/wallet": "^5.5.0" + }, "scripts": { "build:ts": "yarn workspaces foreach --topological-dev --verbose run build:ts", "build:types": "yarn workspaces foreach --topological-dev --verbose run build:types", diff --git a/packages/amm/README.md b/packages/amm/README.md index 6a21867d..873fb01d 100644 --- a/packages/amm/README.md +++ b/packages/amm/README.md @@ -21,7 +21,7 @@ $ npm install @hifi/amm ## Usage The node package that you just installed contains both Solidity and JavaScript code. The former represents the smart contracts -themselves; the latter, the Hardhat artifacts and the TypeChain bindings. +themselves; the latter, the smart contract ABIs and the TypeChain bindings. ### Solidity @@ -49,7 +49,7 @@ contract YourContract { ```js import { parseUnits } from "@ethersproject/units"; import { getDefaultProvider } from "@ethersproject/providers"; -import { HifiPool__factory } from "@hifi/amm/dist/types/factories/HifiPool__factory"; +import type { HifiPool__factory } from "@hifi/amm/dist/types/factories/HifiPool__factory"; async function getQuote() { const defaultProvider = getDefaultProvider(); diff --git a/packages/amm/hardhat.config.ts b/packages/amm/hardhat.config.ts index 45f17968..43d6e6b7 100644 --- a/packages/amm/hardhat.config.ts +++ b/packages/amm/hardhat.config.ts @@ -8,7 +8,7 @@ import { resolve } from "path"; import { getChainConfig, getEnvVar } from "@hifi/helpers"; import { config as dotenvConfig } from "dotenv"; -import { HardhatUserConfig } from "hardhat/config"; +import type { HardhatUserConfig } from "hardhat/config"; dotenvConfig({ path: resolve(__dirname, "..", "..", ".env") }); diff --git a/packages/amm/test/integration/hifiPool/effects/buyHToken.ts b/packages/amm/test/integration/hifiPool/effects/buyHToken.ts index 1b5c4f39..8a06e15b 100644 --- a/packages/amm/test/integration/hifiPool/effects/buyHToken.ts +++ b/packages/amm/test/integration/hifiPool/effects/buyHToken.ts @@ -3,7 +3,7 @@ import { Zero } from "@ethersproject/constants"; import { H_TOKEN_MATURITY_ONE_YEAR, USDC_PRICE_PRECISION_SCALAR } from "@hifi/constants"; import { HifiPoolErrors, YieldSpaceErrors } from "@hifi/errors"; import { USDC, getNow, hUSDC } from "@hifi/helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { fromBn, toBn } from "evm-bn"; import forEach from "mocha-each"; diff --git a/packages/amm/test/integration/hifiPool/effects/buyUnderlying.ts b/packages/amm/test/integration/hifiPool/effects/buyUnderlying.ts index 58020f7c..1eecfdac 100644 --- a/packages/amm/test/integration/hifiPool/effects/buyUnderlying.ts +++ b/packages/amm/test/integration/hifiPool/effects/buyUnderlying.ts @@ -3,7 +3,7 @@ import { Zero } from "@ethersproject/constants"; import { H_TOKEN_MATURITY_ONE_YEAR, USDC_PRICE_PRECISION_SCALAR } from "@hifi/constants"; import { HifiPoolErrors, YieldSpaceErrors } from "@hifi/errors"; import { USDC, getNow } from "@hifi/helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { fromBn, toBn } from "evm-bn"; import forEach from "mocha-each"; diff --git a/packages/amm/test/integration/hifiPool/effects/sellHToken.ts b/packages/amm/test/integration/hifiPool/effects/sellHToken.ts index df1cd31c..fc86bee0 100644 --- a/packages/amm/test/integration/hifiPool/effects/sellHToken.ts +++ b/packages/amm/test/integration/hifiPool/effects/sellHToken.ts @@ -3,7 +3,7 @@ import { Zero } from "@ethersproject/constants"; import { H_TOKEN_MATURITY_ONE_YEAR, USDC_PRICE_PRECISION_SCALAR } from "@hifi/constants"; import { HifiPoolErrors, YieldSpaceErrors } from "@hifi/errors"; import { USDC, getNow, hUSDC } from "@hifi/helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { fromBn, toBn } from "evm-bn"; import forEach from "mocha-each"; diff --git a/packages/amm/test/integration/hifiPool/effects/sellUnderlying.ts b/packages/amm/test/integration/hifiPool/effects/sellUnderlying.ts index 7db029f5..c701b9fb 100644 --- a/packages/amm/test/integration/hifiPool/effects/sellUnderlying.ts +++ b/packages/amm/test/integration/hifiPool/effects/sellUnderlying.ts @@ -3,7 +3,7 @@ import { Zero } from "@ethersproject/constants"; import { H_TOKEN_MATURITY_ONE_YEAR, USDC_PRICE_PRECISION_SCALAR } from "@hifi/constants"; import { HifiPoolErrors, YieldSpaceErrors } from "@hifi/errors"; import { USDC, getNow, hUSDC } from "@hifi/helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { fromBn, toBn } from "evm-bn"; import forEach from "mocha-each"; diff --git a/packages/amm/test/shared/contexts.ts b/packages/amm/test/shared/contexts.ts index 63ed319f..c5663f8b 100644 --- a/packages/amm/test/shared/contexts.ts +++ b/packages/amm/test/shared/contexts.ts @@ -1,5 +1,5 @@ // eslint-disable @typescript-eslint/no-explicit-any -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { Wallet } from "@ethersproject/wallet"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; import { ethers, waffle } from "hardhat"; diff --git a/packages/amm/test/shared/deployers.ts b/packages/amm/test/shared/deployers.ts index a6ee2a16..f77725a9 100644 --- a/packages/amm/test/shared/deployers.ts +++ b/packages/amm/test/shared/deployers.ts @@ -1,12 +1,12 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { artifacts, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; import { H_TOKEN_MATURITY_ONE_YEAR, USDC_DECIMALS, USDC_NAME, USDC_SYMBOL } from "@hifi/constants"; -import { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; +import type { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; import { getHTokenName, getHifiPoolName, getHTokenSymbol, getHifiPoolSymbol } from "@hifi/helpers"; export async function deployUsdc(deployer: Signer): Promise { diff --git a/packages/amm/test/shared/fixtures.ts b/packages/amm/test/shared/fixtures.ts index e9f1d25c..ba60e3fd 100644 --- a/packages/amm/test/shared/fixtures.ts +++ b/packages/amm/test/shared/fixtures.ts @@ -1,13 +1,13 @@ -import { Signer } from "@ethersproject/abstract-signer"; -import { MockContract } from "ethereum-waffle"; +import type { Signer } from "@ethersproject/abstract-signer"; +import type { MockContract } from "ethereum-waffle"; import { artifacts, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; -import { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { YieldSpaceMock } from "../../src/types/YieldSpaceMock"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; +import type { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { YieldSpaceMock } from "../../src/types/YieldSpaceMock"; import { deployGodModeHToken, deployGodModeHifiPool, deployGodModeHifiPoolRegistry, deployUsdc } from "./deployers"; import { deployMockHToken, deployMockHifiPool, deployMockUsdc } from "./mocks"; diff --git a/packages/amm/test/shared/mocks.ts b/packages/amm/test/shared/mocks.ts index 4ee56c3c..6f357033 100644 --- a/packages/amm/test/shared/mocks.ts +++ b/packages/amm/test/shared/mocks.ts @@ -1,10 +1,10 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { H_TOKEN_DECIMALS, USDC_DECIMALS, USDC_NAME, USDC_PRICE_PRECISION_SCALAR, USDC_SYMBOL } from "@hifi/constants"; import { H_TOKEN_MATURITY_ONE_YEAR } from "@hifi/constants"; import { getHTokenName, getHTokenSymbol, getHifiPoolName, getHifiPoolSymbol } from "@hifi/helpers"; import { MockContract } from "ethereum-waffle"; import { artifacts, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; export async function deployMockHToken(deployer: Signer, underlyingAddress: string): Promise { const hTokenArtifact: Artifact = await artifacts.readArtifact("GodModeHToken"); diff --git a/packages/amm/test/shared/types.ts b/packages/amm/test/shared/types.ts index d1255bf5..979dd7e5 100644 --- a/packages/amm/test/shared/types.ts +++ b/packages/amm/test/shared/types.ts @@ -1,12 +1,12 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; -import { Fixture } from "ethereum-waffle"; -import { MockContract } from "ethereum-waffle"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; +import type { Fixture } from "ethereum-waffle"; +import type { MockContract } from "ethereum-waffle"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; -import { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { YieldSpaceMock } from "../../src/types/YieldSpaceMock"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHifiPool } from "../../src/types/GodModeHifiPool"; +import type { GodModeHifiPoolRegistry } from "../../src/types/GodModeHifiPoolRegistry"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { YieldSpaceMock } from "../../src/types/YieldSpaceMock"; declare module "mocha" { export interface Context { diff --git a/packages/flash-swap/README.md b/packages/flash-swap/README.md index 81e94011..9400296c 100644 --- a/packages/flash-swap/README.md +++ b/packages/flash-swap/README.md @@ -22,7 +22,7 @@ $ npm install @hifi/flash-swap ## Usage The node package that you just installed contains both Solidity and JavaScript code. The former represents the smart contracts -themselves; the latter, the Hardhat artifacts and the TypeChain bindings. +themselves; the latter, the smart contract ABIs and the TypeChain bindings. ### Solidity @@ -39,7 +39,7 @@ Example for Uniswap V2: import { defaultAbiCoder } from "@ethersproject/abi"; import { getDefaultProvider } from "@ethersproject/providers"; import { parseUnits } from "@ethersproject/units"; -import { UniswapV2Pair__factory } from "@hifi/flash-swap/dist/types/factories/UniswapV2Pair__factory"; +import type { UniswapV2Pair__factory } from "@hifi/flash-swap/dist/types/factories/UniswapV2Pair__factory"; async function flashSwap() { const defaultProvider = getDefaultProvider(); diff --git a/packages/flash-swap/hardhat.config.ts b/packages/flash-swap/hardhat.config.ts index 8e009e74..18b5aa32 100644 --- a/packages/flash-swap/hardhat.config.ts +++ b/packages/flash-swap/hardhat.config.ts @@ -8,7 +8,7 @@ import { resolve } from "path"; import { getChainConfig, getEnvVar } from "@hifi/helpers"; import { config as dotenvConfig } from "dotenv"; -import { HardhatUserConfig } from "hardhat/config"; +import type { HardhatUserConfig } from "hardhat/config"; dotenvConfig({ path: resolve(__dirname, "..", "..", ".env") }); diff --git a/packages/flash-swap/test/integration/hifiFlashUniswapV2/effects/uniswapV2Call.ts b/packages/flash-swap/test/integration/hifiFlashUniswapV2/effects/uniswapV2Call.ts index 176d6495..7bada29b 100644 --- a/packages/flash-swap/test/integration/hifiFlashUniswapV2/effects/uniswapV2Call.ts +++ b/packages/flash-swap/test/integration/hifiFlashUniswapV2/effects/uniswapV2Call.ts @@ -6,7 +6,7 @@ import { USDC, WBTC, hUSDC, price } from "@hifi/helpers"; import { expect } from "chai"; import { toBn } from "evm-bn"; -import { GodModeErc20 } from "../../../../src/types/GodModeErc20"; +import type { GodModeErc20 } from "../../../../src/types/GodModeErc20"; import { deployGodModeErc20 } from "../../../shared/deployers"; async function bumpPoolReserves(this: Mocha.Context, wbtcAmount: BigNumber, usdcAmount: BigNumber): Promise { diff --git a/packages/flash-swap/test/shared/contexts.ts b/packages/flash-swap/test/shared/contexts.ts index d8db4ad5..dc93fab0 100644 --- a/packages/flash-swap/test/shared/contexts.ts +++ b/packages/flash-swap/test/shared/contexts.ts @@ -1,4 +1,4 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { Wallet } from "@ethersproject/wallet"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; import { ethers, waffle } from "hardhat"; diff --git a/packages/flash-swap/test/shared/deployers.ts b/packages/flash-swap/test/shared/deployers.ts index c7cf6bfe..7f5df212 100644 --- a/packages/flash-swap/test/shared/deployers.ts +++ b/packages/flash-swap/test/shared/deployers.ts @@ -1,9 +1,9 @@ -import { Signer } from "@ethersproject/abstract-signer"; -import { BigNumber } from "@ethersproject/bignumber"; +import type { Signer } from "@ethersproject/abstract-signer"; +import type { BigNumber } from "@ethersproject/bignumber"; import { artifacts, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; export async function deployGodModeErc20( deployer: Signer, diff --git a/packages/flash-swap/test/shared/fixtures.ts b/packages/flash-swap/test/shared/fixtures.ts index 5eb8ca48..48087c27 100644 --- a/packages/flash-swap/test/shared/fixtures.ts +++ b/packages/flash-swap/test/shared/fixtures.ts @@ -1,4 +1,4 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { keccak256 } from "@ethersproject/keccak256"; import { H_TOKEN_MATURITY_ONE_YEAR } from "@hifi/constants"; import { USDC_DECIMALS, USDC_NAME, USDC_SYMBOL, WBTC_DECIMALS, WBTC_NAME, WBTC_SYMBOL } from "@hifi/constants"; @@ -10,16 +10,16 @@ import { BalanceSheetV1 } from "@hifi/protocol/typechain/BalanceSheetV1"; import { ChainlinkOperator } from "@hifi/protocol/typechain/ChainlinkOperator"; import { FintrollerV1 } from "@hifi/protocol/typechain/FintrollerV1"; import { artifacts, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; import { GodModeUniswapV2Pair__factory } from "../../src/types/factories/GodModeUniswapV2Pair__factory"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { GodModeUniswapV2Factory } from "../../src/types/GodModeUniswapV2Factory"; -import { HifiFlashUniswapV2 } from "../../src/types/HifiFlashUniswapV2"; -import { MaliciousPair } from "../../src/types/MaliciousPair"; -import { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; -import { GodModeUniswapV2Pair } from "../../src/types/GodModeUniswapV2Pair"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { GodModeUniswapV2Factory } from "../../src/types/GodModeUniswapV2Factory"; +import type { HifiFlashUniswapV2 } from "../../src/types/HifiFlashUniswapV2"; +import type { MaliciousPair } from "../../src/types/MaliciousPair"; +import type { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; +import type { GodModeUniswapV2Pair } from "../../src/types/GodModeUniswapV2Pair"; import { deployGodModeErc20 } from "./deployers"; type IntegrationFixtureReturnType = { diff --git a/packages/flash-swap/test/shared/types.ts b/packages/flash-swap/test/shared/types.ts index 9b601c27..c69cdd0d 100644 --- a/packages/flash-swap/test/shared/types.ts +++ b/packages/flash-swap/test/shared/types.ts @@ -3,12 +3,12 @@ import { ChainlinkOperator } from "@hifi/protocol/typechain/ChainlinkOperator"; import { FintrollerV1 } from "@hifi/protocol/typechain/FintrollerV1"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { GodModeUniswapV2Pair } from "../../src/types/GodModeUniswapV2Pair"; -import { HifiFlashUniswapV2 } from "../../src/types/HifiFlashUniswapV2"; -import { MaliciousPair } from "../../src/types/MaliciousPair"; -import { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { GodModeUniswapV2Pair } from "../../src/types/GodModeUniswapV2Pair"; +import type { HifiFlashUniswapV2 } from "../../src/types/HifiFlashUniswapV2"; +import type { MaliciousPair } from "../../src/types/MaliciousPair"; +import type { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; declare module "mocha" { export interface Context { diff --git a/packages/helpers/src/chains.ts b/packages/helpers/src/chains.ts index 43ff452a..67d0ca14 100644 --- a/packages/helpers/src/chains.ts +++ b/packages/helpers/src/chains.ts @@ -1,5 +1,5 @@ import { CHAIN_IDS } from "@hifi/constants"; -import { NetworkUserConfig } from "hardhat/types"; +import type { NetworkUserConfig } from "hardhat/types"; export function getChainConfig( chain: keyof typeof CHAIN_IDS, diff --git a/packages/protocol/README.md b/packages/protocol/README.md index 721216c0..45941f32 100644 --- a/packages/protocol/README.md +++ b/packages/protocol/README.md @@ -21,7 +21,7 @@ $ npm install @hifi/protocol ## Usage The node package that you just installed contains both Solidity and JavaScript code. The former represents the smart contracts -themselves; the latter, the Hardhat artifacts and the TypeChain bindings. +themselves; the latter, the smart contract ABIs and the TypeChain bindings. ### Solidity @@ -55,7 +55,7 @@ contract YourContract { ```ts import { getDefaultProvider } from "@ethersproject/providers"; -import { BalanceSheetV1__factory } from "@hifi/protocol/dist/types/factories/BalanceSheet__factory"; +import type { BalanceSheetV1__factory } from "@hifi/protocol/dist/types/factories/BalanceSheet__factory"; async function queryAccountLiquidity() { const defaultProvider = getDefaultProvider(); diff --git a/packages/protocol/hardhat.config.ts b/packages/protocol/hardhat.config.ts index 9eafad4b..00182f29 100644 --- a/packages/protocol/hardhat.config.ts +++ b/packages/protocol/hardhat.config.ts @@ -13,7 +13,7 @@ import { resolve } from "path"; import { GAS_LIMITS } from "@hifi/constants"; import { getChainConfig, getEnvVar } from "@hifi/helpers"; import { config as dotenvConfig } from "dotenv"; -import { HardhatUserConfig } from "hardhat/types"; +import type { HardhatUserConfig } from "hardhat/types"; dotenvConfig({ path: resolve(__dirname, "..", "..", ".env") }); diff --git a/packages/protocol/tasks/deploy/balanceSheet.ts b/packages/protocol/tasks/deploy/balanceSheet.ts index 1d0d76e9..7ef98f91 100644 --- a/packages/protocol/tasks/deploy/balanceSheet.ts +++ b/packages/protocol/tasks/deploy/balanceSheet.ts @@ -1,8 +1,8 @@ import * as core from "@actions/core"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; -import { BalanceSheetV1 } from "../../src/types/BalanceSheetV1"; +import type { BalanceSheetV1 } from "../../src/types/BalanceSheetV1"; import { BalanceSheetV1__factory } from "../../src/types/factories/BalanceSheetV1__factory"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, TASK_DEPLOY_CONTRACT_BALANCE_SHEET } from "../constants"; diff --git a/packages/protocol/tasks/deploy/fintroller.ts b/packages/protocol/tasks/deploy/fintroller.ts index 284d3f0c..7000ccb4 100644 --- a/packages/protocol/tasks/deploy/fintroller.ts +++ b/packages/protocol/tasks/deploy/fintroller.ts @@ -1,8 +1,8 @@ import * as core from "@actions/core"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; -import { FintrollerV1 } from "../../src/types/FintrollerV1"; +import type { FintrollerV1 } from "../../src/types/FintrollerV1"; import { FintrollerV1__factory } from "../../src/types/factories/FintrollerV1__factory"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, TASK_DEPLOY_CONTRACT_FINTROLLER } from "../constants"; diff --git a/packages/protocol/test/shared/contexts.ts b/packages/protocol/test/shared/contexts.ts index 53a77a71..36da0014 100644 --- a/packages/protocol/test/shared/contexts.ts +++ b/packages/protocol/test/shared/contexts.ts @@ -1,12 +1,10 @@ // eslint-disable @typescript-eslint/no-explicit-any -import { Signer } from "@ethersproject/abstract-signer"; -import { Wallet } from "@ethersproject/wallet"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; +import type { Signer } from "@ethersproject/abstract-signer"; +import type { Wallet } from "@ethersproject/wallet"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; import { ethers, waffle } from "hardhat"; -import { Contracts, Mocks, Signers } from "./types"; - -const { createFixtureLoader } = waffle; +import type { Contracts, Mocks, Signers } from "./types"; /// This is run at the beginning of each suite of tests: 2e2, integration and unit. export function baseContext(description: string, hooks: () => void): void { @@ -25,7 +23,7 @@ export function baseContext(description: string, hooks: () => void): void { this.signers.raider = signers[5]; // Get rid of this when https://github.com/nomiclabs/hardhat/issues/849 gets fixed. - this.loadFixture = createFixtureLoader(signers as Signer[] as Wallet[]); + this.loadFixture = waffle.createFixtureLoader(signers as Signer[] as Wallet[]); }); hooks(); diff --git a/packages/protocol/test/shared/deployers.ts b/packages/protocol/test/shared/deployers.ts index b8cefcaf..2086ab9b 100644 --- a/packages/protocol/test/shared/deployers.ts +++ b/packages/protocol/test/shared/deployers.ts @@ -1,7 +1,7 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { BigNumber } from "@ethersproject/bignumber"; import { artifacts, ethers, upgrades, waffle } from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; import { GAS_LIMITS, diff --git a/packages/protocol/test/shared/fixtures.ts b/packages/protocol/test/shared/fixtures.ts index 5c852cf7..519ffde5 100644 --- a/packages/protocol/test/shared/fixtures.ts +++ b/packages/protocol/test/shared/fixtures.ts @@ -1,4 +1,4 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { H_TOKEN_MATURITY_ONE_YEAR, H_TOKEN_MATURITY_THREE_MONTHS, @@ -11,15 +11,15 @@ import { WBTC_SYMBOL, WETH_SYMBOL, } from "@hifi/constants"; -import { MockContract } from "ethereum-waffle"; - -import { ChainlinkOperator } from "../../src/types/ChainlinkOperator"; -import { FintrollerV1 } from "../../src/types/FintrollerV1"; -import { GodModeBalanceSheet } from "../../src/types/GodModeBalanceSheet"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { OwnableUpgradeable } from "../../src/types/OwnableUpgradeable"; -import { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; +import type { MockContract } from "ethereum-waffle"; + +import type { ChainlinkOperator } from "../../src/types/ChainlinkOperator"; +import type { FintrollerV1 } from "../../src/types/FintrollerV1"; +import type { GodModeBalanceSheet } from "../../src/types/GodModeBalanceSheet"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { OwnableUpgradeable } from "../../src/types/OwnableUpgradeable"; +import type { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; import { deployChainlinkOperator, deployFintrollerV1, diff --git a/packages/protocol/test/shared/mocks.ts b/packages/protocol/test/shared/mocks.ts index eb011f59..1f341104 100644 --- a/packages/protocol/test/shared/mocks.ts +++ b/packages/protocol/test/shared/mocks.ts @@ -1,4 +1,4 @@ -import { Signer } from "@ethersproject/abstract-signer"; +import type { Signer } from "@ethersproject/abstract-signer"; import { BigNumber } from "@ethersproject/bignumber"; import { Zero } from "@ethersproject/constants"; import { @@ -17,7 +17,7 @@ import { import { getHTokenName, getHTokenSymbol } from "@hifi/helpers"; import { MockContract } from "ethereum-waffle"; import hre from "hardhat"; -import { Artifact } from "hardhat/types"; +import type { Artifact } from "hardhat/types"; const { deployMockContract } = hre.waffle; diff --git a/packages/protocol/test/shared/types.ts b/packages/protocol/test/shared/types.ts index 7d9956b1..ae5484eb 100644 --- a/packages/protocol/test/shared/types.ts +++ b/packages/protocol/test/shared/types.ts @@ -1,15 +1,15 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; -import { MockContract } from "ethereum-waffle"; -import { Fixture } from "ethereum-waffle"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; +import type { MockContract } from "ethereum-waffle"; +import type { Fixture } from "ethereum-waffle"; -import { ChainlinkOperator } from "../../src/types/ChainlinkOperator"; -import { FintrollerV1 } from "../../src/types/FintrollerV1"; -import { GodModeBalanceSheet } from "../../src/types/GodModeBalanceSheet"; -import { GodModeErc20 } from "../../src/types/GodModeErc20"; -import { GodModeHToken } from "../../src/types/GodModeHToken"; -import { OwnableUpgradeable } from "../../src/types/OwnableUpgradeable"; -import { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; -import { StablecoinPriceFeed } from "../../src/types/StablecoinPriceFeed"; +import type { ChainlinkOperator } from "../../src/types/ChainlinkOperator"; +import type { FintrollerV1 } from "../../src/types/FintrollerV1"; +import type { GodModeBalanceSheet } from "../../src/types/GodModeBalanceSheet"; +import type { GodModeErc20 } from "../../src/types/GodModeErc20"; +import type { GodModeHToken } from "../../src/types/GodModeHToken"; +import type { OwnableUpgradeable } from "../../src/types/OwnableUpgradeable"; +import type { SimplePriceFeed } from "../../src/types/SimplePriceFeed"; +import type { StablecoinPriceFeed } from "../../src/types/StablecoinPriceFeed"; declare module "mocha" { interface Context { diff --git a/packages/protocol/test/unit/balanceSheet/deployment/proxy.ts b/packages/protocol/test/unit/balanceSheet/deployment/proxy.ts index 5ea12e60..e4611e61 100644 --- a/packages/protocol/test/unit/balanceSheet/deployment/proxy.ts +++ b/packages/protocol/test/unit/balanceSheet/deployment/proxy.ts @@ -1,9 +1,9 @@ -import { BigNumber } from "@ethersproject/bignumber"; +import type { BigNumber } from "@ethersproject/bignumber"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { BalanceSheetV2__factory } from "../../../../src/types"; -import { BalanceSheetV2 } from "../../../../src/types/BalanceSheetV2"; +import type { BalanceSheetV2__factory } from "../../../../src/types"; +import type { BalanceSheetV2 } from "../../../../src/types/BalanceSheetV2"; export function shouldBehaveLikeUpgradeableProxy(): void { let balanceSheetV2: BalanceSheetV2; diff --git a/packages/protocol/test/unit/fintroller/deployment/proxy.ts b/packages/protocol/test/unit/fintroller/deployment/proxy.ts index 4fcf7e06..74100248 100644 --- a/packages/protocol/test/unit/fintroller/deployment/proxy.ts +++ b/packages/protocol/test/unit/fintroller/deployment/proxy.ts @@ -3,8 +3,8 @@ import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; import { DEFAULT_MAX_BONDS } from "@hifi/constants"; -import { FintrollerV2__factory } from "../../../../src/types"; -import { FintrollerV2 } from "../../../../src/types/FintrollerV2"; +import type { FintrollerV2__factory } from "../../../../src/types"; +import type { FintrollerV2 } from "../../../../src/types/FintrollerV2"; export function shouldBehaveLikeUpgradeableProxy(): void { let fintrollerV2: FintrollerV2; diff --git a/packages/protocol/test/unit/hToken/deployment/constructor.ts b/packages/protocol/test/unit/hToken/deployment/constructor.ts index cc713400..59ae7380 100644 --- a/packages/protocol/test/unit/hToken/deployment/constructor.ts +++ b/packages/protocol/test/unit/hToken/deployment/constructor.ts @@ -1,11 +1,11 @@ -import { BigNumber } from "@ethersproject/bignumber"; +import type { BigNumber } from "@ethersproject/bignumber"; import { Zero } from "@ethersproject/constants"; import { H_TOKEN_MATURITY_THREE_MONTHS } from "@hifi/constants"; import { HTokenErrors } from "@hifi/errors"; import { getNow } from "@hifi/helpers"; import { expect } from "chai"; -import { HToken } from "../../../../src/types/HToken"; +import type { HToken } from "../../../../src/types/HToken"; import { deployHToken } from "../../../shared/deployers"; export function shouldBehaveLikeConstructor(): void { diff --git a/packages/protocol/test/unit/hToken/effects/redeem.ts b/packages/protocol/test/unit/hToken/effects/redeem.ts index 72b9cca7..5580103c 100644 --- a/packages/protocol/test/unit/hToken/effects/redeem.ts +++ b/packages/protocol/test/unit/hToken/effects/redeem.ts @@ -3,7 +3,7 @@ import { Zero } from "@ethersproject/constants"; import { HTokenErrors } from "@hifi/errors"; import { getNow } from "@hifi/helpers"; import { USDC, getPrecisionScalar, hUSDC } from "@hifi/helpers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { toBn } from "evm-bn"; diff --git a/packages/protocol/test/unit/hToken/view/underlyingPrecisionScalar.ts b/packages/protocol/test/unit/hToken/view/underlyingPrecisionScalar.ts index be7c8d9f..0f78c700 100644 --- a/packages/protocol/test/unit/hToken/view/underlyingPrecisionScalar.ts +++ b/packages/protocol/test/unit/hToken/view/underlyingPrecisionScalar.ts @@ -1,9 +1,9 @@ -import { BigNumber } from "@ethersproject/bignumber"; +import type { BigNumber } from "@ethersproject/bignumber"; import { H_TOKEN_MATURITY_THREE_MONTHS } from "@hifi/constants"; import { getPrecisionScalar } from "@hifi/helpers"; import { expect } from "chai"; -import { HToken } from "../../../../src/types/HToken"; +import type { HToken } from "../../../../src/types/HToken"; import { deployHToken } from "../../../shared/deployers"; export function shouldBehaveLikeUnderlyingPrecisionScalarGetter(): void { diff --git a/packages/proxy-target/README.md b/packages/proxy-target/README.md index 9ab273c6..32d5120c 100644 --- a/packages/proxy-target/README.md +++ b/packages/proxy-target/README.md @@ -21,7 +21,7 @@ $ npm install @hifi/proxy-target ## Usage The node package that you just installed contains both Solidity and JavaScript code. The former represents the smart contracts -themselves; the latter, the Hardhat artifacts and the TypeChain bindings. +themselves; the latter, the smart contract ABIs and the TypeChain bindings. ### Solidity @@ -55,7 +55,7 @@ DSProxy](https://github.com/makerdao/developerguides/blob/master/devtools/workin ```js import { parseUnits } from "@ethersproject/units"; -import { HifiProxyTarget__factory } from "@hifi/protocol/dist/types/factories/HifiProxyTarget__factory"; +import type { HifiProxyTarget__factory } from "@hifi/protocol/dist/types/factories/HifiProxyTarget__factory"; async function depositCollateral() { const signer = "..."; // Get hold of an ethers.js Signer diff --git a/packages/proxy-target/hardhat.config.ts b/packages/proxy-target/hardhat.config.ts index f85ee151..df635344 100644 --- a/packages/proxy-target/hardhat.config.ts +++ b/packages/proxy-target/hardhat.config.ts @@ -6,7 +6,7 @@ import { resolve } from "path"; import { getChainConfig, getEnvVar } from "@hifi/helpers"; import { config as dotenvConfig } from "dotenv"; -import { HardhatUserConfig } from "hardhat/config"; +import type { HardhatUserConfig } from "hardhat/config"; dotenvConfig({ path: resolve(__dirname, "..", "..", ".env") }); diff --git a/packages/tasks/hardhat.config.ts b/packages/tasks/hardhat.config.ts index 9fb2b7f2..d203fde1 100644 --- a/packages/tasks/hardhat.config.ts +++ b/packages/tasks/hardhat.config.ts @@ -7,7 +7,7 @@ import { resolve } from "path"; import { getChainConfig, getEnvVar } from "@hifi/helpers"; import { config as dotenvConfig } from "dotenv"; -import { HardhatUserConfig } from "hardhat/config"; +import type { HardhatUserConfig } from "hardhat/config"; dotenvConfig({ path: resolve(__dirname, "..", "..", ".env") }); diff --git a/packages/tasks/src/deploy/chainlinkOperator.ts b/packages/tasks/src/deploy/chainlinkOperator.ts index d2596a8a..28534fcd 100644 --- a/packages/tasks/src/deploy/chainlinkOperator.ts +++ b/packages/tasks/src/deploy/chainlinkOperator.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; -import { ChainlinkOperator } from "@hifi/protocol/dist/types/ChainlinkOperator"; +import type { ChainlinkOperator } from "@hifi/protocol/dist/types/ChainlinkOperator"; import { ChainlinkOperator__factory } from "@hifi/protocol/dist/types/factories/ChainlinkOperator__factory"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, TASK_DEPLOY_CONTRACT_CHAINLINK_OPERATOR, diff --git a/packages/tasks/src/deploy/hToken.ts b/packages/tasks/src/deploy/hToken.ts index dba3aad7..ed5439f0 100644 --- a/packages/tasks/src/deploy/hToken.ts +++ b/packages/tasks/src/deploy/hToken.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; -import { HToken } from "@hifi/protocol/dist/types/HToken"; +import type { HToken } from "@hifi/protocol/dist/types/HToken"; import { HToken__factory } from "@hifi/protocol/dist/types/factories/HToken__factory"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { TaskArguments } from "hardhat/types"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, TASK_DEPLOY_CONTRACT_H_TOKEN } from "../../helpers/constants"; diff --git a/packages/tasks/src/deploy/hifiFlashUniswapV2.ts b/packages/tasks/src/deploy/hifiFlashUniswapV2.ts index 412d26bd..696e3fd7 100644 --- a/packages/tasks/src/deploy/hifiFlashUniswapV2.ts +++ b/packages/tasks/src/deploy/hifiFlashUniswapV2.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; -import { HifiFlashUniswapV2 } from "@hifi/flash-swap/dist/types/HifiFlashUniswapV2"; +import type { HifiFlashUniswapV2 } from "@hifi/flash-swap/dist/types/HifiFlashUniswapV2"; import { HifiFlashUniswapV2__factory } from "@hifi/flash-swap/dist/types/factories/HifiFlashUniswapV2__factory"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, diff --git a/packages/tasks/src/deploy/hifiPool.ts b/packages/tasks/src/deploy/hifiPool.ts index 2e09ddb6..5a4661b0 100644 --- a/packages/tasks/src/deploy/hifiPool.ts +++ b/packages/tasks/src/deploy/hifiPool.ts @@ -1,10 +1,10 @@ import * as core from "@actions/core"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { HifiPool__factory } from "@hifi/amm/dist/types/factories/HifiPool__factory"; import { HifiPoolRegistry__factory } from "@hifi/amm/dist/types/factories/HifiPoolRegistry__factory"; import { HifiPool } from "@hifi/amm/dist/types/HifiPool"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { TASK_DEPLOY_CONTRACT_HIFI_POOL } from "../../helpers/constants"; import { HifiPoolRegistry } from "@hifi/amm/dist/types/HifiPoolRegistry"; diff --git a/packages/tasks/src/deploy/hifiPoolRegistry.ts b/packages/tasks/src/deploy/hifiPoolRegistry.ts index e38250d4..f9fc1465 100644 --- a/packages/tasks/src/deploy/hifiPoolRegistry.ts +++ b/packages/tasks/src/deploy/hifiPoolRegistry.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { HifiPoolRegistry__factory } from "@hifi/amm/dist/types/factories/HifiPoolRegistry__factory"; -import { HifiPoolRegistry } from "@hifi/amm/dist/types/HifiPoolRegistry"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { HifiPoolRegistry } from "@hifi/amm/dist/types/HifiPoolRegistry"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, diff --git a/packages/tasks/src/deploy/hifiProxyTarget.ts b/packages/tasks/src/deploy/hifiProxyTarget.ts index ff4b9428..939939fd 100644 --- a/packages/tasks/src/deploy/hifiProxyTarget.ts +++ b/packages/tasks/src/deploy/hifiProxyTarget.ts @@ -1,5 +1,5 @@ import * as core from "@actions/core"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { HifiProxyTarget } from "@hifi/proxy-target/dist/types/HifiProxyTarget"; import { HifiProxyTarget__factory } from "@hifi/proxy-target/dist/types/factories/HifiProxyTarget__factory"; import { task, types } from "hardhat/config"; diff --git a/packages/tasks/src/deploy/simplePriceFeed.ts b/packages/tasks/src/deploy/simplePriceFeed.ts index 95b71445..a0a81079 100644 --- a/packages/tasks/src/deploy/simplePriceFeed.ts +++ b/packages/tasks/src/deploy/simplePriceFeed.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; -import { SimplePriceFeed } from "@hifi/protocol/dist/types/SimplePriceFeed"; +import type { SimplePriceFeed } from "@hifi/protocol/dist/types/SimplePriceFeed"; import { SimplePriceFeed__factory } from "@hifi/protocol/dist/types/factories/SimplePriceFeed__factory"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, TASK_DEPLOY_CONTRACT_SIMPLE_PRICE_FEED } from "../../helpers/constants"; diff --git a/packages/tasks/src/deploy/stablecoinPriceFeed.ts b/packages/tasks/src/deploy/stablecoinPriceFeed.ts index de5d7614..5faed88d 100644 --- a/packages/tasks/src/deploy/stablecoinPriceFeed.ts +++ b/packages/tasks/src/deploy/stablecoinPriceFeed.ts @@ -1,9 +1,9 @@ import * as core from "@actions/core"; -import { StablecoinPriceFeed } from "@hifi/protocol/dist/types/StablecoinPriceFeed"; +import type { StablecoinPriceFeed } from "@hifi/protocol/dist/types/StablecoinPriceFeed"; import { StablecoinPriceFeed__factory } from "@hifi/protocol/dist/types/factories/StablecoinPriceFeed__factory"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { SUBTASK_DEPLOY_WAIT_FOR_CONFIRMATIONS, diff --git a/packages/tasks/src/init/addLiquidity.ts b/packages/tasks/src/init/addLiquidity.ts index be41548e..417fbec8 100644 --- a/packages/tasks/src/init/addLiquidity.ts +++ b/packages/tasks/src/init/addLiquidity.ts @@ -1,14 +1,14 @@ import { BigNumber } from "@ethersproject/bignumber"; -import { Erc20 } from "@hifi/amm/dist/types/Erc20"; +import type { Erc20 } from "@hifi/amm/dist/types/Erc20"; import { Erc20__factory } from "@hifi/amm/dist/types/factories/Erc20__factory"; import { HifiPool__factory } from "@hifi/amm/dist/types/factories/HifiPool__factory"; -import { HifiPool } from "@hifi/amm/dist/types/HifiPool"; +import type { HifiPool } from "@hifi/amm/dist/types/HifiPool"; import { MaxUint256 } from "@ethersproject/constants"; import { HToken__factory } from "@hifi/protocol/dist/types/factories/HToken__factory"; -import { HToken } from "@hifi/protocol/dist/types/HToken"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import type { HToken } from "@hifi/protocol/dist/types/HToken"; +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { task, types } from "hardhat/config"; -import { TaskArguments } from "hardhat/types"; +import type { TaskArguments } from "hardhat/types"; import { TASK_INIT_ADD_LIQUIDITY } from "../../helpers/constants"; diff --git a/yarn.lock b/yarn.lock index c8d3b59d..1aba255d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -870,7 +870,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/json-wallets@npm:5.4.0, @ethersproject/json-wallets@npm:^5.4.0": +"@ethersproject/json-wallets@npm:5.4.0": version: 5.4.0 resolution: "@ethersproject/json-wallets@npm:5.4.0" dependencies: @@ -1294,30 +1294,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/wallet@npm:5.4.0": - version: 5.4.0 - resolution: "@ethersproject/wallet@npm:5.4.0" - dependencies: - "@ethersproject/abstract-provider": ^5.4.0 - "@ethersproject/abstract-signer": ^5.4.0 - "@ethersproject/address": ^5.4.0 - "@ethersproject/bignumber": ^5.4.0 - "@ethersproject/bytes": ^5.4.0 - "@ethersproject/hash": ^5.4.0 - "@ethersproject/hdnode": ^5.4.0 - "@ethersproject/json-wallets": ^5.4.0 - "@ethersproject/keccak256": ^5.4.0 - "@ethersproject/logger": ^5.4.0 - "@ethersproject/properties": ^5.4.0 - "@ethersproject/random": ^5.4.0 - "@ethersproject/signing-key": ^5.4.0 - "@ethersproject/transactions": ^5.4.0 - "@ethersproject/wordlists": ^5.4.0 - checksum: 537bea004798951476b15752fad672d919e3130aeacaff3cf2497d466f1346e5fa15b6cd716c0c879ce68bc7f33e1bd355ce11032a94e9d30eef0666b6fd1ddf - languageName: node - linkType: hard - -"@ethersproject/wallet@npm:5.5.0, @ethersproject/wallet@npm:^5.5.0": +"@ethersproject/wallet@npm:^5.5.0": version: 5.5.0 resolution: "@ethersproject/wallet@npm:5.5.0" dependencies: @@ -1728,7 +1705,7 @@ __metadata: hardhat: ^2.6.6 prettier: ^2.4.1 ts-node: ^10.3.0 - typescript: ~4.4.3 + typescript: ^4.4.4 languageName: unknown linkType: soft @@ -14940,7 +14917,7 @@ typescript@^4.3.4: languageName: node linkType: hard -"typescript@^4.4.3, typescript@~4.4.3": +typescript@^4.4.3: version: 4.4.3 resolution: "typescript@npm:4.4.3" bin: @@ -14970,7 +14947,7 @@ typescript@^4.4.4: languageName: node linkType: hard -"typescript@patch:typescript@^4.4.3#~builtin, typescript@patch:typescript@~4.4.3#~builtin": +"typescript@patch:typescript@^4.4.3#~builtin": version: 4.4.3 resolution: "typescript@patch:typescript@npm%3A4.4.3#~builtin::version=4.4.3&hash=ddd1e8" bin: