diff --git a/.eslintrc.js b/.eslintrc.js
index 753bd7f4..bbe8664f 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -21,10 +21,31 @@ module.exports = {
},
},
},
+ plugins: ["@typescript-eslint", "unused-imports", "simple-import-sort", "prettier"],
rules: {
"import/no-extraneous-dependencies": "off",
"no-console": "off",
"import/prefer-default-export": "off",
+ "unused-imports/no-unused-imports": "error",
+ "simple-import-sort/imports": [
+ "warn",
+ {
+ groups: [
+ // Side effect imports
+ ["^\\u0000"],
+ // React Package(s) comes first as seperate group
+ ["^react(-dom(/client)?)?$"],
+ // All other imports
+ ["^@?\\w"],
+ ["^((?!\\u0000$)|/.*|$)"],
+ ["^\\."],
+ // Type imports: keep these last!
+ ["^@?\\w.*\\u0000$"],
+ ["^.*\\u0000$"],
+ ["^\\..*\\u0000$"],
+ ],
+ },
+ ],
"no-nested-ternary": 1,
"no-await-in-loop": 1,
"no-restricted-syntax": 1,
@@ -32,6 +53,7 @@ module.exports = {
"@typescript-eslint/no-use-before-define": 1,
"@typescript-eslint/no-loop-func": 1,
"@typescript-eslint/no-unused-expressions": 1,
+ "@typescript-eslint/consistent-type-imports": "error",
"lines-between-class-members": 0,
"prefer-destructuring": [
1,
diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml
index 52dbbb0e..c45cef5e 100644
--- a/.github/workflows/coverage.yaml
+++ b/.github/workflows/coverage.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/lint-sol.yaml b/.github/workflows/lint-sol.yaml
index 57bab32c..4fa4d91f 100644
--- a/.github/workflows/lint-sol.yaml
+++ b/.github/workflows/lint-sol.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/lint-ts.yaml b/.github/workflows/lint-ts.yaml
index 82ea8cb5..7189f26c 100644
--- a/.github/workflows/lint-ts.yaml
+++ b/.github/workflows/lint-ts.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-emissions.yaml b/.github/workflows/test-emissions.yaml
index d0f8a273..57dd681b 100644
--- a/.github/workflows/test-emissions.yaml
+++ b/.github/workflows/test-emissions.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-feeders.yaml b/.github/workflows/test-feeders.yaml
index 23e34bfe..481ad291 100644
--- a/.github/workflows/test-feeders.yaml
+++ b/.github/workflows/test-feeders.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-governance.yaml b/.github/workflows/test-governance.yaml
index a67827c7..3e023316 100644
--- a/.github/workflows/test-governance.yaml
+++ b/.github/workflows/test-governance.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-masset.yaml b/.github/workflows/test-masset.yaml
index d96b51c5..90403dbe 100644
--- a/.github/workflows/test-masset.yaml
+++ b/.github/workflows/test-masset.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-polygon.yaml b/.github/workflows/test-polygon.yaml
index fdce80c0..8dfee88a 100644
--- a/.github/workflows/test-polygon.yaml
+++ b/.github/workflows/test-polygon.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-rewards.yaml b/.github/workflows/test-rewards.yaml
index e4fb5932..b14d0063 100644
--- a/.github/workflows/test-rewards.yaml
+++ b/.github/workflows/test-rewards.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-savings.yaml b/.github/workflows/test-savings.yaml
index 8ec2a595..5619be02 100644
--- a/.github/workflows/test-savings.yaml
+++ b/.github/workflows/test-savings.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/.github/workflows/test-shared.yaml b/.github/workflows/test-shared.yaml
index c6723c21..583db4b6 100644
--- a/.github/workflows/test-shared.yaml
+++ b/.github/workflows/test-shared.yaml
@@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 14.16.1
+ node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
diff --git a/README.md b/README.md
index a93120fb..5e422355 100644
--- a/README.md
+++ b/README.md
@@ -51,8 +51,7 @@ We publish the contract artifacts to an npm package called [@mstable/protocol](h
### Prerequisites
-- Node.js v14.16.1 (you may wish to use [nvm][1])
-- [ganache-cli][2]
+- Node.js v14.19.3 (you may wish to use [nvm][1])
### Installing dependencies
@@ -106,7 +105,6 @@ Codebase rules are enforced through a passing [GitHub Actions](https://github.co
[1]: https://github.com/nvm-sh/nvm
-[2]: https://github.com/trufflesuite/ganache-cli
### Command Line Interface
diff --git a/package.json b/package.json
index 82c3f233..07b4de13 100644
--- a/package.json
+++ b/package.json
@@ -64,7 +64,10 @@
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
+ "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.18.3",
+ "eslint-plugin-simple-import-sort": "^7.0.0",
+ "eslint-plugin-unused-imports": "^2.0.0",
"ethereum-waffle": "^3.0.0",
"hardhat-abi-exporter": "^2.2.1",
"humanize-duration": "^3.21.0",
diff --git a/tasks/SaveWrapper.ts b/tasks/SaveWrapper.ts
index 5b985aaa..fc8efcb4 100644
--- a/tasks/SaveWrapper.ts
+++ b/tasks/SaveWrapper.ts
@@ -1,12 +1,13 @@
import "ts-node/register"
import "tsconfig-paths/register"
+
import { task, types } from "hardhat/config"
import { SaveWrapper__factory } from "../types/generated"
-import { getSigner } from "./utils/signerFactory"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
-import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
import { verifyEtherscan } from "./utils/etherscan"
+import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
task("SaveWrapper.deploy", "Deploy a new SaveWrapper")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/bridge.ts b/tasks/bridge.ts
index 35f04041..4e038935 100644
--- a/tasks/bridge.ts
+++ b/tasks/bridge.ts
@@ -1,12 +1,12 @@
/* eslint-disable no-restricted-syntax */
-import { subtask, task, types } from "hardhat/config"
-
-import { IChildToken__factory, IRootChainManager__factory } from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { ethers } from "ethers"
+import { subtask, task, types } from "hardhat/config"
+import { IChildToken__factory, IRootChainManager__factory } from "types/generated"
+
import { logTxDetails } from "./utils"
-import { getSigner } from "./utils/signerFactory"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
subtask("bridge-deposit", "Sends mainnet token to Polygon across Polygon's PoS Bridge")
.addOptionalParam("token", "Symbol of mainnet token that is to be sent. eg MTA or mBTC", "MTA", types.string)
diff --git a/tasks/deployBriber.ts b/tasks/deployBriber.ts
index 4ea75f7b..46f75b6d 100644
--- a/tasks/deployBriber.ts
+++ b/tasks/deployBriber.ts
@@ -1,11 +1,13 @@
import "ts-node/register"
import "tsconfig-paths/register"
+
import { task, types } from "hardhat/config"
-import { GaugeBriber__factory, ERC20__factory, SavingsManager__factory } from "types/generated"
+import { ERC20__factory, GaugeBriber__factory, SavingsManager__factory } from "types/generated"
+
import { deployContract } from "./utils/deploy-utils"
-import { getSigner } from "./utils/signerFactory"
import { verifyEtherscan } from "./utils/etherscan"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
task("deploy-GaugeBriber")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/deployEmissionsController.ts b/tasks/deployEmissionsController.ts
index fb3aa3d0..2edbdbb0 100644
--- a/tasks/deployEmissionsController.ts
+++ b/tasks/deployEmissionsController.ts
@@ -1,23 +1,24 @@
import "ts-node/register"
import "tsconfig-paths/register"
+import { simpleToExactAmount } from "@utils/math"
import { task, types } from "hardhat/config"
import { MockRootChainManager__factory } from "types/generated"
-import { simpleToExactAmount } from "@utils/math"
-import { getSigner } from "./utils/signerFactory"
+
+import { deployContract } from "./utils/deploy-utils"
import {
+ deployBalRewardsForwarder,
deployBasicForwarder,
deployBridgeForwarder,
- deployVotiumBribeForwarder,
deployEmissionsController,
deployL2BridgeRecipients,
deployL2EmissionsController,
deployRevenueBuyBack,
deploySplitRevenueBuyBack,
- deployBalRewardsForwarder,
+ deployVotiumBribeForwarder,
} from "./utils/emissions-utils"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
-import { deployContract } from "./utils/deploy-utils"
+import { getSigner } from "./utils/signerFactory"
import { Chain } from "./utils/tokens"
task("deploy-emissions-polly", "Deploys L2EmissionsController and L2 Bridge Recipients for Polygon mUSD Vault and FRAX Farm")
diff --git a/tasks/deployFeeders.ts b/tasks/deployFeeders.ts
index 8a46041f..e62a3224 100644
--- a/tasks/deployFeeders.ts
+++ b/tasks/deployFeeders.ts
@@ -3,21 +3,19 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { task, types } from "hardhat/config"
-import {
- FeederPool__factory,
- CompoundIntegration__factory,
- CompoundIntegration,
- AlchemixIntegration,
- AlchemixIntegration__factory,
- FeederWrapper__factory,
-} from "types/generated"
import { simpleToExactAmount } from "@utils/math"
-import { ALCX, alUSD, BUSD, CREAM, cyMUSD, GUSD, mUSD, tokens } from "./utils/tokens"
+import { task, types } from "hardhat/config"
+import { AlchemixIntegration__factory, CompoundIntegration__factory, FeederPool__factory, FeederWrapper__factory } from "types/generated"
+
+import type { AlchemixIntegration, CompoundIntegration } from "types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
-import { getSigner } from "./utils/signerFactory"
-import { deployFeederPool, deployVault, FeederData, VaultData } from "./utils/feederUtils"
+import { deployFeederPool, deployVault } from "./utils/feederUtils"
import { getChain, getChainAddress, resolveToken } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
+import { ALCX, alUSD, BUSD, CREAM, cyMUSD, GUSD, mUSD, tokens } from "./utils/tokens"
+
+
+import type { FeederData, VaultData } from "./utils/feederUtils"
task("deployFeederPool", "Deploy Feeder Pool")
.addParam("masset", "Token symbol of mAsset. eg mUSD", "mUSD", types.string)
diff --git a/tasks/deployIntegration.ts b/tasks/deployIntegration.ts
index 829493b0..06481b18 100644
--- a/tasks/deployIntegration.ts
+++ b/tasks/deployIntegration.ts
@@ -2,27 +2,35 @@
import "ts-node/register"
import "tsconfig-paths/register"
+import { ZERO_ADDRESS } from "@utils/constants"
+import { simpleToExactAmount } from "@utils/math"
+import { encodeUniswapPath } from "@utils/peripheral/uniswap"
import { subtask, task, types } from "hardhat/config"
import {
- AaveV2Integration,
AaveV2Integration__factory,
DelayedProxyAdmin__factory,
- Liquidator,
Liquidator__factory,
Masset__factory,
- PAaveIntegration,
PAaveIntegration__factory,
- Unliquidator,
Unliquidator__factory,
} from "types/generated"
-import { simpleToExactAmount } from "@utils/math"
-import { encodeUniswapPath } from "@utils/peripheral/uniswap"
-import { ZERO_ADDRESS } from "@utils/constants"
+
+import type { AaveV2Integration, Liquidator, PAaveIntegration, Unliquidator } from "types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
-import { AAVE, ALCX, Chain, COMP, stkAAVE, tokens } from "./utils/tokens"
+import { verifyEtherscan } from "./utils/etherscan"
import { getChain, getChainAddress, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
-import { verifyEtherscan } from "./utils/etherscan"
+import { AAVE, ALCX, Chain, COMP, stkAAVE, tokens } from "./utils/tokens"
+
+
+
+
+
+
+
+
+
+
task("integration-aave-deploy", "Deploys an instance of AaveV2Integration contract")
.addParam(
diff --git a/tasks/deployMV3.ts b/tasks/deployMV3.ts
index f02cb29c..effac814 100644
--- a/tasks/deployMV3.ts
+++ b/tasks/deployMV3.ts
@@ -1,9 +1,9 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { task } from "hardhat/config"
import { DEAD_ADDRESS } from "@utils/constants"
import { simpleToExactAmount } from "@utils/math"
+import { task } from "hardhat/config"
const defaultConfig = {
a: 120,
diff --git a/tasks/deployMbtc.ts b/tasks/deployMbtc.ts
index d583c545..100e655f 100644
--- a/tasks/deployMbtc.ts
+++ b/tasks/deployMbtc.ts
@@ -2,29 +2,27 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { btcBassets, startingCap, config, mBtcName, mBtcSymbol, DeployedBasset } from "@utils/btcConstants"
+import { btcBassets, config, mBtcName, mBtcSymbol, startingCap } from "@utils/btcConstants"
import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
-import { Signer } from "ethers"
-import { task } from "hardhat/config"
+import { BN, simpleToExactAmount } from "@utils/math"
import { formatEther } from "ethers/lib/utils"
+import { task } from "hardhat/config"
import {
- SavingsContract,
- Masset,
AssetProxy__factory,
- MockERC20,
- MockERC20__factory,
- MockInitializableToken__factory,
- SavingsContract__factory,
+ BoostDirector__factory,
BoostedVault__factory,
- BoostedVault,
ERC20__factory,
- SaveWrapper__factory,
+ MockERC20__factory,
+ MockInitializableToken__factory,
RenWrapper__factory,
- BoostDirector__factory,
- IERC20Metadata,
+ SaveWrapper__factory,
+ SavingsContract__factory,
Unwrapper__factory,
} from "types/generated"
-import { simpleToExactAmount, BN } from "@utils/math"
+
+import type { DeployedBasset } from "@utils/btcConstants"
+import type { Signer } from "ethers"
+import type { BoostedVault, IERC20Metadata, Masset, MockERC20, SavingsContract } from "types/generated"
interface CommonAddresses {
mta: string
diff --git a/tasks/deployPolygon.ts b/tasks/deployPolygon.ts
index 418a029c..5ce7a516 100644
--- a/tasks/deployPolygon.ts
+++ b/tasks/deployPolygon.ts
@@ -1,52 +1,57 @@
/* eslint-disable no-await-in-loop */
/* eslint-disable no-console */
+import "ts-node/register"
+import "tsconfig-paths/register"
+
import { formatUnits } from "@ethersproject/units"
import { DEAD_ADDRESS, KEY_LIQUIDATOR, KEY_PROXY_ADMIN, KEY_SAVINGS_MANAGER, ONE_DAY, ZERO_ADDRESS } from "@utils/constants"
import { BN, simpleToExactAmount } from "@utils/math"
-import { Signer } from "ethers"
import { task, types } from "hardhat/config"
-import "ts-node/register"
-import "tsconfig-paths/register"
import {
- AssetProxy,
AssetProxy__factory,
- DelayedProxyAdmin,
DelayedProxyAdmin__factory,
- ERC20,
- Masset,
- MassetLogic,
+ Masset__factory,
MassetLogic__factory,
- MassetManager,
MassetManager__factory,
- Masset__factory,
- MockERC20,
MockERC20__factory,
- MockInitializableToken,
MockInitializableToken__factory,
- Nexus,
Nexus__factory,
- PAaveIntegration,
PAaveIntegration__factory,
- PLiquidator,
PLiquidator__factory,
RewardsDistributor__factory,
- SaveWrapper,
SaveWrapper__factory,
- SavingsContract,
SavingsContract__factory,
- SavingsManager,
SavingsManager__factory,
- StakingRewardsWithPlatformToken,
StakingRewardsWithPlatformToken__factory,
- Unwrapper,
Unwrapper__factory,
} from "types/generated"
-import { MassetLibraryAddresses } from "types/generated/factories/Masset__factory"
+
+import type { Signer } from "ethers"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
import { PMTA, PmUSD, PWMATIC, tokens } from "./utils/tokens"
+import type {
+ AssetProxy,
+ DelayedProxyAdmin,
+ ERC20,
+ Masset,
+ MassetLogic,
+ MassetManager,
+ MockERC20,
+ MockInitializableToken,
+ Nexus,
+ PAaveIntegration,
+ PLiquidator,
+ SaveWrapper,
+ SavingsContract,
+ SavingsManager,
+ StakingRewardsWithPlatformToken,
+ Unwrapper,
+} from "types/generated"
+import type { MassetLibraryAddresses } from "types/generated/factories/Masset__factory"
+
// FIXME: this import does not work for some reason
// import { sleep } from "@utils/time"
const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms))
@@ -465,7 +470,6 @@ task("liquidator-snap", "Dumps the config details of the liquidator on Polygon")
task("deploy-vimusd", "Deploy Polygon imUSD staking contract v-imUSD")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
.setAction(async (taskArgs, hre) => {
-
const signer = await getSigner(hre, taskArgs.speed)
const chain = getChain(hre)
const proxyAdminAddress = resolveAddress("DelayedProxyAdmin", chain)
diff --git a/tasks/deployRevenueForwarder.ts b/tasks/deployRevenueForwarder.ts
index 0773ee6b..ae844601 100644
--- a/tasks/deployRevenueForwarder.ts
+++ b/tasks/deployRevenueForwarder.ts
@@ -1,10 +1,12 @@
import "ts-node/register"
import "tsconfig-paths/register"
+
import { task, types } from "hardhat/config"
import { RevenueForwarder__factory } from "types/generated"
+
import { deployContract } from "./utils/deploy-utils"
-import { getSigner } from "./utils/signerFactory"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
task("deploy-RevenueForwarder")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/deployRevenueRecipient.ts b/tasks/deployRevenueRecipient.ts
index d5149910..d0f23e30 100644
--- a/tasks/deployRevenueRecipient.ts
+++ b/tasks/deployRevenueRecipient.ts
@@ -1,9 +1,11 @@
import "ts-node/register"
import "tsconfig-paths/register"
+import { simpleToExactAmount } from "@utils/math"
import { task } from "hardhat/config"
-import { RevenueRecipient__factory, MockERC20__factory, CRPFactory__factory, ConfigurableRightsPool__factory } from "types/generated"
-import { simpleToExactAmount, BN } from "@utils/math"
+import { ConfigurableRightsPool__factory, CRPFactory__factory, MockERC20__factory, RevenueRecipient__factory } from "types/generated"
+
+import type { BN } from "@utils/math"
interface Config {
deployer: string
diff --git a/tasks/deployRewards.ts b/tasks/deployRewards.ts
index f3916987..a095d4a6 100644
--- a/tasks/deployRewards.ts
+++ b/tasks/deployRewards.ts
@@ -1,16 +1,21 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { task, types } from "hardhat/config"
-import { ONE_WEEK } from "@utils/constants"
+import { ONE_WEEK } from "@utils/constants"
import { simpleToExactAmount } from "@utils/math"
-import { BoostedDualVault__factory, BoostDirectorV2__factory, BoostDirectorV2, StakedTokenBatcher__factory } from "../types/generated"
-import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
-import { getSignerAccount, getSigner } from "./utils/signerFactory"
+import { task, types } from "hardhat/config"
+
+import { BoostDirectorV2__factory, BoostedDualVault__factory, StakedTokenBatcher__factory } from "../types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
-import { deployVault, VaultData } from "./utils/feederUtils"
import { verifyEtherscan } from "./utils/etherscan"
-import { deployStakingToken, StakedTokenData } from "./utils/rewardsUtils"
+import { deployVault } from "./utils/feederUtils"
+import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
+import { deployStakingToken } from "./utils/rewardsUtils"
+import { getSigner, getSignerAccount } from "./utils/signerFactory"
+
+import type { BoostDirectorV2 } from "../types/generated"
+import type { VaultData } from "./utils/feederUtils"
+import type { StakedTokenData } from "./utils/rewardsUtils"
task("getBytecode-BoostedDualVault").setAction(async () => {
const size = BoostedDualVault__factory.bytecode.length / 2 / 1000
diff --git a/tasks/deploySavingsContract4626.ts b/tasks/deploySavingsContract4626.ts
index 51731b1f..b6b4f122 100644
--- a/tasks/deploySavingsContract4626.ts
+++ b/tasks/deploySavingsContract4626.ts
@@ -1,23 +1,25 @@
import "ts-node/register"
import "tsconfig-paths/register"
+
import { DEAD_ADDRESS } from "@utils/constants"
import { task, types } from "hardhat/config"
import { DelayedProxyAdmin__factory } from "types/generated"
-// Polygon imUSD Contract
-import { SavingsContractImusdPolygon22 } from "types/generated/SavingsContractImusdPolygon22"
-import { SavingsContractImusdPolygon22__factory } from "types/generated/factories/SavingsContractImusdPolygon22__factory"
// Mainnet imBTC Contract
import { SavingsContractImbtcMainnet22__factory } from "types/generated/factories/SavingsContractImbtcMainnet22__factory"
-import { SavingsContractImbtcMainnet22 } from "types/generated/SavingsContractImbtcMainnet22"
// Mainnet imUSD Contract
import { SavingsContractImusdMainnet22__factory } from "types/generated/factories/SavingsContractImusdMainnet22__factory"
-import { SavingsContractImusdMainnet22 } from "types/generated/SavingsContractImusdMainnet22"
+import { SavingsContractImusdPolygon22__factory } from "types/generated/factories/SavingsContractImusdPolygon22__factory"
+import type { SavingsContractImbtcMainnet22 } from "types/generated/SavingsContractImbtcMainnet22"
import { deployContract } from "./utils/deploy-utils"
+import { verifyEtherscan } from "./utils/etherscan"
+import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
-import { getChain, resolveAddress, getChainAddress } from "./utils/networkAddressFactory"
import { Chain } from "./utils/tokens"
-import { verifyEtherscan } from "./utils/etherscan"
+
+import type { SavingsContractImusdMainnet22 } from "types/generated/SavingsContractImusdMainnet22"
+// Polygon imUSD Contract
+import type { SavingsContractImusdPolygon22 } from "types/generated/SavingsContractImusdPolygon22"
task("upgrade-imusd-polygon", "Upgrade Polygon imUSD save contract imUSD")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/deploySavingsManager.ts b/tasks/deploySavingsManager.ts
index cafeb93a..d79757bf 100644
--- a/tasks/deploySavingsManager.ts
+++ b/tasks/deploySavingsManager.ts
@@ -1,13 +1,15 @@
import "ts-node/register"
import "tsconfig-paths/register"
+
+import { ONE_WEEK } from "@utils/constants"
+import { simpleToExactAmount } from "@utils/math"
import { task, types } from "hardhat/config"
import { SavingsManager__factory } from "types/generated"
-import { simpleToExactAmount } from "@utils/math"
-import { ONE_WEEK } from "@utils/constants"
+
import { deployContract } from "./utils/deploy-utils"
-import { getSigner } from "./utils/signerFactory"
import { verifyEtherscan } from "./utils/etherscan"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
task("deploy-SavingsManager")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/deployUnwrapper.ts b/tasks/deployUnwrapper.ts
index d894cead..b03acf1d 100644
--- a/tasks/deployUnwrapper.ts
+++ b/tasks/deployUnwrapper.ts
@@ -1,13 +1,25 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { Contract, Signer } from "ethers"
+
import { task, types } from "hardhat/config"
-import { Unwrapper__factory, AssetProxy__factory } from "types/generated"
+import { AssetProxy__factory, Unwrapper__factory } from "types/generated"
+
+import type { Contract, Signer } from "ethers"
import { deployContract } from "./utils/deploy-utils"
-import { getSigner } from "./utils/signerFactory"
+import { verifyEtherscan } from "./utils/etherscan"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
import { Chain } from "./utils/tokens"
-import { verifyEtherscan } from "./utils/etherscan"
+
+
+
+
+
+
+
+
+
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const approveUnwrapperTokens = async (chain: Chain, unwrapper: Contract, governor: Signer) => {
diff --git a/tasks/dials.ts b/tasks/dials.ts
index 0ff88b1f..114f4481 100644
--- a/tasks/dials.ts
+++ b/tasks/dials.ts
@@ -1,8 +1,10 @@
-import { BN, sum, percentToWeight, simpleToExactAmount } from "@utils/math"
-import { task, types } from "hardhat/config"
import "ts-node/register"
import "tsconfig-paths/register"
+
+import { BN, percentToWeight, simpleToExactAmount, sum } from "@utils/math"
+import { task, types } from "hardhat/config"
import { EmissionsController__factory, IERC20__factory, StakedTokenMTA__factory } from "types/generated"
+
import { MTA, usdFormatter } from "./utils"
import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
diff --git a/tasks/emissions.ts b/tasks/emissions.ts
index afeb1d19..e90944d8 100644
--- a/tasks/emissions.ts
+++ b/tasks/emissions.ts
@@ -1,26 +1,37 @@
/* eslint-disable no-restricted-syntax */
-import { TransactionResponse } from "@ethersproject/providers"
+import { ONE_HOUR } from "@utils/constants"
+import { simpleToExactAmount } from "@utils/math"
import { subtask, task, types } from "hardhat/config"
-
import {
DisperseForwarder__factory,
EmissionsController__factory,
IERC20__factory,
L2EmissionsController__factory,
RevenueBuyBack__factory,
- RevenueSplitBuyBack__factory,
RevenueForwarder__factory,
- VotiumBribeForwarder__factory,
+ RevenueSplitBuyBack__factory,
SavingsManager__factory,
+ VotiumBribeForwarder__factory,
} from "types/generated"
-import { ONE_HOUR } from "@utils/constants"
-import { simpleToExactAmount } from "@utils/math"
-import { logTxDetails, logger, mUSD, mBTC } from "./utils"
-import { getSigner } from "./utils/signerFactory"
-import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+
+import type { TransactionResponse } from "@ethersproject/providers"
+import { logger, logTxDetails, mBTC, mUSD } from "./utils"
import { getBalancerPolygonReport } from "./utils/emission-disperse-bal"
-import { sendPrivateTransaction } from "./utils/flashbots"
import { splitBuyBackRewards } from "./utils/emissions-split-buy-back"
+import { sendPrivateTransaction } from "./utils/flashbots"
+import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
+
+
+
+
+
+
+
+
+
+
+
const log = logger("emission")
subtask("emission-calc", "Calculate the weekly emissions")
diff --git a/tasks/ens.ts b/tasks/ens.ts
index 8ef038a8..250d223f 100644
--- a/tasks/ens.ts
+++ b/tasks/ens.ts
@@ -1,10 +1,11 @@
-import { subtask, task, types } from "hardhat/config"
-import { randomBytes } from "crypto"
import { ONE_YEAR } from "@utils/constants"
+import { randomBytes } from "crypto"
+import { subtask, task, types } from "hardhat/config"
import { EnsEthRegistrarController__factory } from "types/generated/factories/EnsEthRegistrarController__factory"
-import { getSigner } from "./utils/signerFactory"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, getChainAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
subtask("ens-commit", "Registers a commitment to claiming an ENS domain")
.addParam("domain", "Domain name without the .eth extension.", "mstable", types.string)
diff --git a/tasks/feeder.ts b/tasks/feeder.ts
index fb0ff77c..b8f54c7b 100644
--- a/tasks/feeder.ts
+++ b/tasks/feeder.ts
@@ -1,42 +1,46 @@
import "ts-node/register"
import "tsconfig-paths/register"
-import { task, types } from "hardhat/config"
-import { Signer } from "ethers"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { formatUnits } from "ethers/lib/utils"
+import { task, types } from "hardhat/config"
import {
ERC20__factory,
- FeederPool,
FeederPool__factory,
FeederWrapper__factory,
IERC20__factory,
InterestValidator__factory,
- Masset,
SavingsManager__factory,
} from "types/generated"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { formatUnits } from "ethers/lib/utils"
-import { dumpConfigStorage, dumpFassetStorage, dumpTokenStorage } from "./utils/storage-utils"
+
+import type { Signer } from "ethers"
+import { logTxDetails } from "./utils"
+import { getChain, getChainAddress, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
+import { params } from "./utils/params"
+import { btcFormatter, usdFormatter } from "./utils/quantity-formatters"
+import { getSwapRates } from "./utils/rates-utils"
+import { getSigner } from "./utils/signerFactory"
import {
- getMultiRedemptions,
- Balances,
+ getBasket,
getBlock,
getBlockRange,
- getBasket,
- snapConfig,
+ getCollectedInterest,
getMints,
getMultiMints,
- getSwaps,
+ getMultiRedemptions,
getRedemptions,
+ getSwaps,
outputFees,
- getCollectedInterest,
+ snapConfig,
} from "./utils/snap-utils"
-import { Chain, PFRAX, PmUSD, Token, tokens } from "./utils/tokens"
-import { btcFormatter, QuantityFormatter, usdFormatter } from "./utils/quantity-formatters"
-import { getSwapRates } from "./utils/rates-utils"
-import { getSigner } from "./utils/signerFactory"
-import { logTxDetails } from "./utils"
-import { getChain, getChainAddress, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
-import { params } from "./utils/params"
+import { dumpConfigStorage, dumpFassetStorage, dumpTokenStorage } from "./utils/storage-utils"
+import { Chain, PFRAX, PmUSD, tokens } from "./utils/tokens"
+
+import type { FeederPool, Masset } from "types/generated"
+
+import type { QuantityFormatter } from "./utils/quantity-formatters"
+import type { Balances } from "./utils/snap-utils"
+import type { Token } from "./utils/tokens"
const getBalances = async (
feederPool: Masset | FeederPool,
diff --git a/tasks/ironBankMigration.ts b/tasks/ironBankMigration.ts
index 482b00e0..87e52668 100644
--- a/tasks/ironBankMigration.ts
+++ b/tasks/ironBankMigration.ts
@@ -2,12 +2,24 @@ import "ts-node/register"
import "tsconfig-paths/register"
import { task, types } from "hardhat/config"
-import { DudIntegration, DudIntegration__factory, DudPlatform, DudPlatform__factory } from "types/generated"
-import { getSigner } from "./utils/signerFactory"
-import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { DudIntegration__factory, DudPlatform__factory } from "types/generated"
+
+import type { DudIntegration, DudPlatform } from "types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
-import { mUSD } from "./utils/tokens"
import { verifyEtherscan } from "./utils/etherscan"
+import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
+import { mUSD } from "./utils/tokens"
+
+
+
+
+
+
+
+
+
+
task("deploy-dud-contracts", "Deploys dud platform and integration contracts for migration mUSD migration from Iron Bank")
.addParam("feeder", "Token symbol or address of the Feeder Pool.", undefined, types.string, false)
diff --git a/tasks/mBTC.ts b/tasks/mBTC.ts
index 349d3036..9b2b1059 100644
--- a/tasks/mBTC.ts
+++ b/tasks/mBTC.ts
@@ -1,30 +1,34 @@
import { btcBassets, capFactor, contracts, startingCap } from "@utils/btcConstants"
-import { Signer } from "ethers"
+import { BN } from "@utils/math"
import { formatUnits } from "ethers/lib/utils"
import { task, types } from "hardhat/config"
-import { BN } from "@utils/math"
-import { MusdEth__factory } from "types/generated/factories/MusdEth__factory"
-import { MusdEth } from "types/generated/MusdEth"
import { SavingsManager__factory } from "types/generated"
-import { dumpBassetStorage, dumpConfigStorage, dumpTokenStorage } from "./utils/storage-utils"
+import { MusdEth__factory } from "types/generated/factories/MusdEth__factory"
+
+import type { Signer } from "ethers"
+import { getChain, getChainAddress } from "./utils/networkAddressFactory"
+import { getSwapRates } from "./utils/rates-utils"
+import { getSigner } from "./utils/signerFactory"
import {
- getMultiRedemptions,
- getBlockRange,
+ getBalances,
getBasket,
getBlock,
- snapConfig,
+ getBlockRange,
+ getCollectedInterest,
getMints,
getMultiMints,
+ getMultiRedemptions,
getRedemptions,
getSwaps,
outputFees,
- getBalances,
- getCollectedInterest,
+ snapConfig,
} from "./utils/snap-utils"
-import { Token, renBTC, sBTC, WBTC, mBTC, TBTC, HBTC, Chain } from "./utils/tokens"
-import { getSwapRates } from "./utils/rates-utils"
-import { getSigner } from "./utils/signerFactory"
-import { getChain, getChainAddress } from "./utils/networkAddressFactory"
+import { dumpBassetStorage, dumpConfigStorage, dumpTokenStorage } from "./utils/storage-utils"
+import { Chain, HBTC, mBTC, renBTC, sBTC, TBTC, WBTC } from "./utils/tokens"
+
+import type { MusdEth } from "types/generated/MusdEth"
+
+import type { Token } from "./utils/tokens"
const bAssets: Token[] = [renBTC, sBTC, WBTC]
diff --git a/tasks/mUSD.ts b/tasks/mUSD.ts
index c1c71c5c..a00d5dec 100644
--- a/tasks/mUSD.ts
+++ b/tasks/mUSD.ts
@@ -2,36 +2,41 @@
/* eslint-disable no-restricted-syntax */
import "ts-node/register"
import "tsconfig-paths/register"
-import { task, types } from "hardhat/config"
-import { Signer } from "ethers"
-import { Masset, MassetManager__factory, Masset__factory, SavingsManager__factory } from "types/generated"
import { BN } from "@utils/math"
+import { task, types } from "hardhat/config"
+import { Masset__factory, MassetManager__factory, SavingsManager__factory } from "types/generated"
import { MusdEth__factory } from "types/generated/factories/MusdEth__factory"
import { MusdLegacy__factory } from "types/generated/factories/MusdLegacy__factory"
-import { MusdLegacy } from "types/generated/MusdLegacy"
-import { MusdEth } from "types/generated/MusdEth"
-import { dumpBassetStorage, dumpConfigStorage, dumpTokenStorage } from "./utils/storage-utils"
+
+import type { Signer } from "ethers"
+import { getSigner } from "./utils"
+import { getChain, getChainAddress } from "./utils/networkAddressFactory"
+import { usdFormatter } from "./utils/quantity-formatters"
+import { getSwapRates } from "./utils/rates-utils"
import {
- getMultiRedemptions,
+ getBalances,
+ getBasket,
getBlock,
getBlockRange,
- getBasket,
- snapConfig,
+ getCollectedInterest,
getMints,
getMultiMints,
- getSwaps,
+ getMultiRedemptions,
getRedemptions,
+ getSwaps,
outputFees,
- getBalances,
+ snapConfig,
snapSave,
- getCollectedInterest,
} from "./utils/snap-utils"
-import { Token, sUSD, USDC, DAI, USDT, PUSDT, PUSDC, PDAI, mUSD, PmUSD, MmUSD, RmUSD, Chain } from "./utils/tokens"
-import { usdFormatter } from "./utils/quantity-formatters"
-import { getSwapRates } from "./utils/rates-utils"
-import { getSigner } from "./utils"
-import { getChain, getChainAddress } from "./utils/networkAddressFactory"
+import { dumpBassetStorage, dumpConfigStorage, dumpTokenStorage } from "./utils/storage-utils"
+import { Chain, DAI, MmUSD, mUSD, PDAI, PmUSD, PUSDC, PUSDT, RmUSD, sUSD, USDC, USDT } from "./utils/tokens"
+
+import type { Masset } from "types/generated"
+import type { MusdEth } from "types/generated/MusdEth"
+import type { MusdLegacy } from "types/generated/MusdLegacy"
+
+import type { Token } from "./utils/tokens"
const mUsdBassets: Token[] = [sUSD, USDC, DAI, USDT]
const mUsdPolygonBassets: Token[] = [PUSDC, PDAI, PUSDT]
diff --git a/tasks/masset.ts b/tasks/masset.ts
index 8894b9f2..fa0ad11c 100644
--- a/tasks/masset.ts
+++ b/tasks/masset.ts
@@ -1,9 +1,10 @@
+import { BN, simpleToExactAmount } from "@utils/math"
import { subtask, task, types } from "hardhat/config"
import { Masset__factory } from "types/generated"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { getSignerAccount } from "./utils/signerFactory"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
+import { getSignerAccount } from "./utils/signerFactory"
subtask("masset-redeem", "Redeems a number of Save credits from a savings contract")
.addParam("masset", "Symbol of the mAsset. eg mUSD or mBTC", undefined, types.string)
diff --git a/tasks/ops.ts b/tasks/ops.ts
index 5ac0b43c..9fb51ec0 100644
--- a/tasks/ops.ts
+++ b/tasks/ops.ts
@@ -1,22 +1,21 @@
+import { BN, simpleToExactAmount } from "@utils/math"
+import { DefenderRelayProvider, DefenderRelaySigner } from "defender-relay-client/lib/ethers"
import { task, types } from "hardhat/config"
import {
- PAaveIntegration__factory,
- PLiquidator__factory,
- SavingsManager__factory,
AssetProxy__factory,
- QuestManager__factory,
ERC20__factory,
+ QuestManager__factory,
RevenueRecipient__factory,
+ SavingsManager__factory,
} from "types/generated"
import { QuestType } from "types/stakedToken"
-import { DefenderRelayProvider, DefenderRelaySigner } from "defender-relay-client/lib/ethers"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { PmUSD, PUSDC, tokens } from "./utils/tokens"
-import { getSigner } from "./utils/signerFactory"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
-import { getBlockRange } from "./utils/snap-utils"
import { getQueuedUsersForQuest, hasUserCompletedQuest, signQuestUsers } from "./utils/quest-utils"
+import { getSigner } from "./utils/signerFactory"
+import { getBlockRange } from "./utils/snap-utils"
+import { PmUSD, tokens } from "./utils/tokens"
task("collect-interest", "Collects and streams interest from platforms")
.addParam(
diff --git a/tasks/poker.ts b/tasks/poker.ts
index 716b4256..e1bba515 100644
--- a/tasks/poker.ts
+++ b/tasks/poker.ts
@@ -3,15 +3,18 @@
import { formatUnits } from "@ethersproject/units"
import { fullScale } from "@utils/constants"
import { BN, simpleToExactAmount } from "@utils/math"
-import { Signer } from "ethers"
import { Contract, Provider } from "ethers-multicall"
import { gql, GraphQLClient } from "graphql-request"
import { task, types } from "hardhat/config"
-import { BoostedVault__factory, Poker, Poker__factory } from "types/generated"
-import { getSigner } from "./utils/signerFactory"
+import { BoostedVault__factory, Poker__factory } from "types/generated"
+
+import type { Signer } from "ethers"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { getChain, getChainAddress } from "./utils/networkAddressFactory"
-import { mBTC, mUSD, GUSD, BUSD, HBTC, TBTC, alUSD, TBTCv2, RAI, FEI } from "./utils/tokens"
+import { getSigner } from "./utils/signerFactory"
+import { alUSD, BUSD, FEI, GUSD, HBTC, mBTC, mUSD, RAI, TBTC, TBTCv2 } from "./utils/tokens"
+
+import type { Poker } from "types/generated"
const maxVMTA = simpleToExactAmount(600000, 18)
const maxBoost = simpleToExactAmount(3, 18)
diff --git a/tasks/rewards.ts b/tasks/rewards.ts
index 339ccfad..55f835e0 100644
--- a/tasks/rewards.ts
+++ b/tasks/rewards.ts
@@ -1,13 +1,14 @@
/* eslint-disable no-restricted-syntax */
import { BN, simpleToExactAmount } from "@utils/math"
import { subtask, task, types } from "hardhat/config"
-import { Collector__factory, SavingsManager, SavingsManager__factory, Unliquidator__factory } from "types/generated"
+import { Collector__factory, SavingsManager__factory, Unliquidator__factory } from "types/generated"
import { Comptroller__factory } from "types/generated/factories/Comptroller__factory"
+
import rewardsFiles from "./balancer-mta-rewards/20210817.json"
-import { btcFormatter, COMP, logTxDetails, mBTC, mUSD, stkAAVE, USDC, usdFormatter, USDT } from "./utils"
-import { getAaveTokens, getAlcxTokens, getBlock, getCompTokens } from "./utils/snap-utils"
-import { getSigner } from "./utils/signerFactory"
+import { btcFormatter, COMP, logTxDetails, mBTC, mUSD, stkAAVE, USDC, usdFormatter } from "./utils"
import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
+import { getAaveTokens, getAlcxTokens, getBlock, getCompTokens } from "./utils/snap-utils"
task("sum-rewards", "Totals the rewards in a disperse json file")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
diff --git a/tasks/save.ts b/tasks/save.ts
index c2f38fb2..3456adc7 100644
--- a/tasks/save.ts
+++ b/tasks/save.ts
@@ -1,9 +1,10 @@
+import { simpleToExactAmount } from "@utils/math"
import { subtask, task, types } from "hardhat/config"
import { SavingsContract__factory } from "types/generated"
-import { simpleToExactAmount } from "@utils/math"
-import { getSignerAccount } from "./utils/signerFactory"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
+import { getSignerAccount } from "./utils/signerFactory"
subtask("save-deposit", "Deposit to savings contract")
.addParam("masset", "Symbol of the mAsset. eg mUSD or mBTC", undefined, types.string)
diff --git a/tasks/stakingV1.ts b/tasks/stakingV1.ts
index 940e289a..85d88fd1 100644
--- a/tasks/stakingV1.ts
+++ b/tasks/stakingV1.ts
@@ -1,9 +1,10 @@
import axios from "axios"
import { subtask, task, types } from "hardhat/config"
import { IEjector__factory, IncentivisedVotingLockup__factory } from "types/generated"
-import { getSigner } from "./utils/signerFactory"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, getChainAddress, resolveAddress } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
task("eject-stakers", "Ejects expired stakers from Meta staking contract (vMTA)")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "average", types.string)
diff --git a/tasks/stakingV2.ts b/tasks/stakingV2.ts
index a81e667d..3277fa80 100644
--- a/tasks/stakingV2.ts
+++ b/tasks/stakingV2.ts
@@ -1,16 +1,27 @@
-import { subtask, task, types } from "hardhat/config"
-import { StakedTokenBPT__factory, StakedTokenMTA__factory, StakedToken__factory, StakedTokenBatcher__factory } from "types/generated"
-import { BN, simpleToExactAmount } from "@utils/math"
import { formatUnits } from "@ethersproject/units"
import { ONE_WEEK } from "@utils/constants"
+import { BN, simpleToExactAmount } from "@utils/math"
import { gql, GraphQLClient } from "graphql-request"
-import { Signer } from "ethers"
-import { getSigner } from "./utils/signerFactory"
-import { logTxDetails, logger } from "./utils/deploy-utils"
+import { subtask, task, types } from "hardhat/config"
+import { StakedToken__factory, StakedTokenBatcher__factory, StakedTokenBPT__factory, StakedTokenMTA__factory } from "types/generated"
+
+import type { Signer } from "ethers"
+import { logger, logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
import { usdFormatter } from "./utils/quantity-formatters"
+import { getSigner } from "./utils/signerFactory"
import { getBlock } from "./utils/snap-utils"
+
+
+
+
+
+
+
+
+
+
const log = logger("stakingV2")
interface Account {
id: string
diff --git a/tasks/token.ts b/tasks/token.ts
index 76a38ce5..348d15f6 100644
--- a/tasks/token.ts
+++ b/tasks/token.ts
@@ -1,11 +1,12 @@
-import { subtask, task, types } from "hardhat/config"
-import { ERC20__factory, MockERC20__factory } from "types/generated"
+import { MAX_INT128 } from "@utils/constants"
import { simpleToExactAmount } from "@utils/math"
import { formatUnits } from "ethers/lib/utils"
-import { MAX_INT128 } from "@utils/constants"
-import { getSigner } from "./utils/signerFactory"
+import { subtask, task, types } from "hardhat/config"
+import { ERC20__factory, MockERC20__factory } from "types/generated"
+
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
+import { getSigner } from "./utils/signerFactory"
subtask("token-approve", "Approve address or contract to spend (transferFrom) an amount of tokens from the signer's account")
.addParam("asset", "Symbol of the asset being approved. eg mUSD, imUSD, GUSD, alUSD, MTA", undefined, types.string)
diff --git a/tasks/utils/deploy-utils.ts b/tasks/utils/deploy-utils.ts
index 5c3cffdd..0e83ef8e 100644
--- a/tasks/utils/deploy-utils.ts
+++ b/tasks/utils/deploy-utils.ts
@@ -1,6 +1,7 @@
import { formatUnits } from "@ethersproject/units"
import debug from "debug"
-import { Contract, ContractFactory, ContractReceipt, ContractTransaction, Overrides } from "ethers"
+
+import type { Contract, ContractFactory, ContractReceipt, ContractTransaction, Overrides } from "ethers"
export const deployContract = async (
contractFactory: ContractFactory,
diff --git a/tasks/utils/emission-disperse-bal.ts b/tasks/utils/emission-disperse-bal.ts
index 46543d08..c87ee344 100644
--- a/tasks/utils/emission-disperse-bal.ts
+++ b/tasks/utils/emission-disperse-bal.ts
@@ -1,7 +1,8 @@
-import axios from "axios"
import { BN, simpleToExactAmount } from "@utils/math"
-import { PMTA } from "./tokens"
+import axios from "axios"
+
import { logger } from "./deploy-utils"
+import { PMTA } from "./tokens"
const log = logger("emission", "disperse-bal")
diff --git a/tasks/utils/emissions-split-buy-back.ts b/tasks/utils/emissions-split-buy-back.ts
index 82b395ad..f07a9330 100644
--- a/tasks/utils/emissions-split-buy-back.ts
+++ b/tasks/utils/emissions-split-buy-back.ts
@@ -1,9 +1,13 @@
/* eslint-disable no-await-in-loop */
-import { Signer } from "@ethersproject/abstract-signer"
-import { ContractTransaction } from "ethers"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { RevenueSplitBuyBack, ERC20__factory, IERC20Metadata } from "types/generated"
-import { EncodedPaths, encodeUniswapPath, getWETHPath, quoteSwap } from "@utils/peripheral/uniswap"
+import { simpleToExactAmount } from "@utils/math"
+import { encodeUniswapPath, getWETHPath, quoteSwap } from "@utils/peripheral/uniswap"
+import { ERC20__factory } from "types/generated"
+
+import type { Signer } from "@ethersproject/abstract-signer"
+import type { BN } from "@utils/math"
+import type { EncodedPaths } from "@utils/peripheral/uniswap"
+import type { ContractTransaction } from "ethers"
+import type { IERC20Metadata, RevenueSplitBuyBack } from "types/generated"
export interface MAssetSwap {
address: string
@@ -66,15 +70,15 @@ export const calculateBuyBackRewardsQuote = async (signer: Signer, params: MainP
const treasuryFee: BN = await revenueSplitBuyBack.treasuryFee()
const rewardsToken = await revenueSplitBuyBack.REWARDS_TOKEN()
- const rewardsTokenContract = (ERC20__factory.connect(rewardsToken, signer) as unknown as IERC20Metadata)
+ const rewardsTokenContract = ERC20__factory.connect(rewardsToken, signer) as unknown as IERC20Metadata
const rTokenDecimals = await rewardsTokenContract.decimals()
const rTokenSymbol = await rewardsTokenContract.symbol()
for (let i = 0; i < mAssets.length; i = 1 + 1) {
const mAsset = mAssets[i]
const bAsset: string = await revenueSplitBuyBack.bassets(mAsset.address)
- const mAssetContract = (ERC20__factory.connect(mAsset.address, signer)as unknown as IERC20Metadata)
- const bAssetContract = (ERC20__factory.connect(bAsset, signer)as unknown as IERC20Metadata)
+ const mAssetContract = ERC20__factory.connect(mAsset.address, signer) as unknown as IERC20Metadata
+ const bAssetContract = ERC20__factory.connect(bAsset, signer) as unknown as IERC20Metadata
const mAssetBalance: BN = await mAssetContract.balanceOf(revenueSplitBuyBack.address)
const mAssetSymbol: string = await mAssetContract.symbol()
diff --git a/tasks/utils/emissions-utils.ts b/tasks/utils/emissions-utils.ts
index 03492453..95a0f264 100644
--- a/tasks/utils/emissions-utils.ts
+++ b/tasks/utils/emissions-utils.ts
@@ -1,34 +1,38 @@
-import { Signer } from "@ethersproject/abstract-signer"
-import { BN } from "@utils/math"
-import { HardhatRuntimeEnvironment } from "hardhat/types"
import {
AssetProxy__factory,
- BasicRewardsForwarder,
+ BalRewardsForwarder__factory,
BasicRewardsForwarder__factory,
- BridgeForwarder,
BridgeForwarder__factory,
- DisperseForwarder,
DisperseForwarder__factory,
- VotiumBribeForwarder,
- VotiumBribeForwarder__factory,
- EmissionsController,
EmissionsController__factory,
- L2BridgeRecipient,
L2BridgeRecipient__factory,
- L2EmissionsController,
L2EmissionsController__factory,
- RevenueBuyBack,
RevenueBuyBack__factory,
RevenueSplitBuyBack__factory,
- RevenueSplitBuyBack,
- BalRewardsForwarder,
- BalRewardsForwarder__factory,
+ VotiumBribeForwarder__factory,
} from "types/generated"
+
+import type { Signer } from "@ethersproject/abstract-signer"
import { deployContract, logTxDetails } from "./deploy-utils"
import { verifyEtherscan } from "./etherscan"
import { getChain, resolveAddress } from "./networkAddressFactory"
import { Chain } from "./tokens"
+import type { BN } from "@utils/math"
+import type { HardhatRuntimeEnvironment } from "hardhat/types"
+import type {
+ BalRewardsForwarder,
+ BasicRewardsForwarder,
+ BridgeForwarder,
+ DisperseForwarder,
+ EmissionsController,
+ L2BridgeRecipient,
+ L2EmissionsController,
+ RevenueBuyBack,
+ RevenueSplitBuyBack,
+ VotiumBribeForwarder,
+} from "types/generated"
+
export const deployEmissionsController = async (signer: Signer, hre: HardhatRuntimeEnvironment): Promise => {
const chain = getChain(hre)
diff --git a/tasks/utils/etherscan.ts b/tasks/utils/etherscan.ts
index de2eb43e..cc414176 100644
--- a/tasks/utils/etherscan.ts
+++ b/tasks/utils/etherscan.ts
@@ -1,4 +1,4 @@
-import { HardhatRuntimeEnvironment } from "hardhat/types"
+import type { HardhatRuntimeEnvironment } from "hardhat/types"
export const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms))
diff --git a/tasks/utils/feederUtils.ts b/tasks/utils/feederUtils.ts
index 090c1863..4eee175c 100644
--- a/tasks/utils/feederUtils.ts
+++ b/tasks/utils/feederUtils.ts
@@ -1,35 +1,40 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-await-in-loop */
import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { Signer } from "ethers"
+import { BN } from "@utils/math"
import { formatEther } from "ethers/lib/utils"
-import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"
import {
- FeederPool,
- NonPeggedFeederPool,
- BoostedVault,
- MockERC20__factory,
- MockInitializableToken__factory,
AssetProxy__factory,
- MockERC20,
- FeederPool__factory,
- NonPeggedFeederPool__factory,
+ BoostedDualVault__factory,
BoostedVault__factory,
+ FeederPool__factory,
+ IRedemptionPriceSnap__factory,
Masset__factory,
- BoostedDualVault,
- StakingRewardsWithPlatformToken,
- StakingRewards,
- BoostedDualVault__factory,
- StakingRewardsWithPlatformToken__factory,
+ MockERC20__factory,
+ MockInitializableToken__factory,
+ NonPeggedFeederPool__factory,
StakingRewards__factory,
- IRedemptionPriceSnap__factory,
+ StakingRewardsWithPlatformToken__factory,
} from "types/generated"
+
+import type { Signer } from "ethers"
import { deployContract } from "./deploy-utils"
import { verifyEtherscan } from "./etherscan"
import { getChain, getChainAddress } from "./networkAddressFactory"
import { getSigner } from "./signerFactory"
-import { Token } from "./tokens"
+
+import type { HardhatRuntimeEnvironment } from "hardhat/types/runtime"
+import type {
+ BoostedDualVault,
+ BoostedVault,
+ FeederPool,
+ MockERC20,
+ NonPeggedFeederPool,
+ StakingRewards,
+ StakingRewardsWithPlatformToken,
+} from "types/generated"
+
+import type { Token } from "./tokens"
interface Config {
a: BN
diff --git a/tasks/utils/flashbots.ts b/tasks/utils/flashbots.ts
index 6d4c2368..46a09346 100644
--- a/tasks/utils/flashbots.ts
+++ b/tasks/utils/flashbots.ts
@@ -1,9 +1,11 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-await-in-loop */
/* eslint-disable @typescript-eslint/no-unused-vars */
-import { PopulatedTransaction, Signer, UnsignedTransaction } from "ethers"
+import { JsonRpcProvider } from "@ethersproject/providers"
import { BN } from "@utils/math"
-import { JsonRpcProvider, TransactionResponse } from "@ethersproject/providers"
+
+import type { TransactionResponse } from "@ethersproject/providers"
+import type { PopulatedTransaction, Signer, UnsignedTransaction } from "ethers"
// Ethers provider for Flashbots Protect RPC
const flashbotsProvider = new JsonRpcProvider("https://rpc.flashbots.net")
diff --git a/tasks/utils/networkAddressFactory.ts b/tasks/utils/networkAddressFactory.ts
index 927335d1..3a082675 100644
--- a/tasks/utils/networkAddressFactory.ts
+++ b/tasks/utils/networkAddressFactory.ts
@@ -1,6 +1,9 @@
import { DEAD_ADDRESS } from "@utils/constants"
import { ethereumAddress } from "@utils/regex"
-import { AssetAddressTypes, Chain, Token, tokens } from "./tokens"
+
+import { Chain, tokens } from "./tokens"
+
+import type { AssetAddressTypes, Token } from "./tokens"
export const contractNames = [
"Nexus",
diff --git a/tasks/utils/params.ts b/tasks/utils/params.ts
index e7ae1383..c3892608 100644
--- a/tasks/utils/params.ts
+++ b/tasks/utils/params.ts
@@ -1,8 +1,9 @@
-import { CLIArgumentType } from "hardhat/src/types/index"
import { isValidAddress } from "ethereumjs-util"
import { HardhatError } from "hardhat/internal/core/errors"
import { ERRORS } from "hardhat/internal/core/errors-list"
+import type { CLIArgumentType } from "hardhat/src/types/index"
+
/**
* Hardhat task CLI argument types
*/
diff --git a/tasks/utils/quantity-formatters.ts b/tasks/utils/quantity-formatters.ts
index e0b3ff90..25704e79 100644
--- a/tasks/utils/quantity-formatters.ts
+++ b/tasks/utils/quantity-formatters.ts
@@ -1,6 +1,7 @@
-import { BN } from "@utils/math"
import { formatUnits } from "ethers/lib/utils"
+import type { BN } from "@utils/math"
+
export type QuantityFormatter = (amount: BN, decimals?: number, pad?: number, displayDecimals?: number) => string
export const usdFormatter: QuantityFormatter = (amount: BN, decimals = 18, pad = 14, displayDecimals = 2): string => {
diff --git a/tasks/utils/quest-utils.ts b/tasks/utils/quest-utils.ts
index e8078880..8ea2c87f 100644
--- a/tasks/utils/quest-utils.ts
+++ b/tasks/utils/quest-utils.ts
@@ -1,7 +1,8 @@
import axios from "axios"
-import { BigNumberish, Signer } from "ethers"
import { arrayify, solidityKeccak256 } from "ethers/lib/utils"
+import type { BigNumberish, Signer } from "ethers"
+
const questBookUrl = "https://europe-west1-mstable-questbook.cloudfunctions.net/questbook"
export const signUserQuests = async (user: string, questIds: BigNumberish[], questSigner: Signer): Promise => {
diff --git a/tasks/utils/rates-utils.ts b/tasks/utils/rates-utils.ts
index 49e03f78..24c62ce7 100644
--- a/tasks/utils/rates-utils.ts
+++ b/tasks/utils/rates-utils.ts
@@ -1,13 +1,18 @@
/* eslint-disable no-restricted-syntax */
import { applyDecimals, BN, simpleToExactAmount } from "@utils/math"
-import { FeederPool, ICurve__factory, Masset } from "types/generated"
+import { ICurve__factory } from "types/generated"
import { CurveRegistryExchange__factory } from "types/generated/factories/CurveRegistryExchange__factory"
-import { MusdEth } from "types/generated/MusdEth"
-import { MusdLegacy } from "types/generated/MusdLegacy"
+
+import type { FeederPool, Masset } from "types/generated"
import { getChainAddress } from "./networkAddressFactory"
-import { QuantityFormatter } from "./quantity-formatters"
import { isMusdLegacy } from "./snap-utils"
-import { Chain, PDAI, PUSDC, PUSDT, Token } from "./tokens"
+import { Chain, PDAI, PUSDC, PUSDT } from "./tokens"
+
+import type { MusdEth } from "types/generated/MusdEth"
+import type { MusdLegacy } from "types/generated/MusdLegacy"
+
+import type { QuantityFormatter } from "./quantity-formatters"
+import type { Token } from "./tokens"
export interface Balances {
total: BN
diff --git a/tasks/utils/rewardsUtils.ts b/tasks/utils/rewardsUtils.ts
index 9da37927..ee54bda1 100644
--- a/tasks/utils/rewardsUtils.ts
+++ b/tasks/utils/rewardsUtils.ts
@@ -1,26 +1,27 @@
-import { BigNumberish } from "@ethersproject/bignumber"
-import { Contract } from "@ethersproject/contracts"
import { formatBytes32String } from "@ethersproject/strings"
-import { Signer } from "ethers"
-import { Account } from "types/common"
-import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"
import {
AssetProxy__factory,
+ BridgeForwarder__factory,
InstantProxyAdmin__factory,
- PlatformTokenVendorFactory__factory,
- L2BridgeRecipient,
L2BridgeRecipient__factory,
- BridgeForwarder,
- BridgeForwarder__factory,
+ PlatformTokenVendorFactory__factory,
QuestManager__factory,
SignatureVerifier__factory,
StakedTokenBPT__factory,
StakedTokenMTA__factory,
} from "types/generated"
-import { deployContract } from "./deploy-utils"
+
import { verifyEtherscan } from "./etherscan"
import { getChain, getChainAddress, resolveAddress } from "./networkAddressFactory"
+import type { BigNumberish } from "@ethersproject/bignumber"
+import type { Contract } from "@ethersproject/contracts"
+import type { Signer } from "ethers"
+import type { HardhatRuntimeEnvironment } from "hardhat/types/runtime"
+import type { Account } from "types/common"
+import type { BridgeForwarder, L2BridgeRecipient } from "types/generated"
+import { deployContract } from "./deploy-utils"
+
export interface StakedTokenData {
rewardsTokenSymbol: string
stakedTokenSymbol: string
diff --git a/tasks/utils/signerFactory.ts b/tasks/utils/signerFactory.ts
index 10f8710a..6d61b63a 100644
--- a/tasks/utils/signerFactory.ts
+++ b/tasks/utils/signerFactory.ts
@@ -1,10 +1,15 @@
-import { Speed } from "defender-relay-client"
-import { Signer, Wallet } from "ethers"
-import { DefenderRelayProvider, DefenderRelaySigner } from "defender-relay-client/lib/ethers"
import { impersonate } from "@utils/fork"
import { ethereumAddress, privateKey } from "@utils/regex"
-import { Account } from "types"
-import { getChain, getChainAddress, HardhatRuntime, resolveAddress } from "./networkAddressFactory"
+import { DefenderRelayProvider, DefenderRelaySigner } from "defender-relay-client/lib/ethers"
+import { Wallet } from "ethers"
+
+
+import type { Speed } from "defender-relay-client"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import { getChain, getChainAddress, resolveAddress } from "./networkAddressFactory"
+
+import type { HardhatRuntime } from "./networkAddressFactory"
export const getDefenderSigner = async (speed: Speed = "fast"): Promise => {
if (!process.env.DEFENDER_API_KEY || !process.env.DEFENDER_API_SECRET) {
diff --git a/tasks/utils/snap-utils.ts b/tasks/utils/snap-utils.ts
index 81864d8e..4a2ce656 100644
--- a/tasks/utils/snap-utils.ts
+++ b/tasks/utils/snap-utils.ts
@@ -1,33 +1,35 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable no-await-in-loop */
/* eslint-disable no-restricted-syntax */
-import { Signer } from "ethers"
import { fullScale, ONE_DAY, ONE_WEEK, ONE_YEAR } from "@utils/constants"
import { applyDecimals, applyRatio, BN, simpleToExactAmount } from "@utils/math"
+import { encodeUniswapPath } from "@utils/peripheral/uniswap"
import { formatUnits } from "ethers/lib/utils"
import {
ERC20__factory,
- ExposedMassetLogic,
- FeederPool,
IAaveIncentivesController__factory,
IAlchemixStakingPools__factory,
IUniswapV2Router02__factory,
IUniswapV3Quoter__factory,
Liquidator__factory,
- Masset,
SavingsContract__factory,
- SavingsManager,
ValidatorWithTVLCap__factory,
} from "types/generated"
-import { MusdEth } from "types/generated/MusdEth"
-import { encodeUniswapPath } from "@utils/peripheral/uniswap"
import { AaveStakedTokenV2__factory } from "types/generated/factories/AaveStakedTokenV2__factory"
import { Comptroller__factory } from "types/generated/factories/Comptroller__factory"
-import { MusdLegacy } from "types/generated/MusdLegacy"
-import { QuantityFormatter, usdFormatter } from "./quantity-formatters"
-import { AAVE, ALCX, alUSD, BUSD, Chain, COMP, DAI, FEI, GUSD, RAI, stkAAVE, sUSD, Token, USDC, USDT, WBTC } from "./tokens"
+
+import { usdFormatter } from "./quantity-formatters"
+import { AAVE, ALCX, alUSD, BUSD, Chain, COMP, DAI, FEI, GUSD, RAI, stkAAVE, sUSD, USDC, USDT, WBTC } from "./tokens"
+
+import type { Signer } from "ethers"
+import type { ExposedMassetLogic, FeederPool, Masset, SavingsManager } from "types/generated"
+import type { MusdEth } from "types/generated/MusdEth"
+import type { MusdLegacy } from "types/generated/MusdLegacy"
import { getChainAddress, resolveAddress } from "./networkAddressFactory"
+import type { QuantityFormatter } from "./quantity-formatters"
+import type { Token } from "./tokens"
+
const comptrollerAddress = "0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B"
const uniswapEthToken = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
export interface TxSummary {
diff --git a/tasks/utils/storage-utils.ts b/tasks/utils/storage-utils.ts
index 3031f00d..5f9fa7f3 100644
--- a/tasks/utils/storage-utils.ts
+++ b/tasks/utils/storage-utils.ts
@@ -1,13 +1,15 @@
/* eslint-disable no-await-in-loop */
/* eslint-disable no-restricted-syntax */
-import { FeederPool, Masset, MV1, MV2 } from "types/generated"
import { BasketManager__factory } from "types/generated/factories/BasketManager__factory"
-import { MusdEth } from "types/generated/MusdEth"
-import { MusdLegacy } from "types/generated/MusdLegacy"
+
+import type { FeederPool, Masset, MV1, MV2 } from "types/generated"
import { getChainAddress } from "./networkAddressFactory"
import { isFeederPool, isMusdEth, isMusdLegacy } from "./snap-utils"
import { Chain } from "./tokens"
+import type { MusdEth } from "types/generated/MusdEth"
+import type { MusdLegacy } from "types/generated/MusdLegacy"
+
// Get mAsset token storage variables
export const dumpTokenStorage = async (token: Masset | MusdEth | MusdLegacy | FeederPool, toBlock: number): Promise => {
const override = {
diff --git a/tasks/vault.ts b/tasks/vault.ts
index 23d0fc62..810d3320 100644
--- a/tasks/vault.ts
+++ b/tasks/vault.ts
@@ -1,11 +1,12 @@
-import { subtask, task, types } from "hardhat/config"
-import { BoostedVault__factory, StakingRewards__factory } from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { formatUnits } from "ethers/lib/utils"
-import { getSignerAccount } from "./utils/signerFactory"
+import { subtask, task, types } from "hardhat/config"
+import { BoostedVault__factory, StakingRewards__factory } from "types/generated"
+
import { logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
import { usdFormatter } from "./utils/quantity-formatters"
+import { getSignerAccount } from "./utils/signerFactory"
import { getBlock } from "./utils/snap-utils"
subtask("vault-snap", "Dumps user data for a vault")
diff --git a/test/buy-and-make/revenue-buy-back.spec.ts b/test/buy-and-make/revenue-buy-back.spec.ts
index 05aec72f..0db70c4a 100644
--- a/test/buy-and-make/revenue-buy-back.spec.ts
+++ b/test/buy-and-make/revenue-buy-back.spec.ts
@@ -1,26 +1,29 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-
+import { encodeUniswapPath } from "@utils/peripheral/uniswap"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- MockERC20,
+ EmissionsController__factory,
+ MockMasset__factory,
MockNexus__factory,
- MockNexus,
- RevenueBuyBack__factory,
- RevenueBuyBack,
- MockUniswapV3,
+ MockStakingContract__factory,
MockUniswapV3__factory,
+ RevenueBuyBack__factory,
+} from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { EncodedPaths } from "@utils/peripheral/uniswap"
+import type {
EmissionsController,
- MockStakingContract,
- MockStakingContract__factory,
- MockMasset__factory,
+ MockERC20,
MockMasset,
- EmissionsController__factory,
+ MockNexus,
+ MockStakingContract,
+ MockUniswapV3,
+ RevenueBuyBack,
} from "types/generated"
-import { EncodedPaths, encodeUniswapPath } from "@utils/peripheral/uniswap"
-import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
describe("RevenueBuyBack", () => {
let sa: StandardAccounts
diff --git a/test/buy-and-make/revenue-forwarder.spec.ts b/test/buy-and-make/revenue-forwarder.spec.ts
index 34371d33..c91cbe18 100644
--- a/test/buy-and-make/revenue-forwarder.spec.ts
+++ b/test/buy-and-make/revenue-forwarder.spec.ts
@@ -1,19 +1,13 @@
-import { ethers } from "hardhat"
+import { Wallet } from "@ethersproject/wallet"
+import { ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
+import { ethers } from "hardhat"
+import { MockMasset__factory, MockNexus__factory, RevenueForwarder__factory } from "types/generated"
-import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-
-import {
- MockNexus__factory,
- MockNexus,
- MockMasset__factory,
- MockMasset,
- RevenueForwarder__factory,
- RevenueForwarder,
-} from "types/generated"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { Wallet } from "@ethersproject/wallet"
+import type { StandardAccounts } from "@utils/machines"
+import type { MockMasset, MockNexus, RevenueForwarder } from "types/generated"
describe("RevenueForwarder", () => {
let sa: StandardAccounts
diff --git a/test/buy-and-make/revenue-recipient.spec.ts b/test/buy-and-make/revenue-recipient.spec.ts
index bbd55b0d..d9ea5f64 100644
--- a/test/buy-and-make/revenue-recipient.spec.ts
+++ b/test/buy-and-make/revenue-recipient.spec.ts
@@ -1,19 +1,12 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { MockBPool__factory, MockNexus__factory, RevenueRecipient__factory } from "types/generated"
-import {
- MockBPool__factory,
- RevenueRecipient__factory,
- MockBPool,
- RevenueRecipient,
- MockERC20,
- MockNexus__factory,
- MockNexus,
-} from "types/generated"
-import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import type { StandardAccounts } from "@utils/machines"
+import type { MockBPool, MockERC20, MockNexus, RevenueRecipient } from "types/generated"
describe("RevenueRecipient", () => {
let sa: StandardAccounts
diff --git a/test/buy-and-make/revenue-split-buy-back.spec.ts b/test/buy-and-make/revenue-split-buy-back.spec.ts
index ba05426a..4646759c 100644
--- a/test/buy-and-make/revenue-split-buy-back.spec.ts
+++ b/test/buy-and-make/revenue-split-buy-back.spec.ts
@@ -1,27 +1,30 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-
+import { encodeUniswapPath } from "@utils/peripheral/uniswap"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- MockERC20,
+ EmissionsController__factory,
+ MockMasset__factory,
MockNexus__factory,
- MockNexus,
- RevenueSplitBuyBack__factory,
- RevenueSplitBuyBack,
- MockUniswapV3,
+ MockStakingContract__factory,
MockUniswapV3__factory,
+ RevenueSplitBuyBack__factory,
+} from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { EncodedPaths } from "@utils/peripheral/uniswap"
+import type { BigNumber, Signer, Wallet } from "ethers"
+import type {
EmissionsController,
- MockStakingContract,
- MockStakingContract__factory,
- MockMasset__factory,
+ MockERC20,
MockMasset,
- EmissionsController__factory,
+ MockNexus,
+ MockStakingContract,
+ MockUniswapV3,
+ RevenueSplitBuyBack,
} from "types/generated"
-import { EncodedPaths, encodeUniswapPath } from "@utils/peripheral/uniswap"
-import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
-import { BigNumber, Signer, Wallet } from "ethers"
describe("RevenueSplitBuyBack", () => {
let sa: StandardAccounts
diff --git a/test/emissions/bal-rewards-forwarder.spec.ts b/test/emissions/bal-rewards-forwarder.spec.ts
index 808c8ded..0839139b 100644
--- a/test/emissions/bal-rewards-forwarder.spec.ts
+++ b/test/emissions/bal-rewards-forwarder.spec.ts
@@ -1,21 +1,22 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { Wallet } from "@ethersproject/wallet"
+import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
+ BalRewardsForwarder__factory,
+ MockChildChainStreamer__factory,
MockNexus__factory,
- MockNexus,
+} from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines";
+import type { Account } from "types/common"
+import type {
BalRewardsForwarder,
- BalRewardsForwarder__factory,
MockChildChainStreamer,
- MockChildChainStreamer__factory,
MockERC20,
-} from "types/generated"
-import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { Wallet } from "@ethersproject/wallet"
-import { Account } from "types/common"
+ MockNexus} from "types/generated";
describe("BalRewardsForwarder", () => {
let sa: StandardAccounts
diff --git a/test/emissions/basic-rewards-forwarder.spec.ts b/test/emissions/basic-rewards-forwarder.spec.ts
index 7a8cf1af..176bc65b 100644
--- a/test/emissions/basic-rewards-forwarder.spec.ts
+++ b/test/emissions/basic-rewards-forwarder.spec.ts
@@ -1,13 +1,14 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { Wallet } from "@ethersproject/wallet"
+import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { BasicRewardsForwarder__factory, MockNexus__factory } from "types/generated"
-import { MockNexus__factory, MockNexus, BasicRewardsForwarder, BasicRewardsForwarder__factory, MockERC20 } from "types/generated"
-import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { Wallet } from "@ethersproject/wallet"
-import { Account } from "types/common"
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types/common"
+import type { BasicRewardsForwarder, MockERC20, MockNexus } from "types/generated"
describe("BasicRewardsForwarder", () => {
let sa: StandardAccounts
diff --git a/test/emissions/disperse-forwarder.spec.ts b/test/emissions/disperse-forwarder.spec.ts
index fd01335a..37457070 100644
--- a/test/emissions/disperse-forwarder.spec.ts
+++ b/test/emissions/disperse-forwarder.spec.ts
@@ -1,18 +1,13 @@
import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Account } from "types/common"
-import {
- MockERC20,
- MockNexus,
- MockNexus__factory,
- MockDisperse,
- MockDisperse__factory,
- DisperseForwarder,
- DisperseForwarder__factory,
-} from "types/generated"
+import { DisperseForwarder__factory, MockDisperse__factory, MockNexus__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types/common"
+import type { DisperseForwarder, MockDisperse, MockERC20, MockNexus } from "types/generated"
describe("DisperseForwarder", () => {
let sa: StandardAccounts
diff --git a/test/emissions/emission-controller-polygon.spec.ts b/test/emissions/emission-controller-polygon.spec.ts
index ebc3432a..cdc607de 100644
--- a/test/emissions/emission-controller-polygon.spec.ts
+++ b/test/emissions/emission-controller-polygon.spec.ts
@@ -10,24 +10,27 @@ import { ethers } from "hardhat"
import { BN, increaseTime, simpleToExactAmount } from "index"
import {
AssetProxy__factory,
- L2EmissionsController,
- L2EmissionsController__factory,
- EmissionsController,
+ BridgeForwarder__factory,
EmissionsController__factory,
- IRootChainManager,
- MockERC20,
+ L2BridgeRecipient__factory,
+ L2EmissionsController__factory,
MockERC20__factory,
- MockNexus,
MockNexus__factory,
- MockRewardsDistributionRecipient,
MockRewardsDistributionRecipient__factory,
MockRootChainManager__factory,
- MockStakingContract,
MockStakingContract__factory,
- L2BridgeRecipient,
+} from "types/generated"
+
+import type {
BridgeForwarder,
- BridgeForwarder__factory,
- L2BridgeRecipient__factory,
+ EmissionsController,
+ IRootChainManager,
+ L2BridgeRecipient,
+ L2EmissionsController,
+ MockERC20,
+ MockNexus,
+ MockRewardsDistributionRecipient,
+ MockStakingContract,
} from "types/generated"
const defaultConfig = {
diff --git a/test/emissions/emission-controller.spec.ts b/test/emissions/emission-controller.spec.ts
index b470b416..09e07fec 100644
--- a/test/emissions/emission-controller.spec.ts
+++ b/test/emissions/emission-controller.spec.ts
@@ -1,25 +1,22 @@
import { Wallet } from "@ethersproject/wallet"
import { DEAD_ADDRESS, ONE_HOUR, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
import { StandardAccounts } from "@utils/machines"
+import { BN, simpleToExactAmount, sum } from "@utils/math"
+import { currentWeekEpoch, getTimestamp, increaseTime, increaseTimeTo, startWeek, weekEpoch } from "@utils/time"
import { expect } from "chai"
+import { keccak256, toUtf8Bytes } from "ethers/lib/utils"
import { ethers } from "hardhat"
-import { BN, simpleToExactAmount, sum } from "@utils/math"
import {
AssetProxy__factory,
- EmissionsController,
EmissionsController__factory,
- MockERC20,
MockERC20__factory,
- MockNexus,
MockNexus__factory,
- MockRewardsDistributionRecipient,
MockRewardsDistributionRecipient__factory,
- MockStakingContract,
MockStakingContract__factory,
} from "types/generated"
-import { currentWeekEpoch, increaseTime, getTimestamp, increaseTimeTo, startWeek, weekEpoch } from "@utils/time"
-import { Account } from "types/common"
-import { keccak256, toUtf8Bytes } from "ethers/lib/utils"
+
+import type { Account } from "types/common"
+import type { EmissionsController, MockERC20, MockNexus, MockRewardsDistributionRecipient, MockStakingContract } from "types/generated"
const defaultConfig = {
A: -166000000000000,
diff --git a/test/emissions/votium-bribe-forwarder.spec.ts b/test/emissions/votium-bribe-forwarder.spec.ts
index 7b247cc7..fcca9857 100644
--- a/test/emissions/votium-bribe-forwarder.spec.ts
+++ b/test/emissions/votium-bribe-forwarder.spec.ts
@@ -1,18 +1,13 @@
import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Account } from "types/common"
-import {
- MockERC20,
- MockNexus,
- MockNexus__factory,
- MockVotiumBribe,
- MockVotiumBribe__factory,
- VotiumBribeForwarder,
- VotiumBribeForwarder__factory,
-} from "types/generated"
+import { MockNexus__factory, MockVotiumBribe__factory, VotiumBribeForwarder__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types/common"
+import type { MockERC20, MockNexus, MockVotiumBribe, VotiumBribeForwarder } from "types/generated"
export const hashFn = (str: string): string => ethers.utils.keccak256(ethers.utils.toUtf8Bytes(str))
const PROPOSAL = hashFn("QmZpsJAvbKEY9YKFCZBUzzSMC5Y9vfy6QPA4HoXGsiLUyg")
diff --git a/test/feeders/admin.spec.ts b/test/feeders/admin.spec.ts
index c6d24061..dc97fc3a 100644
--- a/test/feeders/admin.spec.ts
+++ b/test/feeders/admin.spec.ts
@@ -1,30 +1,31 @@
import { assertBNClose } from "@utils/assertions"
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { FeederDetails, FeederMachine, MassetMachine, StandardAccounts, MassetDetails } from "@utils/machines"
-
import { DEAD_ADDRESS, MAX_UINT256, ONE_DAY, ONE_HOUR, ONE_MIN, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
+import { impersonate } from "@utils/fork"
+import { FeederMachine, MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { BassetStatus } from "@utils/mstable-objects"
+import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- DudIntegration,
DudIntegration__factory,
- DudPlatform,
DudPlatform__factory,
IPlatformIntegration__factory,
+ MaliciousAaveIntegration__factory,
+ MockPlatformIntegration__factory,
+} from "types/generated"
+
+import type { FeederDetails, StandardAccounts } from "@utils/machines"
+import type {
+ DudIntegration,
+ DudPlatform,
FeederPool,
MaliciousAaveIntegration,
- MaliciousAaveIntegration__factory,
MockERC20,
- MockPlatformIntegration,
- MockPlatformIntegration__factory,
MockNexus,
+ MockPlatformIntegration,
} from "types/generated"
-import { BassetStatus } from "@utils/mstable-objects"
-import { getTimestamp, increaseTime } from "@utils/time"
-import { impersonate } from "@utils/fork"
-
describe("Feeder Admin", () => {
let sa: StandardAccounts
let mAssetMachine: MassetMachine
diff --git a/test/feeders/basic-fns.spec.ts b/test/feeders/basic-fns.spec.ts
index b3e029bb..810fdf6b 100644
--- a/test/feeders/basic-fns.spec.ts
+++ b/test/feeders/basic-fns.spec.ts
@@ -1,9 +1,11 @@
-import { ethers } from "hardhat"
+import { assertBNClosePercent } from "@utils/assertions"
+import { FeederMachine, MassetMachine } from "@utils/machines"
+import { simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
+import { ethers } from "hardhat"
-import { assertBNClosePercent } from "@utils/assertions"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts, FeederMachine, FeederDetails } from "@utils/machines"
+import type { FeederDetails, StandardAccounts } from "@utils/machines"
+import type { BN } from "@utils/math"
describe("Feeder Pools", () => {
let sa: StandardAccounts
diff --git a/test/feeders/from-data/cross.spec.ts b/test/feeders/from-data/cross.spec.ts
index 4791161a..1915fa3f 100644
--- a/test/feeders/from-data/cross.spec.ts
+++ b/test/feeders/from-data/cross.spec.ts
@@ -1,20 +1,14 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import {
- ExposedFeederPool,
- ExposedFeederPool__factory,
- ExposedMasset,
- FeederLogic__factory,
- MockERC20,
- FeederManager__factory,
- Masset,
-} from "types/generated"
import { assertBNClose } from "@utils/assertions"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { crossData } from "@utils/validator-data"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { FeederLogic__factory, FeederManager__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ExposedFeederPool, ExposedFeederPool__factory, ExposedMasset, Masset, MockERC20 } from "types/generated"
const { integrationData } = crossData
diff --git a/test/feeders/from-data/integration.spec.ts b/test/feeders/from-data/integration.spec.ts
index 3172bc8b..d7bac377 100644
--- a/test/feeders/from-data/integration.spec.ts
+++ b/test/feeders/from-data/integration.spec.ts
@@ -1,12 +1,14 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { ExposedFeederPool, ExposedFeederPool__factory, FeederLogic__factory, MockERC20, FeederManager__factory } from "types/generated"
import { assertBNClose } from "@utils/assertions"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { feederData } from "@utils/validator-data"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { FeederLogic__factory, FeederManager__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ExposedFeederPool, ExposedFeederPool__factory, MockERC20 } from "types/generated"
const config = {
a: BN.from(300),
diff --git a/test/feeders/from-data/single.spec.ts b/test/feeders/from-data/single.spec.ts
index 0849640c..86fb7c12 100644
--- a/test/feeders/from-data/single.spec.ts
+++ b/test/feeders/from-data/single.spec.ts
@@ -1,20 +1,14 @@
import { assertBNClose } from "@utils/assertions"
import { DEAD_ADDRESS, fullScale, MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MassetMachine } from "@utils/machines"
import { BN, simpleToExactAmount } from "@utils/math"
import { feederData } from "@utils/validator-data"
-
import { expect } from "chai"
import { ethers } from "hardhat"
-import {
- ExposedFeederLogic,
- ExposedFeederLogic__factory,
- FeederLogic__factory,
- FeederPool,
- MockERC20,
- FeederManager__factory,
- FeederPool__factory,
-} from "types/generated"
+import { ExposedFeederLogic__factory, FeederLogic__factory, FeederManager__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ExposedFeederLogic, FeederPool, FeederPool__factory, MockERC20 } from "types/generated"
const { mintData, mintMultiData, redeemData, redeemExactData, redeemProportionalData, swapData } = feederData
diff --git a/test/feeders/mint.spec.ts b/test/feeders/mint.spec.ts
index 914f982d..f1e0bba6 100644
--- a/test/feeders/mint.spec.ts
+++ b/test/feeders/mint.spec.ts
@@ -1,13 +1,14 @@
+import { ZERO_ADDRESS } from "@utils/constants"
+import { FeederMachine, MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { BassetStatus } from "@utils/mstable-objects"
import { expect } from "chai"
-import { Signer } from "ethers"
import { ethers } from "hardhat"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { FeederDetails, FeederMachine, MassetMachine, StandardAccounts } from "@utils/machines"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { FeederPool, MockERC20 } from "types/generated"
-import { BassetStatus } from "@utils/mstable-objects"
-import { Account } from "types"
+import type { FeederDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { FeederPool, MockERC20 } from "types/generated"
interface MintOutput {
outputQuantity: BN
@@ -30,8 +31,14 @@ describe("Feeder - Mint", () => {
use2dp = false,
useRedemptionPrice = false,
): Promise => {
- details = await feederMachine.deployFeeder(feederWeights, mAssetWeights, useLendingMarkets,
- useInterestValidator, use2dp, useRedemptionPrice)
+ details = await feederMachine.deployFeeder(
+ feederWeights,
+ mAssetWeights,
+ useLendingMarkets,
+ useInterestValidator,
+ use2dp,
+ useRedemptionPrice,
+ )
}
before("Init contract", async () => {
diff --git a/test/feeders/redeem.spec.ts b/test/feeders/redeem.spec.ts
index b29c7858..d6ebbece 100644
--- a/test/feeders/redeem.spec.ts
+++ b/test/feeders/redeem.spec.ts
@@ -1,13 +1,14 @@
+import { ZERO_ADDRESS } from "@utils/constants"
+import { FeederMachine, MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { BassetStatus } from "@utils/mstable-objects"
import { expect } from "chai"
-import { Signer } from "ethers"
import { ethers } from "hardhat"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { FeederDetails, FeederMachine, MassetMachine, StandardAccounts } from "@utils/machines"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { FeederPool, MockERC20 } from "types/generated"
-import { BassetStatus } from "@utils/mstable-objects"
-import { Account } from "types"
+import type { FeederDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { FeederPool, MockERC20 } from "types/generated"
interface RedeemOutput {
outputQuantity: BN
@@ -30,8 +31,14 @@ describe("Feeder - Redeem", () => {
use2dp = false,
useRedemptionPrice = false,
): Promise => {
- details = await feederMachine.deployFeeder(feederWeights, mAssetWeights, useLendingMarkets,
- useInterestValidator, use2dp, useRedemptionPrice)
+ details = await feederMachine.deployFeeder(
+ feederWeights,
+ mAssetWeights,
+ useLendingMarkets,
+ useInterestValidator,
+ use2dp,
+ useRedemptionPrice,
+ )
}
before("Init contract", async () => {
@@ -510,39 +517,37 @@ describe("Feeder - Redeem", () => {
})
context("scale fAsset by setting redemption price to 2", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
- const {redemptionPriceSnap} = details
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
+ const { redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("2000000000000000000000000000")
})
it("redeem 1 pool token for scaled mAsset quantity", async () => {
- const {mAsset} = details
+ const { mAsset } = details
// TVL is 50% higher so 1 pool token should give about 1.5 mAssets.
await assertBasicRedeem(details, mAsset, simpleToExactAmount(1), "1493800546589159674")
})
it("redeem 1 pool token for scaled fAsset quantity", async () => {
- const {fAsset} = details
+ const { fAsset } = details
// TVL is 50% higher and value of fAssets has doubled so should give about 1.5 / 2 per pool token.
await assertBasicRedeem(details, fAsset, simpleToExactAmount(1), "751092003565206370")
})
it("should redeem a single main pool asset independent of redemption price", async () => {
- const {mAssetDetails} = details
+ const { mAssetDetails } = details
await assertBasicRedeem(details, mAssetDetails.bAssets[0], simpleToExactAmount(1))
})
})
context("enable using redemption price", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
})
it("Set RP so mAsset should fail redeem", async () => {
- const {mAsset, pool, redemptionPriceSnap} = details
+ const { mAsset, pool, redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("4500000000000000000000000000")
// Due to the RP fAsset is now overweight and redeeming mAsset should fail
await assertFailedRedeem("Exceeds weight limits", pool, mAsset, simpleToExactAmount(1))
})
it("Set RP so fAsset should fail redeem", async () => {
- const {fAsset, pool, redemptionPriceSnap} = details
+ const { fAsset, pool, redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("240000000000000000000000000")
// Due to the RP fAsset is now overweight and redeeming mAsset should fail
await assertFailedRedeem("Exceeds weight limits", pool, fAsset, simpleToExactAmount(1))
@@ -794,9 +799,8 @@ describe("Feeder - Redeem", () => {
})
context("reset and set redemption to 2 before each", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
- const {redemptionPriceSnap} = details
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
+ const { redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("2000000000000000000000000000")
})
it("should redeem exact two thirds mStable asset", async () => {
@@ -945,8 +949,7 @@ describe("Feeder - Redeem", () => {
})
context("using redemption getter", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
})
it("redeem proportionately. RP doubling should have no effect", async () => {
const { redemptionPriceSnap } = details
diff --git a/test/feeders/swap.spec.ts b/test/feeders/swap.spec.ts
index 9f486e29..de1ae9d8 100644
--- a/test/feeders/swap.spec.ts
+++ b/test/feeders/swap.spec.ts
@@ -1,13 +1,14 @@
-import { Signer } from "ethers"
-import { ethers } from "hardhat"
+import { assertBNClosePercent } from "@utils/assertions"
+import { ZERO_ADDRESS } from "@utils/constants"
+import { FeederMachine, MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
+import { ethers } from "hardhat"
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MassetMachine, StandardAccounts, FeederMachine, FeederDetails } from "@utils/machines"
-import { FeederPool, MockERC20 } from "types/generated"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { assertBNClosePercent } from "@utils/assertions"
-import { Account } from "types"
+import type { FeederDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { FeederPool, MockERC20 } from "types/generated"
describe("Feeder - Swap", () => {
let sa: StandardAccounts
@@ -22,8 +23,14 @@ describe("Feeder - Swap", () => {
use2dp = false,
useRedemptionPrice = false,
): Promise => {
- details = await feederMachine.deployFeeder(feederWeights, mAssetWeights, useLendingMarkets,
- useInterestValidator, use2dp, useRedemptionPrice)
+ details = await feederMachine.deployFeeder(
+ feederWeights,
+ mAssetWeights,
+ useLendingMarkets,
+ useInterestValidator,
+ use2dp,
+ useRedemptionPrice,
+ )
}
before("Init contract", async () => {
@@ -234,8 +241,7 @@ describe("Feeder - Swap", () => {
})
context("and different RPs", () => {
before(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
})
it("swap with RP of 0.75", async () => {
const { bAssets, redemptionPriceSnap } = details
@@ -302,8 +308,7 @@ describe("Feeder - Swap", () => {
})
context("swapping different assets using redemption price of 2", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
const { redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("2000000000000000000000000000")
})
@@ -349,8 +354,7 @@ describe("Feeder - Swap", () => {
})
context("swapping different assets using redemption price of 0.5", () => {
beforeEach(async () => {
- await runSetup(undefined, undefined, undefined,
- undefined, undefined, true)
+ await runSetup(undefined, undefined, undefined, undefined, undefined, true)
const { redemptionPriceSnap } = details
await redemptionPriceSnap.setRedemptionPriceSnap("500000000000000000000000000")
})
diff --git a/test/governance/ClaimableGovernor.behaviour.ts b/test/governance/ClaimableGovernor.behaviour.ts
index 8c234d70..41d0cf93 100644
--- a/test/governance/ClaimableGovernor.behaviour.ts
+++ b/test/governance/ClaimableGovernor.behaviour.ts
@@ -1,7 +1,8 @@
-import { expect } from "chai"
-import { ClaimableGovernor } from "types/generated/ClaimableGovernor"
import { ZERO_ADDRESS } from "@utils/constants"
-import { Account } from "types"
+import { expect } from "chai"
+
+import type { Account } from "types"
+import type { ClaimableGovernor } from "types/generated/ClaimableGovernor"
export interface IClaimableGovernableBehaviourContext {
claimable: ClaimableGovernor
diff --git a/test/governance/DelayedClaimableGovernor.behaviour.ts b/test/governance/DelayedClaimableGovernor.behaviour.ts
index ccf61435..d600e913 100644
--- a/test/governance/DelayedClaimableGovernor.behaviour.ts
+++ b/test/governance/DelayedClaimableGovernor.behaviour.ts
@@ -1,8 +1,9 @@
-import { expect } from "chai"
-import { Account } from "types"
import { BN } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
-import { DelayedClaimableGovernor } from "types/generated"
+import { expect } from "chai"
+
+import type { Account } from "types"
+import type { DelayedClaimableGovernor } from "types/generated"
export interface IGovernableBehaviourContext {
claimable: DelayedClaimableGovernor
diff --git a/test/governance/Governable.behaviour.ts b/test/governance/Governable.behaviour.ts
index 5b8efbaa..4b5441aa 100644
--- a/test/governance/Governable.behaviour.ts
+++ b/test/governance/Governable.behaviour.ts
@@ -1,7 +1,8 @@
-import { expect } from "chai"
-import { Governable } from "types/generated/Governable"
import { ZERO_ADDRESS } from "@utils/constants"
-import { Account } from "types"
+import { expect } from "chai"
+
+import type { Account } from "types"
+import type { Governable } from "types/generated/Governable"
export interface IGovernableBehaviourContext {
governable: Governable
diff --git a/test/governance/claimable-governor.spec.ts b/test/governance/claimable-governor.spec.ts
index 30843d5a..82edd502 100644
--- a/test/governance/claimable-governor.spec.ts
+++ b/test/governance/claimable-governor.spec.ts
@@ -1,9 +1,11 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
import { MassetMachine } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import { ClaimableGovernor__factory } from "types/generated"
-import { shouldBehaveLikeClaimable, IClaimableGovernableBehaviourContext } from "./ClaimableGovernor.behaviour"
+
+import { shouldBehaveLikeClaimable } from "./ClaimableGovernor.behaviour"
+
+import type { IClaimableGovernableBehaviourContext } from "./ClaimableGovernor.behaviour"
describe("ClaimableGovernable", () => {
const ctx: Partial = {}
diff --git a/test/governance/delayed-governor.spec.ts b/test/governance/delayed-governor.spec.ts
index 062ee264..3a8df7d3 100644
--- a/test/governance/delayed-governor.spec.ts
+++ b/test/governance/delayed-governor.spec.ts
@@ -1,9 +1,12 @@
+import { MassetMachine } from "@utils/machines"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { MassetMachine } from "@utils/machines"
import { DelayedClaimableGovernor__factory } from "types/generated"
-import { shouldBehaveLikeDelayedClaimable, IGovernableBehaviourContext } from "./DelayedClaimableGovernor.behaviour"
+
import { shouldBehaveLikeClaimable } from "./ClaimableGovernor.behaviour"
+import { shouldBehaveLikeDelayedClaimable } from "./DelayedClaimableGovernor.behaviour"
+
+import type { IGovernableBehaviourContext } from "./DelayedClaimableGovernor.behaviour"
describe("DelayedClaimableGovernor", () => {
const ctx: Partial = {}
diff --git a/test/governance/governable.spec.ts b/test/governance/governable.spec.ts
index 5107c940..19efa7f8 100644
--- a/test/governance/governable.spec.ts
+++ b/test/governance/governable.spec.ts
@@ -1,7 +1,10 @@
-import { ethers } from "hardhat"
import { MassetMachine } from "@utils/machines"
+import { ethers } from "hardhat"
import { MockGovernable__factory } from "types/generated"
-import { shouldBehaveLikeGovernable, IGovernableBehaviourContext } from "./Governable.behaviour"
+
+import { shouldBehaveLikeGovernable } from "./Governable.behaviour"
+
+import type { IGovernableBehaviourContext } from "./Governable.behaviour"
describe("Governable", () => {
const ctx: Partial = {}
diff --git a/test/governance/incentivised-voting-lockup-gov.spec.ts b/test/governance/incentivised-voting-lockup-gov.spec.ts
index 1f872eaf..ea716d1f 100644
--- a/test/governance/incentivised-voting-lockup-gov.spec.ts
+++ b/test/governance/incentivised-voting-lockup-gov.spec.ts
@@ -1,22 +1,18 @@
/* eslint-disable @typescript-eslint/dot-notation */
/* eslint-disable no-await-in-loop */
/* eslint-disable @typescript-eslint/naming-convention */
-import { network, ethers } from "hardhat"
-import { expect } from "chai"
import { assertBNClose, assertBNClosePercent } from "@utils/assertions"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { DEFAULT_DECIMALS, ONE_DAY, ONE_HOUR, ONE_WEEK, ONE_YEAR } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, maximum, simpleToExactAmount, sqrt } from "@utils/math"
import { advanceBlock, getTimestamp, increaseTime, increaseTimeTo, latestBlock } from "@utils/time"
-import { BN, simpleToExactAmount, maximum, sqrt } from "@utils/math"
-import { ONE_WEEK, ONE_HOUR, ONE_DAY, ONE_YEAR, DEFAULT_DECIMALS } from "@utils/constants"
-import {
- IncentivisedVotingLockup,
- IncentivisedVotingLockup__factory,
- MintableToken,
- MintableToken__factory,
- Nexus,
- Nexus__factory,
-} from "types/generated"
-import { Account } from "types"
+import { expect } from "chai"
+import { ethers, network } from "hardhat"
+import { IncentivisedVotingLockup__factory, MintableToken__factory, Nexus__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type { IncentivisedVotingLockup, MintableToken, Nexus } from "types/generated"
let sa: StandardAccounts
let mAssetMachine: MassetMachine
diff --git a/test/governance/incentivised-voting-lockup-rewards.spec.ts b/test/governance/incentivised-voting-lockup-rewards.spec.ts
index 7440aebf..f8c1e2ee 100644
--- a/test/governance/incentivised-voting-lockup-rewards.spec.ts
+++ b/test/governance/incentivised-voting-lockup-rewards.spec.ts
@@ -1,26 +1,26 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { ContractTransaction, Event, ContractReceipt } from "ethers"
-import { Account } from "types"
-import { getTimestamp, increaseTime, increaseTimeTo } from "@utils/time"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { assertBNClose, assertBNSlightlyGT, assertBNClosePercent } from "@utils/assertions"
+import { assertBNClose, assertBNClosePercent, assertBNSlightlyGT } from "@utils/assertions"
+import { DEFAULT_DECIMALS, FIVE_DAYS, fullScale, ONE_DAY, ONE_WEEK } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { BN, simpleToExactAmount, sqrt } from "@utils/math"
-import { ONE_WEEK, ONE_DAY, FIVE_DAYS, fullScale, DEFAULT_DECIMALS } from "@utils/constants"
-import {
+import { getTimestamp, increaseTime, increaseTimeTo } from "@utils/time"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { IncentivisedVotingLockup__factory, MockERC20__factory, Nexus__factory } from "types/generated"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ContractReceipt, ContractTransaction, Event } from "ethers"
+import type { Account } from "types"
+import type {
+ ImmutableModule,
IncentivisedVotingLockup,
- IncentivisedVotingLockup__factory,
InitializableRewardsDistributionRecipient,
- ImmutableModule,
- Nexus,
- Nexus__factory,
MockERC20,
- MockERC20__factory,
+ Nexus,
} from "types/generated"
-import {
- shouldBehaveLikeDistributionRecipient,
- IRewardsDistributionRecipientContext,
-} from "../shared/RewardsDistributionRecipient.behaviour"
+import { shouldBehaveLikeDistributionRecipient } from "../shared/RewardsDistributionRecipient.behaviour"
+
+import type { IRewardsDistributionRecipientContext } from "../shared/RewardsDistributionRecipient.behaviour"
const EVENTS = { DEPOSIT: "Deposit", WITHDRAW: "Withdraw", REWARD_PAID: "RewardPaid" }
diff --git a/test/governance/staking/boost-director-v2.spec.ts b/test/governance/staking/boost-director-v2.spec.ts
index 728bf8a2..8649b8d9 100644
--- a/test/governance/staking/boost-director-v2.spec.ts
+++ b/test/governance/staking/boost-director-v2.spec.ts
@@ -1,22 +1,16 @@
/* eslint-disable no-underscore-dangle */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { BN } from "@utils/math"
-import { StandardAccounts, MassetMachine } from "@utils/machines"
import { DEAD_ADDRESS } from "@utils/constants"
-import {
- MockStakingContract,
- MockStakingContract__factory,
- MockNexus,
- MockNexus__factory,
- MockBoostedVault,
- MockBoostedVault__factory,
- BoostDirectorV2__factory,
- BoostDirectorV2,
-} from "types/generated"
-import { Account } from "types"
-import { Contract } from "@ethersproject/contracts"
+import { MassetMachine } from "@utils/machines"
+import { BN } from "@utils/math"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { BoostDirectorV2__factory, MockBoostedVault__factory, MockNexus__factory, MockStakingContract__factory } from "types/generated"
+
+import type { Contract } from "@ethersproject/contracts"
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type { BoostDirectorV2, MockBoostedVault, MockNexus, MockStakingContract } from "types/generated"
const vaultNumbers = [...Array(7).keys()]
diff --git a/test/governance/staking/staked-token-batcher.spec.ts b/test/governance/staking/staked-token-batcher.spec.ts
index 93ba1cf7..99cfd85c 100644
--- a/test/governance/staking/staked-token-batcher.spec.ts
+++ b/test/governance/staking/staked-token-batcher.spec.ts
@@ -1,26 +1,24 @@
+import { ONE_WEEK } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { simpleToExactAmount } from "@utils/math"
+import { increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { formatBytes32String } from "ethers/lib/utils"
import { ethers } from "hardhat"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+import { DEAD_ADDRESS } from "index"
import {
AssetProxy__factory,
- QuestManager__factory,
- MockERC20,
MockERC20__factory,
- MockNexus,
PlatformTokenVendorFactory__factory,
+ QuestManager__factory,
SignatureVerifier__factory,
- StakedToken,
StakedToken__factory,
- StakedTokenBatcher,
StakedTokenBatcher__factory,
-
} from "types"
-import { DEAD_ADDRESS } from "index"
-import { ONE_WEEK } from "@utils/constants"
-import { simpleToExactAmount } from "@utils/math"
-import { expect } from "chai"
-import { increaseTime } from "@utils/time"
-import { formatBytes32String } from "ethers/lib/utils"
+import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { MockERC20, MockNexus, StakedToken, StakedTokenBatcher } from "types"
describe("Staked Token Batcher", () => {
let sa: StandardAccounts
@@ -34,7 +32,13 @@ describe("Staked Token Batcher", () => {
async function deployStakedToken(): Promise {
nexus = await new MockNexus__factory(sa.default.signer).deploy(sa.governor.address, DEAD_ADDRESS, DEAD_ADDRESS)
await nexus.setRecollateraliser(sa.mockRecollateraliser.address)
- rewardToken = await new MockERC20__factory(sa.default.signer).deploy("Reward", "RWD", 18, sa.default.address, simpleToExactAmount(1000000))
+ rewardToken = await new MockERC20__factory(sa.default.signer).deploy(
+ "Reward",
+ "RWD",
+ 18,
+ sa.default.address,
+ simpleToExactAmount(1000000),
+ )
const signatureVerifier = await new SignatureVerifier__factory(sa.default.signer).deploy()
const questManagerLibraryAddresses = {
@@ -55,7 +59,7 @@ describe("Staked Token Batcher", () => {
questManagerProxy.address,
rewardToken.address,
ONE_WEEK,
- false
+ false,
)
data = stakedTokenImpl.interface.encodeFunctionData("__StakedToken_init", [
formatBytes32String("Staked Rewards"),
@@ -64,23 +68,22 @@ describe("Staked Token Batcher", () => {
])
const stakedTokenProxy = await new AssetProxy__factory(sa.default.signer).deploy(stakedTokenImpl.address, DEAD_ADDRESS, data)
return stakedTokenFactory.attach(stakedTokenProxy.address) as StakedToken
-
}
before("Create Contract", async () => {
const accounts = await ethers.getSigners()
const mAssetMachine = await new MassetMachine().initAccounts(accounts)
sa = mAssetMachine.sa
- stakedTokenBatcher = await new StakedTokenBatcher__factory(sa.default.signer ).deploy()
- stakedToken = await deployStakedToken();
- // Distribute reward token to multiple users
+ stakedTokenBatcher = await new StakedTokenBatcher__factory(sa.default.signer).deploy()
+ stakedToken = await deployStakedToken()
+ // Distribute reward token to multiple users
await rewardToken.connect(sa.default.signer).approve(sa.dummy1.address, stakedAmount)
await rewardToken.connect(sa.default.signer).transfer(sa.dummy1.address, stakedAmount)
await rewardToken.connect(sa.default.signer).approve(sa.dummy2.address, stakedAmount)
await rewardToken.connect(sa.default.signer).transfer(sa.dummy2.address, stakedAmount)
-
+
await rewardToken.connect(sa.default.signer).approve(sa.dummy3.address, stakedAmount)
- await rewardToken.connect(sa.default.signer).transfer(sa.dummy3.address, stakedAmount)
+ await rewardToken.connect(sa.default.signer).transfer(sa.dummy3.address, stakedAmount)
})
describe("reviewTimestamp", async () => {
@@ -94,49 +97,48 @@ describe("Staked Token Batcher", () => {
await stakedToken.connect(sa.dummy1.signer)["stake(uint256,address)"](stakedAmount, delegateAddress)
await rewardToken.connect(sa.dummy2.signer).approve(stakedToken.address, stakedAmount)
- await stakedToken.connect(sa.dummy2.signer)["stake(uint256,address)"](stakedAmount, delegateAddress)
+ await stakedToken.connect(sa.dummy2.signer)["stake(uint256,address)"](stakedAmount, delegateAddress)
})
- it("fails if the input is wrong",async () => {
- await expect( stakedTokenBatcher.reviewTimestamp(stakedToken.address, [])).to.revertedWith("Invalid inputs")
- })
+ it("fails if the input is wrong", async () => {
+ await expect(stakedTokenBatcher.reviewTimestamp(stakedToken.address, [])).to.revertedWith("Invalid inputs")
+ })
it("fails if one of the accounts reverts", async () => {
- await expect( stakedTokenBatcher.reviewTimestamp(stakedToken.address, [sa.default.address])).to.revertedWith("Nothing worth poking here")
- })
+ await expect(stakedTokenBatcher.reviewTimestamp(stakedToken.address, [sa.default.address])).to.revertedWith(
+ "Nothing worth poking here",
+ )
+ })
it("updates the time multiplier for one account", async () => {
- // 3 months = 1.2x
+ // 3 months = 1.2x
await increaseTime(ONE_WEEK.mul(13))
- const accounts = [sa.default.address];
- const balanceDataBefore = await stakedToken.balanceData(sa.default.address)
- await stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)
- const balanceDataAfter = await stakedToken.balanceData(sa.default.address)
+ const accounts = [sa.default.address]
+ const balanceDataBefore = await stakedToken.balanceData(sa.default.address)
+ await stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)
+ const balanceDataAfter = await stakedToken.balanceData(sa.default.address)
expect(balanceDataAfter.timeMultiplier).to.not.be.equal(balanceDataBefore.timeMultiplier)
expect(balanceDataAfter.timeMultiplier).to.be.equal(20)
- })
+ })
it("updates the time multiplier for multiple accounts", async () => {
// 6 months = 1.3x
await increaseTime(ONE_WEEK.mul(13))
- const accounts = [sa.default.address, sa.dummy1.address,sa.dummy2.address];
- const balanceDataBefore = await Promise.all(accounts.map(async (account) => stakedToken.balanceData(account)))
- await stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)
- const balanceDataAfter = await Promise.all(accounts.map(async (account) => stakedToken.balanceData(account)))
+ const accounts = [sa.default.address, sa.dummy1.address, sa.dummy2.address]
+ const balanceDataBefore = await Promise.all(accounts.map(async (account) => stakedToken.balanceData(account)))
+ await stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)
+ const balanceDataAfter = await Promise.all(accounts.map(async (account) => stakedToken.balanceData(account)))
balanceDataBefore.forEach((dataBefore, i) => {
- expect(dataBefore.timeMultiplier).to.not.be.equal(balanceDataAfter[i].timeMultiplier)
- });
-
- })
+ expect(dataBefore.timeMultiplier).to.not.be.equal(balanceDataAfter[i].timeMultiplier)
+ })
+ })
it("fails if one of the accounts reverts when multiple", async () => {
- const accounts = [sa.default.address, sa.dummy1.address, sa.dummy2.address, sa.dummy3.address];
+ const accounts = [sa.default.address, sa.dummy1.address, sa.dummy2.address, sa.dummy3.address]
await increaseTime(ONE_WEEK.mul(26))
await rewardToken.connect(sa.dummy3.signer).approve(stakedToken.address, stakedAmount)
- await stakedToken.connect(sa.dummy3.signer)["stake(uint256,address)"](stakedAmount, sa.dummy3.address)
- await expect( stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)).to.revertedWith("Nothing worth poking here")
- })
- })
-
-
-})
\ No newline at end of file
+ await stakedToken.connect(sa.dummy3.signer)["stake(uint256,address)"](stakedAmount, sa.dummy3.address)
+ await expect(stakedTokenBatcher.reviewTimestamp(stakedToken.address, accounts)).to.revertedWith("Nothing worth poking here")
+ })
+ })
+})
diff --git a/test/governance/staking/staked-token-bpt.spec.ts b/test/governance/staking/staked-token-bpt.spec.ts
index 5fe7ecee..ea53fd6a 100644
--- a/test/governance/staking/staked-token-bpt.spec.ts
+++ b/test/governance/staking/staked-token-bpt.spec.ts
@@ -1,38 +1,34 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-await-in-loop */
/* eslint-disable @typescript-eslint/no-unused-expressions */
+import { assertBNClose } from "@utils/assertions"
+import { ONE_WEEK } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { simpleToExactAmount } from "@utils/math"
+import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { formatBytes32String } from "ethers/lib/utils"
import { ethers } from "hardhat"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+import { DEAD_ADDRESS } from "index"
import {
AssetProxy__factory,
- QuestManager__factory,
- MockERC20,
- MockERC20__factory,
- MockNexus,
- PlatformTokenVendorFactory__factory,
- SignatureVerifier__factory,
- MockStakedTokenWithPrice,
- MockStakedTokenWithPrice__factory,
- QuestManager,
- MockEmissionController__factory,
- MockBPT,
MockBPT__factory,
MockBPTGauge__factory,
- MockBPTGauge,
- MockBVault,
MockBVault__factory,
+ MockEmissionController__factory,
+ MockERC20__factory,
+ MockStakedTokenWithPrice__factory,
+ PlatformTokenVendorFactory__factory,
+ QuestManager__factory,
+ SignatureVerifier__factory,
StakedTokenBPT__factory,
- StakedTokenBPT,
} from "types"
-import { DEAD_ADDRESS } from "index"
-import { ONE_WEEK } from "@utils/constants"
-import { assertBNClose } from "@utils/assertions"
-import { simpleToExactAmount, BN } from "@utils/math"
-import { expect } from "chai"
-import { getTimestamp, increaseTime } from "@utils/time"
-import { formatBytes32String } from "ethers/lib/utils"
-import { BalConfig, UserStakingData } from "types/stakedToken"
+import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { BN } from "@utils/math"
+import type { MockBPT, MockBPTGauge, MockBVault, MockERC20, MockNexus, MockStakedTokenWithPrice, QuestManager, StakedTokenBPT } from "types"
+import type { BalConfig, UserStakingData } from "types/stakedToken"
interface Deployment {
stakedToken: StakedTokenBPT
diff --git a/test/governance/staking/staked-token-mta.spec.ts b/test/governance/staking/staked-token-mta.spec.ts
index 76fd9e2f..6611d265 100644
--- a/test/governance/staking/staked-token-mta.spec.ts
+++ b/test/governance/staking/staked-token-mta.spec.ts
@@ -1,28 +1,28 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-await-in-loop */
/* eslint-disable @typescript-eslint/no-unused-expressions */
+import { assertBNClose, assertBNClosePercent } from "@utils/assertions"
+import { ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { simpleToExactAmount } from "@utils/math"
+import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { formatBytes32String } from "ethers/lib/utils"
import { ethers } from "hardhat"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+import { DEAD_ADDRESS } from "index"
import {
AssetProxy__factory,
- MockERC20,
MockERC20__factory,
- MockNexus,
PlatformTokenVendorFactory__factory,
QuestManager__factory,
SignatureVerifier__factory,
- StakedTokenMTA,
StakedTokenMTA__factory,
- UserStakingData,
} from "types"
-import { DEAD_ADDRESS } from "index"
-import { ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { expect } from "chai"
-import { getTimestamp, increaseTime } from "@utils/time"
-import { assertBNClose, assertBNClosePercent } from "@utils/assertions"
-import { formatBytes32String } from "ethers/lib/utils"
+import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { BN } from "@utils/math"
+import type { MockERC20, MockNexus, StakedTokenMTA, UserStakingData } from "types"
export interface SnapData {
periodFinish: number
diff --git a/test/governance/staking/staked-token.spec.ts b/test/governance/staking/staked-token.spec.ts
index 6289c36b..41fe3d91 100644
--- a/test/governance/staking/staked-token.spec.ts
+++ b/test/governance/staking/staked-token.spec.ts
@@ -1,33 +1,33 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-await-in-loop */
/* eslint-disable @typescript-eslint/no-unused-expressions */
+import { ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { advanceBlock, getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { formatBytes32String } from "ethers/lib/utils"
import { ethers } from "hardhat"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+import { assertBNClose, DEAD_ADDRESS } from "index"
+import { signQuestUsers, signUserQuests } from "tasks/utils/quest-utils"
import {
AssetProxy__factory,
- QuestManager__factory,
- MockERC20,
+ MockEmissionController__factory,
MockERC20__factory,
- MockNexus,
PlatformTokenVendorFactory__factory,
+ QuestManager__factory,
SignatureVerifier__factory,
- StakedToken,
- StakedTokenWrapper__factory,
StakedToken__factory,
- QuestManager,
- MockEmissionController__factory,
+ StakedTokenWrapper__factory,
} from "types"
-import { assertBNClose, DEAD_ADDRESS } from "index"
-import { ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { expect } from "chai"
-import { advanceBlock, getTimestamp, increaseTime } from "@utils/time"
-import { formatBytes32String } from "ethers/lib/utils"
-import { Signer } from "ethers"
-import { QuestStatus, QuestType, UserStakingData } from "types/stakedToken"
-import { Block } from "@ethersproject/abstract-provider"
-import { signQuestUsers, signUserQuests } from "tasks/utils/quest-utils"
+import { MockNexus__factory } from "types/generated/factories/MockNexus__factory"
+import { QuestStatus, QuestType } from "types/stakedToken"
+
+import type { Block } from "@ethersproject/abstract-provider"
+import type { StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { MockERC20, MockNexus, QuestManager, StakedToken } from "types"
+import type { UserStakingData } from "types/stakedToken"
/**
* Calculate the new weighted timestamp after a stake or withdraw
diff --git a/test/masset/admin.spec.ts b/test/masset/admin.spec.ts
index f6f3580d..92334496 100644
--- a/test/masset/admin.spec.ts
+++ b/test/masset/admin.spec.ts
@@ -1,24 +1,16 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
-
+import { assertBNClose, assertBNSlightlyGTPercent } from "@utils/assertions"
import { DEAD_ADDRESS, MAX_UINT256, ONE_DAY, ONE_HOUR, ONE_WEEK, TEN_MINS, ZERO_ADDRESS } from "@utils/constants"
-import {
- Masset,
- MockPlatformIntegration,
- MaliciousAaveIntegration,
- MaliciousAaveIntegration__factory,
- MockERC20,
- MockPlatformIntegration__factory,
- ExposedMasset,
- MockNexus__factory,
-} from "types/generated"
-import { assertBNSlightlyGTPercent, assertBNClose } from "@utils/assertions"
-import { keccak256, toUtf8Bytes } from "ethers/lib/utils"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { BassetStatus } from "@utils/mstable-objects"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { keccak256, toUtf8Bytes } from "ethers/lib/utils"
+import { ethers } from "hardhat"
+import { MaliciousAaveIntegration__factory, MockNexus__factory, MockPlatformIntegration__factory } from "types/generated"
+
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { ExposedMasset, MaliciousAaveIntegration, Masset, MockERC20, MockPlatformIntegration } from "types/generated"
describe("Masset Admin", () => {
let sa: StandardAccounts
diff --git a/test/masset/extra/erc20.spec.ts b/test/masset/extra/erc20.spec.ts
index a4a4f184..43d278e9 100644
--- a/test/masset/extra/erc20.spec.ts
+++ b/test/masset/extra/erc20.spec.ts
@@ -1,8 +1,12 @@
import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
import { ethers } from "hardhat"
-import { ERC20 } from "types/generated/ERC20"
-import { IERC20BehaviourContext, shouldBehaveLikeERC20 } from "../../shared/ERC20.behaviour"
+
+import type { ERC20 } from "types/generated/ERC20"
+import { shouldBehaveLikeERC20 } from "../../shared/ERC20.behaviour"
+
+
+import type { IERC20BehaviourContext } from "../../shared/ERC20.behaviour"
describe("Masset - ERC20", () => {
const ctx: Partial = {}
diff --git a/test/masset/extra/large-basket.spec.ts b/test/masset/extra/large-basket.spec.ts
index 17559e84..dc8109c3 100644
--- a/test/masset/extra/large-basket.spec.ts
+++ b/test/masset/extra/large-basket.spec.ts
@@ -1,13 +1,14 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
+import { assertBNClosePercent } from "@utils/assertions"
+import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { AssetProxy__factory } from "types/generated"
-import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
-import { BasketComposition } from "types"
-import { AssetProxy__factory, MassetLogic, MassetManager, ExposedMasset } from "types/generated"
-import { assertBNClosePercent } from "@utils/assertions"
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { BasketComposition } from "types"
+import type { ExposedMasset, MassetLogic, MassetManager } from "types/generated"
describe("Many asset Masset", () => {
let sa: StandardAccounts
diff --git a/test/masset/extra/mint-swap-redeem.spec.ts b/test/masset/extra/mint-swap-redeem.spec.ts
index 6bcd495a..9678954a 100644
--- a/test/masset/extra/mint-swap-redeem.spec.ts
+++ b/test/masset/extra/mint-swap-redeem.spec.ts
@@ -1,13 +1,14 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
import { assertBNClosePercent } from "@utils/assertions"
+import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { AssetProxy__factory } from "types/generated"
-import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
-import { AssetProxy__factory, ExposedMasset, MassetLogic, MassetManager } from "types/generated"
-import { BasketComposition } from "types"
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { BasketComposition } from "types"
+import type { ExposedMasset, MassetLogic, MassetManager } from "types/generated"
describe("Masset - basic fns", () => {
let sa: StandardAccounts
diff --git a/test/masset/from-data/integration.spec.ts b/test/masset/from-data/integration.spec.ts
index 66218589..bf19329f 100644
--- a/test/masset/from-data/integration.spec.ts
+++ b/test/masset/from-data/integration.spec.ts
@@ -1,15 +1,16 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable @typescript-eslint/no-loop-func */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { DEAD_ADDRESS, MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { MassetLogic, MassetManager, ExposedMasset } from "types/generated"
import { assertBNClose, assertBNSlightlyGT } from "@utils/assertions"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { DEAD_ADDRESS, MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { mAssetData } from "@utils/validator-data"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ExposedMasset, MassetLogic, MassetManager } from "types/generated"
const config = {
a: BN.from(120),
diff --git a/test/masset/from-data/single.spec.ts b/test/masset/from-data/single.spec.ts
index 10a2398f..d02aae4c 100644
--- a/test/masset/from-data/single.spec.ts
+++ b/test/masset/from-data/single.spec.ts
@@ -4,13 +4,14 @@
import { assertBNClose } from "@utils/assertions"
import { DEAD_ADDRESS, MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { MassetMachine } from "@utils/machines"
import { BN, simpleToExactAmount } from "@utils/math"
import { mAssetData } from "@utils/validator-data"
-
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Masset, Masset__factory, MockERC20, ExposedMassetLogic, MassetLogic, MassetManager } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ExposedMassetLogic, Masset, Masset__factory, MassetLogic, MassetManager, MockERC20 } from "types/generated"
const { mintData, mintMultiData, redeemData, redeemExactData, redeemMassetData, swapData } = mAssetData
diff --git a/test/masset/liquidator.spec.ts b/test/masset/liquidator.spec.ts
index 6d6ca3b7..56acab80 100644
--- a/test/masset/liquidator.spec.ts
+++ b/test/masset/liquidator.spec.ts
@@ -1,34 +1,41 @@
+import { assertBNClose } from "@utils/assertions"
+import { DEAD_ADDRESS, MAX_UINT256, ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { encodeUniswapPath } from "@utils/peripheral/uniswap"
+import { increaseTime } from "@utils/time"
import { expect } from "chai"
import { ethers } from "hardhat"
-
-import { BN, simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { DEAD_ADDRESS, MAX_UINT256, ONE_DAY, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
import {
AssetProxy__factory,
- MockERC20,
+ Liquidator__factory,
MockERC20__factory,
- MockMasset,
MockMasset__factory,
- MockNexus,
+ MockNexus__factory,
+ MockRewardToken__factory,
+ MockStakedAave__factory,
+ MockUniswapV3__factory,
SavingsContract__factory,
- Liquidator,
- SavingsManager,
- MockRewardToken,
- Liquidator__factory,
SavingsManager__factory,
- MockRewardToken__factory,
- MockNexus__factory,
+ Unwrapper__factory,
+} from "types/generated"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { EncodedPaths } from "@utils/peripheral/uniswap"
+import type {
ImmutableModule,
+ Liquidator,
+ MockERC20,
+ MockMasset,
+ MockNexus,
+ MockRewardToken,
MockUniswapV3,
- MockUniswapV3__factory,
- MockStakedAave__factory,
- Unwrapper__factory,
+ SavingsManager,
} from "types/generated"
-import { increaseTime } from "@utils/time"
-import { EncodedPaths, encodeUniswapPath } from "@utils/peripheral/uniswap"
-import { assertBNClose } from "@utils/assertions"
-import { shouldBehaveLikeModule, IModuleBehaviourContext } from "../shared/Module.behaviour"
+import { shouldBehaveLikeModule } from "../shared/Module.behaviour"
+
+import type { IModuleBehaviourContext } from "../shared/Module.behaviour"
describe("Liquidator", () => {
let sa: StandardAccounts
diff --git a/test/masset/mint.spec.ts b/test/masset/mint.spec.ts
index 810d4f6c..a05cb460 100644
--- a/test/masset/mint.spec.ts
+++ b/test/masset/mint.spec.ts
@@ -1,14 +1,15 @@
-import { expect } from "chai"
-import { Signer } from "ethers"
-import { ethers } from "hardhat"
-
import { assertBasketIsHealthy, assertBNClosePercent, assertBNSlightlyGTPercent } from "@utils/assertions"
+import { ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { applyRatio, BN, simpleToExactAmount } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
import { BassetStatus } from "@utils/mstable-objects"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { Masset, MockERC20 } from "types/generated"
-import { Account } from "types"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { Masset, MockERC20 } from "types/generated"
interface MintOutput {
mAssets: BN
diff --git a/test/masset/peripheral/aavev2.spec.ts b/test/masset/peripheral/aavev2.spec.ts
index 645a1103..8e6cf09d 100644
--- a/test/masset/peripheral/aavev2.spec.ts
+++ b/test/masset/peripheral/aavev2.spec.ts
@@ -1,25 +1,26 @@
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { assertBNSlightlyGT, assertBNSlightlyGTPercent, assertBNClose } from "@utils/assertions"
-import { simpleToExactAmount, BN } from "@utils/math"
+import { assertBNClose, assertBNSlightlyGT, assertBNSlightlyGTPercent } from "@utils/assertions"
+import { DEAD_ADDRESS, MAX_UINT256, TEN_MINS, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { increaseTime } from "@utils/time"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { MAX_UINT256, ZERO_ADDRESS, TEN_MINS, DEAD_ADDRESS } from "@utils/constants"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- MockNexus__factory,
- MockNexus,
- MockAaveV2__factory,
- AaveV2Integration,
AaveV2Integration__factory,
- MockERC20__factory,
- MockATokenV2__factory,
ILendingPoolAddressesProviderV2__factory,
- MockERC20,
- MockATokenV2,
+ MockAaveV2__factory,
+ MockATokenV2__factory,
+ MockERC20__factory,
+ MockNexus__factory,
} from "types/generated"
-import { BassetIntegrationDetails, Account } from "types"
-import { shouldBehaveLikeModule, IModuleBehaviourContext } from "../../shared/Module.behaviour"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account, BassetIntegrationDetails } from "types"
+import type { AaveV2Integration, MockATokenV2, MockERC20, MockNexus } from "types/generated"
+import { shouldBehaveLikeModule } from "../../shared/Module.behaviour"
+
+import type { IModuleBehaviourContext } from "../../shared/Module.behaviour"
describe("AaveIntegration", async () => {
let sa: StandardAccounts
diff --git a/test/masset/peripheral/compound.spec.ts b/test/masset/peripheral/compound.spec.ts
index 78912855..4b865cfc 100644
--- a/test/masset/peripheral/compound.spec.ts
+++ b/test/masset/peripheral/compound.spec.ts
@@ -1,16 +1,22 @@
/* eslint-disable consistent-return */
-import { StandardAccounts, MassetMachine } from "@utils/machines"
-import { ZERO_ADDRESS, DEAD_ADDRESS, fullScale, MAX_UINT256 } from "@utils/constants"
+import { assertBNClose, assertBNSlightlyGT, assertBNSlightlyGTPercent } from "@utils/assertions"
+import { DEAD_ADDRESS, fullScale, MAX_UINT256, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { BN, simpleToExactAmount } from "@utils/math"
-import { MockCToken, MockCToken__factory, MockERC20, MockERC20__factory, MockNexus, MockNexus__factory } from "types/generated"
-import { ethers } from "hardhat"
-import { CompoundIntegration } from "types/generated/CompoundIntegration"
import { expect } from "chai"
+import { ethers } from "hardhat"
+import { MockCToken__factory, MockERC20__factory, MockNexus__factory } from "types/generated"
import { CompoundIntegration__factory } from "types/generated/factories/CompoundIntegration__factory"
-import { BassetIntegrationDetails, Account } from "types"
-import { assertBNClose, assertBNSlightlyGT, assertBNSlightlyGTPercent } from "@utils/assertions"
-import { shouldBehaveLikeModule, IModuleBehaviourContext } from "../../shared/Module.behaviour"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account, BassetIntegrationDetails } from "types"
+import type { MockCToken, MockERC20, MockNexus } from "types/generated"
+import type { CompoundIntegration } from "types/generated/CompoundIntegration"
+import { shouldBehaveLikeModule } from "../../shared/Module.behaviour"
+
+import type { IModuleBehaviourContext } from "../../shared/Module.behaviour"
const convertUnderlyingToCToken = async (cToken: MockCToken, underlyingAmount: BN): Promise => {
const exchangeRate = await cToken.exchangeRateStored()
diff --git a/test/masset/recol.spec.ts b/test/masset/recol.spec.ts
index 666392d1..d8eae666 100644
--- a/test/masset/recol.spec.ts
+++ b/test/masset/recol.spec.ts
@@ -1,12 +1,14 @@
-import { expect } from "chai"
-import { ethers, network } from "hardhat"
-
import { assertBNSlightlyGTPercent } from "@utils/assertions"
-import { BN, simpleToExactAmount } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
import { ONE_DAY } from "@utils/constants"
-import { ExposedMassetLogic, MassetLogic__factory } from "types/generated"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { ethers, network } from "hardhat"
+import { MassetLogic__factory } from "types/generated"
+
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { ExposedMassetLogic } from "types/generated"
const one = simpleToExactAmount(1)
const swapFee = simpleToExactAmount(6, 14)
diff --git a/test/masset/redeem.spec.ts b/test/masset/redeem.spec.ts
index e1eed38e..e6d8a87f 100644
--- a/test/masset/redeem.spec.ts
+++ b/test/masset/redeem.spec.ts
@@ -1,14 +1,15 @@
+import { assertBasketIsHealthy, assertBNClosePercent, assertBNSlightlyGTPercent } from "@utils/assertions"
+import { fullScale, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { BassetStatus } from "@utils/mstable-objects"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Signer } from "ethers"
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
-import { MockERC20, Masset } from "types/generated"
-import { fullScale, ZERO_ADDRESS } from "@utils/constants"
-import { assertBasketIsHealthy, assertBNClosePercent, assertBNSlightlyGTPercent } from "@utils/assertions"
-import { BassetStatus } from "@utils/mstable-objects"
-import { Account } from "types"
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { Masset, MockERC20 } from "types/generated"
describe("Masset - Redeem", () => {
let sa: StandardAccounts
diff --git a/test/masset/swap.spec.ts b/test/masset/swap.spec.ts
index a2ad992c..f11a0eec 100644
--- a/test/masset/swap.spec.ts
+++ b/test/masset/swap.spec.ts
@@ -1,14 +1,15 @@
-import { Signer } from "ethers"
-import { ethers } from "hardhat"
-import { expect } from "chai"
-
-import { simpleToExactAmount, BN } from "@utils/math"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
-import { Masset, MockERC20 } from "types/generated"
+import { assertBasketIsHealthy, assertBNSlightlyGTPercent } from "@utils/assertions"
import { fullScale, ratioScale, ZERO_ADDRESS } from "@utils/constants"
-import { assertBNSlightlyGTPercent, assertBasketIsHealthy } from "@utils/assertions"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { BassetStatus } from "@utils/mstable-objects"
-import { Account } from "types"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+
+import type { MassetDetails, StandardAccounts } from "@utils/machines"
+import type { Signer } from "ethers"
+import type { Account } from "types"
+import type { Masset, MockERC20 } from "types/generated"
// (AS) - test cases to add:
// - whenHealthy flag
diff --git a/test/masset/validator-etc.spec.ts b/test/masset/validator-etc.spec.ts
index 9b3ed29e..36844b89 100644
--- a/test/masset/validator-etc.spec.ts
+++ b/test/masset/validator-etc.spec.ts
@@ -1,8 +1,8 @@
-import { ethers } from "hardhat"
+import { BN, simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
+import { ethers } from "hardhat"
-import { simpleToExactAmount, BN } from "@utils/math"
-import { ExposedMassetLogic } from "types/generated"
+import type { ExposedMassetLogic } from "types/generated"
const config = {
supply: BN.from(0),
diff --git a/test/nexus/nexus.spec.ts b/test/nexus/nexus.spec.ts
index a8139894..2eee7179 100644
--- a/test/nexus/nexus.spec.ts
+++ b/test/nexus/nexus.spec.ts
@@ -1,13 +1,19 @@
-import { expect } from "chai"
-import { keccak256, toUtf8Bytes, hexlify } from "ethers/lib/utils"
-import { ethers } from "hardhat"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
+import { KEY_SAVINGS_MANAGER, ONE_DAY, ONE_WEEK, ZERO, ZERO_ADDRESS, ZERO_KEY } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
import { BN } from "@utils/math"
-import { DelayedClaimableGovernor, Nexus, Nexus__factory } from "types/generated"
import { getTimestamp, increaseTime } from "@utils/time"
-import { ONE_WEEK, ZERO_ADDRESS, KEY_SAVINGS_MANAGER, ONE_DAY, ZERO, ZERO_KEY } from "@utils/constants"
-import { shouldBehaveLikeDelayedClaimable, IGovernableBehaviourContext } from "../governance/DelayedClaimableGovernor.behaviour"
+import { expect } from "chai"
+import { hexlify, keccak256, toUtf8Bytes } from "ethers/lib/utils"
+import { ethers } from "hardhat"
+import { Nexus__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
import { shouldBehaveLikeClaimable } from "../governance/ClaimableGovernor.behaviour"
+import { shouldBehaveLikeDelayedClaimable } from "../governance/DelayedClaimableGovernor.behaviour"
+
+import type { DelayedClaimableGovernor, Nexus } from "types/generated"
+
+import type { IGovernableBehaviourContext } from "../governance/DelayedClaimableGovernor.behaviour"
/** @dev Uses generic module getter to validate that a module exists with the specified properties */
async function expectInModules(nexus: Nexus, _key: string, _addr: string, _isLocked: boolean): Promise {
diff --git a/test/polygon/pliquidator.spec.ts b/test/polygon/pliquidator.spec.ts
index f378c487..266102d0 100644
--- a/test/polygon/pliquidator.spec.ts
+++ b/test/polygon/pliquidator.spec.ts
@@ -1,34 +1,40 @@
+import { ONE_HOUR, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
+import { increaseTime } from "@utils/time"
import { expect } from "chai"
import { ethers } from "hardhat"
-
-import { BN, simpleToExactAmount } from "@utils/math"
-import { MassetMachine, StandardAccounts } from "@utils/machines"
-import { ONE_HOUR, ONE_WEEK, ZERO_ADDRESS } from "@utils/constants"
import {
AssetProxy__factory,
- MockERC20,
+ MockAaveIncentivesController__factory,
MockERC20__factory,
- MockMasset,
MockMasset__factory,
- MockNexus,
- SavingsContract__factory,
- SavingsManager,
+ MockNexus__factory,
+ MockTrigger__factory,
MockUniswap__factory,
+ PAaveIntegration__factory,
+ PLiquidator__factory,
+ SavingsContract__factory,
SavingsManager__factory,
- MockUniswap,
- MockNexus__factory,
+ Unwrapper__factory,
+} from "types/generated"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type {
ImmutableModule,
- MockTrigger__factory,
MockAaveIncentivesController,
+ MockERC20,
+ MockMasset,
+ MockNexus,
+ MockUniswap,
PAaveIntegration,
- PAaveIntegration__factory,
- MockAaveIncentivesController__factory,
- PLiquidator__factory,
PLiquidator,
- Unwrapper__factory,
+ SavingsManager,
} from "types/generated"
-import { increaseTime } from "@utils/time"
-import { shouldBehaveLikeModule, IModuleBehaviourContext } from "../shared/Module.behaviour"
+import { shouldBehaveLikeModule } from "../shared/Module.behaviour"
+
+import type { IModuleBehaviourContext } from "../shared/Module.behaviour"
describe("Liquidator", () => {
let sa: StandardAccounts
diff --git a/test/rewards/boost-director.spec.ts b/test/rewards/boost-director.spec.ts
index cdd85479..8d61e07a 100644
--- a/test/rewards/boost-director.spec.ts
+++ b/test/rewards/boost-director.spec.ts
@@ -1,20 +1,14 @@
/* eslint-disable no-underscore-dangle */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { StandardAccounts, MassetMachine } from "@utils/machines"
import { DEAD_ADDRESS } from "@utils/constants"
-import {
- MockStakingContract,
- MockStakingContract__factory,
- MockNexus,
- MockNexus__factory,
- BoostDirectorV2__factory,
- BoostDirectorV2,
- MockBoostedVault,
- MockBoostedVault__factory,
-} from "types/generated"
-import { Account } from "types"
+import { MassetMachine } from "@utils/machines"
+import { expect } from "chai"
+import { ethers } from "hardhat"
+import { BoostDirectorV2__factory, MockBoostedVault__factory, MockNexus__factory, MockStakingContract__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type { BoostDirectorV2, MockBoostedVault, MockNexus, MockStakingContract } from "types/generated"
describe("BoostDirectorV2", async () => {
let sa: StandardAccounts
diff --git a/test/rewards/boosted-dual-vault.spec.ts b/test/rewards/boosted-dual-vault.spec.ts
index 37b9d347..d02caa13 100644
--- a/test/rewards/boosted-dual-vault.spec.ts
+++ b/test/rewards/boosted-dual-vault.spec.ts
@@ -1,35 +1,39 @@
/* eslint-disable no-underscore-dangle */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { utils } from "ethers"
-import { simpleToExactAmount, BN } from "@utils/math"
import { assertBNClose, assertBNClosePercent, assertBNSlightlyGT } from "@utils/assertions"
-import { StandardAccounts, MassetMachine } from "@utils/machines"
-import { fullScale, ZERO_ADDRESS, ZERO, ONE_DAY, FIVE_DAYS, ONE_WEEK, DEAD_ADDRESS } from "@utils/constants"
+import { DEAD_ADDRESS, FIVE_DAYS, fullScale, ONE_DAY, ONE_WEEK, ZERO, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { utils } from "ethers"
+import { ethers } from "hardhat"
import {
- MockERC20,
- MockERC20__factory,
- ImmutableModule,
- MockStakingContract,
- MockStakingContract__factory,
- InitializableRewardsDistributionRecipient,
- BoostedDualVault,
- BoostedDualVault__factory,
- MockNexus,
- MockNexus__factory,
AssetProxy__factory,
BoostDirector__factory,
+ BoostedDualVault__factory,
+ MockERC20__factory,
+ MockNexus__factory,
+ MockSavingsContract__factory,
+ MockStakingContract__factory,
+} from "types/generated"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type {
BoostDirector,
+ BoostedDualVault,
FeederPool,
- MockSavingsContract__factory,
+ ImmutableModule,
+ InitializableRewardsDistributionRecipient,
+ MockERC20,
+ MockNexus,
+ MockStakingContract,
} from "types/generated"
-import { Account } from "types"
-import {
- shouldBehaveLikeDistributionRecipient,
- IRewardsDistributionRecipientContext,
-} from "../shared/RewardsDistributionRecipient.behaviour"
+import { shouldBehaveLikeDistributionRecipient } from "../shared/RewardsDistributionRecipient.behaviour"
+
+import type { IRewardsDistributionRecipientContext } from "../shared/RewardsDistributionRecipient.behaviour"
interface StakingBalance {
raw: BN
diff --git a/test/rewards/boosted-vault.spec.ts b/test/rewards/boosted-vault.spec.ts
index b89ec689..8be91fb3 100644
--- a/test/rewards/boosted-vault.spec.ts
+++ b/test/rewards/boosted-vault.spec.ts
@@ -1,37 +1,41 @@
/* eslint-disable no-underscore-dangle, prefer-destructuring */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { utils } from "ethers"
-import { simpleToExactAmount, BN } from "@utils/math"
import { assertBNClose, assertBNClosePercent, assertBNSlightlyGT } from "@utils/assertions"
-import { StandardAccounts, MassetMachine } from "@utils/machines"
-import { fullScale, ZERO_ADDRESS, ZERO, ONE_DAY, FIVE_DAYS, ONE_WEEK, DEAD_ADDRESS } from "@utils/constants"
+import { DEAD_ADDRESS, FIVE_DAYS, fullScale, ONE_DAY, ONE_WEEK, ZERO, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { utils } from "ethers"
+import { ethers } from "hardhat"
import {
- MockERC20,
- MockERC20__factory,
- ImmutableModule,
- MockStakingContract,
- MockStakingContract__factory,
- InitializableRewardsDistributionRecipient,
- BoostedVault,
- BoostedVault__factory,
- MockNexus,
- MockNexus__factory,
AssetProxy__factory,
BoostDirector__factory,
- BoostDirector,
- MockBoostedVault,
+ BoostedVault__factory,
MockBoostedVault__factory,
- FeederPool,
+ MockERC20__factory,
+ MockNexus__factory,
MockSavingsContract__factory,
+ MockStakingContract__factory,
} from "types/generated"
-import { Account } from "types"
-import {
- shouldBehaveLikeDistributionRecipient,
- IRewardsDistributionRecipientContext,
-} from "../shared/RewardsDistributionRecipient.behaviour"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type {
+ BoostDirector,
+ BoostedVault,
+ FeederPool,
+ ImmutableModule,
+ InitializableRewardsDistributionRecipient,
+ MockBoostedVault,
+ MockERC20,
+ MockNexus,
+ MockStakingContract,
+} from "types/generated"
+import { shouldBehaveLikeDistributionRecipient } from "../shared/RewardsDistributionRecipient.behaviour"
+
+import type { IRewardsDistributionRecipientContext } from "../shared/RewardsDistributionRecipient.behaviour"
interface StakingBalance {
raw: BN
diff --git a/test/rewards/rewards-distributor.spec.ts b/test/rewards/rewards-distributor.spec.ts
index 02e5f069..84ebff0b 100644
--- a/test/rewards/rewards-distributor.spec.ts
+++ b/test/rewards/rewards-distributor.spec.ts
@@ -1,19 +1,16 @@
+import { ZERO_ADDRESS } from "@utils/constants"
import { StandardAccounts } from "@utils/machines"
import { simpleToExactAmount } from "@utils/math"
-
-import { ZERO_ADDRESS } from "@utils/constants"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- MockERC20,
MockERC20__factory,
- MockNexus,
MockNexus__factory,
- MockRewardsDistributionRecipient,
MockRewardsDistributionRecipient__factory,
- RewardsDistributor,
RewardsDistributor__factory,
} from "types/generated"
-import { ethers } from "hardhat"
-import { expect } from "chai"
+
+import type { MockERC20, MockNexus, MockRewardsDistributionRecipient, RewardsDistributor } from "types/generated"
describe("RewardsDistributor", async () => {
let sa: StandardAccounts
diff --git a/test/rewards/staking-rewards-with-platform-token.spec.ts b/test/rewards/staking-rewards-with-platform-token.spec.ts
index 8061237e..422ade62 100644
--- a/test/rewards/staking-rewards-with-platform-token.spec.ts
+++ b/test/rewards/staking-rewards-with-platform-token.spec.ts
@@ -6,21 +6,18 @@ import { BN, simpleToExactAmount } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Account } from "types"
import {
AssetProxy__factory,
- ExposedMasset,
- FeederPool,
- MockERC20,
MockERC20__factory,
- MockNexus,
MockNexus__factory,
MockSavingsContract__factory,
PlatformTokenVendor__factory,
- StakingRewardsWithPlatformToken,
StakingRewardsWithPlatformToken__factory,
} from "types/generated"
+import type { Account } from "types"
+import type { ExposedMasset, FeederPool, MockERC20, MockNexus, StakingRewardsWithPlatformToken } from "types/generated"
+
interface StakingData {
totalSupply: BN
userStakingBalance: BN
diff --git a/test/rewards/staking-rewards.spec.ts b/test/rewards/staking-rewards.spec.ts
index 03c2a3a0..c9084d31 100644
--- a/test/rewards/staking-rewards.spec.ts
+++ b/test/rewards/staking-rewards.spec.ts
@@ -1,22 +1,20 @@
+import { assertBNClose, assertBNSlightlyGT } from "@utils/assertions"
+import { FIVE_DAYS, fullScale, ONE_DAY, ONE_WEEK, ZERO, ZERO_ADDRESS } from "@utils/constants"
import { StandardAccounts } from "@utils/machines"
import { BN, simpleToExactAmount } from "@utils/math"
-import { FIVE_DAYS, fullScale, ONE_DAY, ONE_WEEK, ZERO, ZERO_ADDRESS } from "@utils/constants"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
AssetProxy__factory,
- MockERC20,
MockERC20__factory,
- MockNexus,
MockNexus__factory,
- StakingRewards,
- StakingRewards__factory,
- FeederPool,
MockSavingsContract__factory,
+ StakingRewards__factory,
} from "types/generated"
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { assertBNClose, assertBNSlightlyGT } from "@utils/assertions"
-import { Account } from "types"
+
+import type { Account } from "types"
+import type { FeederPool, MockERC20, MockNexus, StakingRewards } from "types/generated"
interface StakingData {
totalSupply: BN
diff --git a/test/savings/savings-contract.spec.ts b/test/savings/savings-contract.spec.ts
index 9a85b0d3..e8fc068e 100644
--- a/test/savings/savings-contract.spec.ts
+++ b/test/savings/savings-contract.spec.ts
@@ -1,39 +1,47 @@
import { assertBNClose, assertBNClosePercent } from "@utils/assertions"
import { DEAD_ADDRESS, fullScale, MAX_UINT256, ONE_DAY, ONE_HOUR, ZERO, ZERO_ADDRESS } from "@utils/constants"
-import { MassetDetails, MassetMachine, StandardAccounts, FeederMachine, FeederDetails } from "@utils/machines"
+import { FeederMachine, MassetMachine } from "@utils/machines"
import { BN, simpleToExactAmount } from "@utils/math"
+import { getTimestamp } from "@utils/time"
import { expect } from "chai"
import { ethers } from "hardhat"
-import { Account } from "types"
import {
- FeederPool,
- Masset,
AssetProxy__factory,
- ExposedMasset,
- IERC4626Vault,
MockConnector__factory,
- MockERC20,
MockERC20__factory,
MockErroneousConnector1__factory,
MockErroneousConnector2__factory,
- MockLendingConnector,
MockLendingConnector__factory,
- MockMasset,
MockMasset__factory,
- MockNexus,
MockNexus__factory,
- MockSavingsManager,
MockSavingsManager__factory,
- MockVaultConnector,
MockVaultConnector__factory,
- SavingsContract,
SavingsContract__factory,
- Unwrapper,
Unwrapper__factory,
} from "types/generated"
-import { getTimestamp } from "@utils/time"
-import { IModuleBehaviourContext, shouldBehaveLikeModule } from "../shared/Module.behaviour"
-import { IERC4626BehaviourContext, shouldBehaveLikeERC4626 } from "../shared/ERC4626.behaviour"
+
+import { shouldBehaveLikeModule } from "../shared/Module.behaviour"
+
+import type { FeederDetails, MassetDetails, StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type {
+ ExposedMasset,
+ FeederPool,
+ IERC4626Vault,
+ Masset,
+ MockERC20,
+ MockLendingConnector,
+ MockMasset,
+ MockNexus,
+ MockSavingsManager,
+ MockVaultConnector,
+ SavingsContract,
+ Unwrapper,
+} from "types/generated"
+import { shouldBehaveLikeERC4626 } from "../shared/ERC4626.behaviour"
+
+import type { IERC4626BehaviourContext } from "../shared/ERC4626.behaviour"
+import type { IModuleBehaviourContext } from "../shared/Module.behaviour"
interface Balances {
totalCredits: BN
diff --git a/test/savings/savings-manager.spec.ts b/test/savings/savings-manager.spec.ts
index 00b5b363..70fed964 100644
--- a/test/savings/savings-manager.spec.ts
+++ b/test/savings/savings-manager.spec.ts
@@ -1,29 +1,28 @@
/* eslint-disable @typescript-eslint/naming-convention */
-import { ethers } from "hardhat"
-import { expect } from "chai"
-import { simpleToExactAmount, BN } from "@utils/math"
import { assertBNClose, assertBNClosePercent, assertBNSlightlyGTPercent } from "@utils/assertions"
-import { StandardAccounts, MassetMachine } from "@utils/machines"
-import { fullScale, ZERO_ADDRESS, ZERO, MAX_UINT256, TEN_MINS, ONE_DAY, DEAD_ADDRESS, ONE_WEEK, ONE_MIN } from "@utils/constants"
+import { DEAD_ADDRESS, fullScale, MAX_UINT256, ONE_DAY, ONE_MIN, ONE_WEEK, TEN_MINS, ZERO, ZERO_ADDRESS } from "@utils/constants"
+import { MassetMachine } from "@utils/machines"
+import { BN, simpleToExactAmount } from "@utils/math"
import { getTimestamp, increaseTime } from "@utils/time"
+import { expect } from "chai"
+import { ethers } from "hardhat"
import {
- SavingsContract,
- MockNexus__factory,
- MockNexus,
- MockMasset,
MockMasset__factory,
+ MockNexus__factory,
+ MockRevenueRecipient__factory,
SavingsContract__factory,
- SavingsManager,
SavingsManager__factory,
- PausableModule,
- MockERC20,
- MockRevenueRecipient__factory,
Unwrapper__factory,
- Unwrapper,
} from "types/generated"
-import { Account } from "types"
-import { shouldBehaveLikePausableModule, IPausableModuleBehaviourContext } from "../shared/PausableModule.behaviour"
+
+
+import type { StandardAccounts } from "@utils/machines"
+import type { Account } from "types"
+import type { MockERC20, MockMasset, MockNexus, PausableModule, SavingsContract, SavingsManager, Unwrapper } from "types/generated"
+import { shouldBehaveLikePausableModule } from "../shared/PausableModule.behaviour"
+
+import type { IPausableModuleBehaviourContext } from "../shared/PausableModule.behaviour"
describe("SavingsManager", async () => {
const TEN = BN.from(10)
diff --git a/test/shared/ERC20.behaviour.ts b/test/shared/ERC20.behaviour.ts
index 56642318..3e16252f 100644
--- a/test/shared/ERC20.behaviour.ts
+++ b/test/shared/ERC20.behaviour.ts
@@ -1,10 +1,10 @@
+import { ZERO_ADDRESS } from "@utils/constants"
+import { BN } from "@utils/math"
import { expect } from "chai"
-import { BN } from "@utils/math"
-import { MassetMachine, MassetDetails } from "@utils/machines"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { ERC20 } from "types/generated"
-import { Account, EthAddress } from "types"
+import type { MassetDetails, MassetMachine } from "@utils/machines"
+import type { Account, EthAddress } from "types"
+import type { ERC20 } from "types/generated"
export interface IERC20BehaviourContext {
token: ERC20
diff --git a/test/shared/ERC20Burnable.behaviour.ts b/test/shared/ERC20Burnable.behaviour.ts
index e6375179..e1d714bf 100644
--- a/test/shared/ERC20Burnable.behaviour.ts
+++ b/test/shared/ERC20Burnable.behaviour.ts
@@ -1,10 +1,10 @@
+import { ZERO_ADDRESS } from "@utils/constants"
+import { BN } from "@utils/math"
import { expect } from "chai"
-import { BN } from "@utils/math"
-import { ZERO_ADDRESS } from "@utils/constants"
-import { ERC20Burnable } from "types/generated"
-import { Account } from "types"
-import { ContractTransaction } from "ethers"
+import type { ContractTransaction } from "ethers"
+import type { Account } from "types"
+import type { ERC20Burnable } from "types/generated"
export interface IERC20BurnableBehaviourContext {
burnableToken: ERC20Burnable
diff --git a/test/shared/ERC4626.behaviour.ts b/test/shared/ERC4626.behaviour.ts
index 0bbc1a6d..be743d42 100644
--- a/test/shared/ERC4626.behaviour.ts
+++ b/test/shared/ERC4626.behaviour.ts
@@ -1,9 +1,11 @@
import { ZERO, ZERO_ADDRESS } from "@utils/constants"
-import { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
-import { BN, simpleToExactAmount, safeInfinity } from "@utils/math"
+import { safeInfinity, simpleToExactAmount } from "@utils/math"
import { expect } from "chai"
-import { Account } from "types"
-import { ERC20, ERC205, IERC20Metadata, IERC4626Vault } from "types/generated"
+
+import type { MassetDetails, MassetMachine, StandardAccounts } from "@utils/machines"
+import type { BN } from "@utils/math"
+import type { Account } from "types"
+import type { ERC20, ERC205, IERC20Metadata, IERC4626Vault } from "types/generated"
export interface IERC4626BehaviourContext {
vault: IERC4626Vault
@@ -59,10 +61,8 @@ export function shouldBehaveLikeERC4626(ctx: IERC4626BehaviourContext): void {
)
})
it("fails if preview amount is zero", async () => {
- await expect(ctx.vault.connect(ctx.sa.default.signer).previewDeposit(ZERO)).to.be.revertedWith(
- "Must deposit something",
- )
- })
+ await expect(ctx.vault.connect(ctx.sa.default.signer).previewDeposit(ZERO)).to.be.revertedWith("Must deposit something")
+ })
})
describe("mint", async () => {
it("should mint shares to the vault", async () => {
diff --git a/test/shared/Module.behaviour.ts b/test/shared/Module.behaviour.ts
index b35fea27..74a40e25 100644
--- a/test/shared/Module.behaviour.ts
+++ b/test/shared/Module.behaviour.ts
@@ -1,7 +1,9 @@
-import { StandardAccounts } from "@utils/machines"
-import { expect } from "chai"
import { ZERO_ADDRESS } from "@utils/constants"
-import { INexus__factory, ImmutableModule } from "types/generated"
+import { expect } from "chai"
+import { INexus__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { ImmutableModule } from "types/generated"
export interface IModuleBehaviourContext {
module: ImmutableModule
diff --git a/test/shared/PausableModule.behaviour.ts b/test/shared/PausableModule.behaviour.ts
index 07f48476..5aafe44b 100644
--- a/test/shared/PausableModule.behaviour.ts
+++ b/test/shared/PausableModule.behaviour.ts
@@ -1,7 +1,9 @@
-import { StandardAccounts } from "@utils/machines"
-import { expect } from "chai"
import { ZERO_ADDRESS } from "@utils/constants"
-import { INexus__factory, PausableModule } from "types/generated"
+import { expect } from "chai"
+import { INexus__factory } from "types/generated"
+
+import type { StandardAccounts } from "@utils/machines"
+import type { PausableModule } from "types/generated"
export interface IPausableModuleBehaviourContext {
module: PausableModule
diff --git a/test/shared/RewardsDistributionRecipient.behaviour.ts b/test/shared/RewardsDistributionRecipient.behaviour.ts
index c0b8d15a..6a3d6a22 100644
--- a/test/shared/RewardsDistributionRecipient.behaviour.ts
+++ b/test/shared/RewardsDistributionRecipient.behaviour.ts
@@ -1,7 +1,11 @@
-import { expect } from "chai"
import { ZERO_ADDRESS } from "@utils/constants"
-import { InitializableRewardsDistributionRecipient } from "types/generated"
-import { IModuleBehaviourContext, shouldBehaveLikeModule } from "./Module.behaviour"
+import { expect } from "chai"
+
+import type { InitializableRewardsDistributionRecipient } from "types/generated"
+import { shouldBehaveLikeModule } from "./Module.behaviour"
+
+
+import type { IModuleBehaviourContext } from "./Module.behaviour"
function behaveLikeAModule(ctx: IModuleBehaviourContext): void {
return shouldBehaveLikeModule(ctx)
diff --git a/test/shared/root.spec.ts b/test/shared/root.spec.ts
index d5bd97c6..6141d272 100644
--- a/test/shared/root.spec.ts
+++ b/test/shared/root.spec.ts
@@ -1,7 +1,9 @@
import { BN } from "@utils/math"
-import { ethers } from "hardhat"
-import { MockRoot, MockRoot__factory } from "types/generated"
import { expect } from "chai"
+import { ethers } from "hardhat"
+import { MockRoot__factory } from "types/generated"
+
+import type { MockRoot } from "types/generated"
describe("Root", () => {
let root: MockRoot
diff --git a/test/shared/stable-math.spec.ts b/test/shared/stable-math.spec.ts
index 74df7dba..9edecd4c 100644
--- a/test/shared/stable-math.spec.ts
+++ b/test/shared/stable-math.spec.ts
@@ -1,8 +1,10 @@
import { fullScale, ratioScale } from "@utils/constants"
import { BN, simpleToExactAmount } from "@utils/math"
-import { ethers } from "hardhat"
-import { PublicStableMath, PublicStableMath__factory } from "types/generated"
import { expect } from "chai"
+import { ethers } from "hardhat"
+import { PublicStableMath__factory } from "types/generated"
+
+import type { PublicStableMath } from "types/generated"
describe("StableMath", async () => {
let math: PublicStableMath
diff --git a/types/common.ts b/types/common.ts
index 73903e41..8ce25955 100644
--- a/types/common.ts
+++ b/types/common.ts
@@ -1,4 +1,4 @@
-import { Signer } from "ethers"
+import type { Signer } from "ethers"
export type EthAddress = string
export type Bytes32 = string
diff --git a/types/machines.ts b/types/machines.ts
index 9f70ac66..6d19d777 100644
--- a/types/machines.ts
+++ b/types/machines.ts
@@ -1,7 +1,7 @@
-import { BN } from "../test-utils/math"
-import { EthAddress } from "./common"
-import { Basset } from "../test-utils/mstable-objects"
-import { MockERC20 } from "./generated"
+import type { BN } from "../test-utils/math"
+import type { Basset } from "../test-utils/mstable-objects"
+import type { EthAddress } from "./common"
+import type { MockERC20 } from "./generated"
export interface ATokenDetails {
bAsset: EthAddress
diff --git a/types/stakedToken.ts b/types/stakedToken.ts
index 1d2b006f..3a80e50d 100644
--- a/types/stakedToken.ts
+++ b/types/stakedToken.ts
@@ -1,4 +1,4 @@
-import { BN } from "@utils/math"
+import type { BN } from "@utils/math"
export interface UserBalance {
raw: BN
diff --git a/yarn.lock b/yarn.lock
index 58071780..29464f1e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4025,6 +4025,13 @@ eslint-plugin-jsx-a11y@^6.2.3:
jsx-ast-utils "^3.1.0"
language-tags "^1.0.5"
+eslint-plugin-prettier@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0"
+ integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==
+ dependencies:
+ prettier-linter-helpers "^1.0.0"
+
eslint-plugin-react@^7.18.3:
version "7.24.0"
resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.24.0.tgz"
@@ -4043,6 +4050,23 @@ eslint-plugin-react@^7.18.3:
resolve "^2.0.0-next.3"
string.prototype.matchall "^4.0.5"
+eslint-plugin-simple-import-sort@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8"
+ integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==
+
+eslint-plugin-unused-imports@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz#d8db8c4d0cfa0637a8b51ce3fd7d1b6bc3f08520"
+ integrity sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==
+ dependencies:
+ eslint-rule-composer "^0.3.0"
+
+eslint-rule-composer@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
+ integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
+
eslint-scope@^4.0.3:
version "4.0.3"
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz"
@@ -5994,7 +6018,7 @@ humanize-duration@^3.21.0:
husky@^6.0.0:
version "6.0.0"
- resolved "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz"
+ resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e"
integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==
iconv-lite@0.4.24, iconv-lite@^0.4.24:
@@ -8506,6 +8530,13 @@ prepend-http@^2.0.0:
resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz"
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
+prettier-linter-helpers@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
+ integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
+ dependencies:
+ fast-diff "^1.1.2"
+
prettier-plugin-solidity@^1.0.0-beta.10:
version "1.0.0-beta.13"
resolved "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.13.tgz"