From f40fa2ed03253360028ad538ebe0b043bbd73a50 Mon Sep 17 00:00:00 2001 From: Wodann Date: Wed, 27 Mar 2024 15:38:07 +0000 Subject: [PATCH] fix: sporadic failures due to promises --- package.json | 2 +- test/fixtures/aaveV2.test.js | 6 +- test/fixtures/uniswap.test.js | 10 +- test/lib/addressArrayUtil.test.js | 2 +- test/lib/exactSafeErc20.test.js | 2 +- test/lib/preciseUnitMath.test.js | 2 +- test/lib/uint256ArrayUtil.test.js | 4 +- test/lib/unitConversionUtil.test.js | 2 +- test/protocol/controller.test.js | 28 +- .../kyberLegacyExchangeAdapter.test.js | 10 +- .../exchange/oneInchExchangeAdapter.test.js | 8 +- .../exchange/uniswapV2ExchangeAdapter.test.js | 8 +- .../uniswapV2ExchangeAdapterV2.test.js | 20 +- test/protocol/integration/lib/aaveV2.test.js | 28 +- .../oracles/ChainlinkOracleAdapter.test.js | 14 +- .../oracles/ChainlinkSerialOracle.test.js | 8 +- .../ChainlinkSerialOracleAdapter.test.js | 19 +- .../oracles/chainLinkOracle.test.js | 10 +- .../oracles/uniswapV2PairPriceAdapter.test.js | 12 +- .../staking/curveStakingAdapter.test.js | 12 +- .../wrapV2/aaveV2WrapV2Adapter.test.js | 12 +- test/protocol/integrationRegistry.test.js | 18 +- test/protocol/matrixToken.test.js | 70 ++--- test/protocol/matrixTokenFactory.test.js | 6 +- test/protocol/matrixValuer.test.js | 6 +- .../modules/aaveLeverageModule.test.js | 102 +++---- test/protocol/modules/airdropModule.test.js | 66 ++--- .../modules/basicIssuanceModule.test.js | 12 +- .../modules/debtIssuanceModule.test.js | 44 +-- .../modules/debtIssuanceModuleV2.test.js | 36 +-- test/protocol/modules/issuanceModule.test.js | 12 +- .../modules/navIssuanceModule.test.js | 54 ++-- .../modules/slippageIssuanceModule.test.js | 50 ++-- test/protocol/modules/stakingModule.test.js | 22 +- .../modules/streamingFeeModule.test.js | 28 +- test/protocol/modules/tradeModule.test.js | 42 +-- test/protocol/modules/wrapModuleV2.test.js | 18 +- test/protocol/priceOracle.test.js | 26 +- yarn.lock | 266 +++++------------- 39 files changed, 493 insertions(+), 604 deletions(-) diff --git a/package.json b/package.json index 30e7c03..7a43ff4 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "ethereum-checksum-address": "^0.0.8", "ethereum-waffle": "^3.4.4", "ethers": "^5.7.2", - "hardhat": "~2.20.1", + "hardhat": "~2.22.2", "hardhat-contract-sizer": "^2.10.0", "hardhat-gas-reporter": "^2.0.2", "prettier": "^3.2.5", diff --git a/test/fixtures/aaveV2.test.js b/test/fixtures/aaveV2.test.js index 1bcefab..5f47959 100644 --- a/test/fixtures/aaveV2.test.js +++ b/test/fixtures/aaveV2.test.js @@ -13,8 +13,8 @@ const { AaveV2Fixture } = require('./aaveV2Fixture'); const { getSigners } = require('../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('AaveV2Fixture', async () => { - const [owner, protocolFeeRecipient] = await getSigners(); +describe('AaveV2Fixture', () => { + const [owner, protocolFeeRecipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const aaveV2Fixture = new AaveV2Fixture(owner); @@ -28,7 +28,7 @@ describe('AaveV2Fixture', async () => { await revertBlockchain(snapshotId); }); - describe('init', async () => { + describe('init', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/fixtures/uniswap.test.js b/test/fixtures/uniswap.test.js index 89cdcb1..5a19adb 100644 --- a/test/fixtures/uniswap.test.js +++ b/test/fixtures/uniswap.test.js @@ -13,8 +13,8 @@ const { getSigners } = require('../helpers/accountUtil'); const { ZERO, MAX_UINT_256 } = require('../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('class UniswapFixture', async () => { - const [owner, protocolFeeRecipient] = await getSigners(); +describe('class UniswapFixture', () => { + const [owner, protocolFeeRecipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const uniswapFixture = new UniswapFixture(owner); @@ -29,7 +29,7 @@ describe('class UniswapFixture', async () => { await revertBlockchain(snapshotId); }); - describe('init', async () => { + describe('init', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -76,7 +76,7 @@ describe('class UniswapFixture', async () => { }); }); - describe('addLiquidity', async () => { + describe('addLiquidity', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -118,7 +118,7 @@ describe('class UniswapFixture', async () => { }); }); - describe('stake', async () => { + describe('stake', () => { let stakeAmount; beforeEach(async () => { diff --git a/test/lib/addressArrayUtil.test.js b/test/lib/addressArrayUtil.test.js index 480171a..cef7999 100644 --- a/test/lib/addressArrayUtil.test.js +++ b/test/lib/addressArrayUtil.test.js @@ -11,7 +11,7 @@ const { testCases, others } = require('../cases/addressArrayUtil.json'); const { compareArray, quickPopArrayItem } = require('../helpers/arrayUtil'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('library AddressArrayUtil', async () => { +describe('library AddressArrayUtil', () => { let arrayMock; let snapshotId; diff --git a/test/lib/exactSafeErc20.test.js b/test/lib/exactSafeErc20.test.js index cc2d988..7f25c53 100644 --- a/test/lib/exactSafeErc20.test.js +++ b/test/lib/exactSafeErc20.test.js @@ -13,7 +13,7 @@ const { deployContract } = require('../helpers/deploy'); const { testCases } = require('../cases/exactSafeErc20.json'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('library ExactSafeErc20', async () => { +describe('library ExactSafeErc20', () => { let appMock; let erc20Mock; const [owner, userA, userB] = provider.getWallets(); diff --git a/test/lib/preciseUnitMath.test.js b/test/lib/preciseUnitMath.test.js index 3bda403..a6d852f 100644 --- a/test/lib/preciseUnitMath.test.js +++ b/test/lib/preciseUnitMath.test.js @@ -23,7 +23,7 @@ const { preciseDivFloorInt, } = require('../helpers/mathUtil'); -describe('library PreciseUnitMath', async () => { +describe('library PreciseUnitMath', () => { let mathMock; let snapshotId; diff --git a/test/lib/uint256ArrayUtil.test.js b/test/lib/uint256ArrayUtil.test.js index ab91f51..b2dcd4b 100644 --- a/test/lib/uint256ArrayUtil.test.js +++ b/test/lib/uint256ArrayUtil.test.js @@ -11,7 +11,7 @@ const { compareArray } = require('../helpers/arrayUtil'); const { testCases } = require('../cases/uint256ArrayUtil.json'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('library Uint256ArrayUtil', async () => { +describe('library Uint256ArrayUtil', () => { let arrayMock; let snapshotId; @@ -25,7 +25,7 @@ describe('library Uint256ArrayUtil', async () => { }); testCases.map((testCase, i) => { - describe(`test case ${i}`, async () => { + describe(`test case ${i}`, () => { const array1 = testCase.array1; const array2 = testCase.array2; const result1 = testCase.result; diff --git a/test/lib/unitConversionUtil.test.js b/test/lib/unitConversionUtil.test.js index f41c60f..5e4efba 100644 --- a/test/lib/unitConversionUtil.test.js +++ b/test/lib/unitConversionUtil.test.js @@ -11,7 +11,7 @@ const { ethToWei, usdToWei } = require('../helpers/unitUtil'); const { testCases } = require('../cases/unitConversionUtil.json'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('library UnitConversionUtil', async () => { +describe('library UnitConversionUtil', () => { const usdcDecimals = 6; let unitMock; diff --git a/test/protocol/controller.test.js b/test/protocol/controller.test.js index 6e2b2d3..cf77a3c 100644 --- a/test/protocol/controller.test.js +++ b/test/protocol/controller.test.js @@ -12,7 +12,7 @@ const { getSigners } = require('../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); const { ZERO_ADDRESS, ZERO, ONE } = require('../helpers/constants'); -describe('contract Controller', async () => { +describe('contract Controller', () => { const [owner, protocolFeeRecipient, basicIssuanceModule, matrixTokenFactory, priceOracle, matrixToken, userMock, randomAccount] = getSigners(); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -42,7 +42,7 @@ describe('contract Controller', async () => { revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -63,7 +63,7 @@ describe('contract Controller', async () => { }); }); - describe('initialize', async () => { + describe('initialize', () => { let resourceId; let factories; let modules; @@ -177,7 +177,7 @@ describe('contract Controller', async () => { }); }); - describe('addMatrix', async () => { + describe('addMatrix', () => { const matrixTokenAddr = matrixToken.address; async function addMatrix() { @@ -237,7 +237,7 @@ describe('contract Controller', async () => { }); }); - describe('removeMatrix', async () => { + describe('removeMatrix', () => { const matrixTokenAddr = matrixToken.address; async function removeMatrix() { @@ -295,7 +295,7 @@ describe('contract Controller', async () => { }); }); - describe('addFactory', async () => { + describe('addFactory', () => { let factory; async function addFactory() { @@ -352,7 +352,7 @@ describe('contract Controller', async () => { }); }); - describe('removeFactory', async () => { + describe('removeFactory', () => { let factory; async function removeFactory() { @@ -410,7 +410,7 @@ describe('contract Controller', async () => { }); }); - describe('addModule', async () => { + describe('addModule', () => { let module; async function addModule() { @@ -467,7 +467,7 @@ describe('contract Controller', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let module; async function removeModule() { @@ -525,7 +525,7 @@ describe('contract Controller', async () => { }); }); - describe('addResource', async () => { + describe('addResource', () => { let resource; let resourceId; let priceOracleAddress; @@ -596,7 +596,7 @@ describe('contract Controller', async () => { }); }); - describe('removeResource', async () => { + describe('removeResource', () => { let resource; let resourceId; @@ -661,7 +661,7 @@ describe('contract Controller', async () => { }); }); - describe('addFee', async () => { + describe('addFee', () => { let module; let feeType; let feePercentage; @@ -718,7 +718,7 @@ describe('contract Controller', async () => { }); }); - describe('editFee', async () => { + describe('editFee', () => { let module; let feeType; let feePercentage; @@ -776,7 +776,7 @@ describe('contract Controller', async () => { }); }); - describe('editFeeRecipient', async () => { + describe('editFeeRecipient', () => { let protocolFeeRecipient; async function editFeeRecipient() { diff --git a/test/protocol/integration/exchange/kyberLegacyExchangeAdapter.test.js b/test/protocol/integration/exchange/kyberLegacyExchangeAdapter.test.js index d9e10a2..44a2c0e 100644 --- a/test/protocol/integration/exchange/kyberLegacyExchangeAdapter.test.js +++ b/test/protocol/integration/exchange/kyberLegacyExchangeAdapter.test.js @@ -13,8 +13,8 @@ const { SystemFixture } = require('../../../fixtures/systemFixture'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); const { ZERO, MAX_UINT_256, ZERO_ADDRESS, EMPTY_BYTES } = require('../../../helpers/constants'); -describe('contract KyberLegacyExchangeAdapter', async () => { - const [owner, protocolFeeRecipient, matrixTokenMock] = await getSigners(); +describe('contract KyberLegacyExchangeAdapter', () => { + const [owner, protocolFeeRecipient, matrixTokenMock] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const wbtcRate = ethToWei(33); // 1 WBTC = 33 ETH @@ -37,14 +37,14 @@ describe('contract KyberLegacyExchangeAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('getSpender', async () => { + describe('getSpender', () => { it('should return the correct spender address', async () => { const actualKyberAddress = await kyberLegacyExchangeAdapter.getSpender(); expect(actualKyberAddress).eq(kyberNetworkProxy.address); }); }); - describe('getConversionRates', async () => { + describe('getConversionRates', () => { async function getConversionRates() { const srcToken = systemFixture.wbtc.address; const destToken = systemFixture.weth.address; @@ -58,7 +58,7 @@ describe('contract KyberLegacyExchangeAdapter', async () => { }); }); - describe('getTradeCalldata', async () => { + describe('getTradeCalldata', () => { const srcQuantity = btcToWei(1); // Trade 1 WBTC const minDestQuantity = ethToWei(33); // Receive at least 33 ETH const pathBytes = EMPTY_BYTES; diff --git a/test/protocol/integration/exchange/oneInchExchangeAdapter.test.js b/test/protocol/integration/exchange/oneInchExchangeAdapter.test.js index 4cc3219..be69e98 100644 --- a/test/protocol/integration/exchange/oneInchExchangeAdapter.test.js +++ b/test/protocol/integration/exchange/oneInchExchangeAdapter.test.js @@ -14,8 +14,8 @@ const { ethToWei, btcToWei } = require('../../../helpers/unitUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); const { ZERO, ONE, EMPTY_BYTES, ZERO_ADDRESS } = require('../../../helpers/constants'); -describe('contract OneInchExchangeAdapter', async () => { - const [owner, matrixTokenMock, wbtcMock, wethMock, oneInchSpenderMock, randomAccount] = await getSigners(); +describe('contract OneInchExchangeAdapter', () => { + const [owner, matrixTokenMock, wbtcMock, wethMock, oneInchSpenderMock, randomAccount] = getSigners(); let oneInchExchangeMock; let oneInchExchangeAdapter; @@ -42,7 +42,7 @@ describe('contract OneInchExchangeAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should have the correct approve address', async () => { const actualAddress = await oneInchExchangeAdapter.getSpender(); expect(actualAddress).eq(oneInchSpenderMock.address); @@ -59,7 +59,7 @@ describe('contract OneInchExchangeAdapter', async () => { }); }); - describe('getTradeCalldata', async () => { + describe('getTradeCalldata', () => { const srcQuantity = ONE; const minDestQuantity = ONE; diff --git a/test/protocol/integration/exchange/uniswapV2ExchangeAdapter.test.js b/test/protocol/integration/exchange/uniswapV2ExchangeAdapter.test.js index 161a234..5db3aaf 100644 --- a/test/protocol/integration/exchange/uniswapV2ExchangeAdapter.test.js +++ b/test/protocol/integration/exchange/uniswapV2ExchangeAdapter.test.js @@ -15,8 +15,8 @@ const { UniswapFixture } = require('../../../fixtures/uniswapFixture'); const { snapshotBlockchain, revertBlockchain, getLastBlockTimestamp } = require('../../../helpers/evmUtil.js'); const { ZERO, EMPTY_BYTES } = require('../../../helpers/constants'); -describe('contract UniswapV2ExchangeAdapter', async () => { - const [owner, protocolFeeRecipient, matrixTokenMock] = await getSigners(); +describe('contract UniswapV2ExchangeAdapter', () => { + const [owner, protocolFeeRecipient, matrixTokenMock] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const uniswapFixture = new UniswapFixture(owner); @@ -35,14 +35,14 @@ describe('contract UniswapV2ExchangeAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('getSpender', async () => { + describe('getSpender', () => { it('should have the correct router address', async () => { const actualRouterAddress = await uniswapV2ExchangeAdapter.getSpender(); expect(actualRouterAddress).eq(uniswapFixture.router.address); }); }); - describe('getTradeCalldata', async () => { + describe('getTradeCalldata', () => { const srcQuantity = btcToWei(1); // Trade 1 WBTC const minDestQuantity = ethToWei(30000); // Receive at least 30k DAI diff --git a/test/protocol/integration/exchange/uniswapV2ExchangeAdapterV2.test.js b/test/protocol/integration/exchange/uniswapV2ExchangeAdapterV2.test.js index fb861c2..2fb0113 100644 --- a/test/protocol/integration/exchange/uniswapV2ExchangeAdapterV2.test.js +++ b/test/protocol/integration/exchange/uniswapV2ExchangeAdapterV2.test.js @@ -15,8 +15,8 @@ const { UniswapFixture } = require('../../../fixtures/uniswapFixture'); const { snapshotBlockchain, revertBlockchain, getLastBlockTimestamp } = require('../../../helpers/evmUtil.js'); const { ZERO, EMPTY_BYTES } = require('../../../helpers/constants'); -describe('contract UniswapV2ExchangeAdapterV2', async () => { - const [owner, protocolFeeRecipient, matrixTokenMock] = await getSigners(); +describe('contract UniswapV2ExchangeAdapterV2', () => { + const [owner, protocolFeeRecipient, matrixTokenMock] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const uniswapFixture = new UniswapFixture(owner); @@ -35,14 +35,14 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { await revertBlockchain(snapshotId); }); - describe('getSpender', async () => { + describe('getSpender', () => { it('should return the correct spender address', async () => { const spender = await uniswapV2ExchangeAdapterV2.getSpender(); expect(spender).eq(uniswapFixture.router.address); }); }); - describe('getExchangeData', async () => { + describe('getExchangeData', () => { it('should return the correct data', async () => { const shouldSwapExactTokensForTokens = true; const tradePath = [systemFixture.weth.address, systemFixture.wbtc.address, systemFixture.dai.address]; @@ -53,7 +53,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { }); }); - describe('generateDataParam', async () => { + describe('generateDataParam', () => { let srcToken; let destToken; let isFixIn; @@ -67,7 +67,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { return await uniswapV2ExchangeAdapterV2.generateDataParam(srcToken, destToken, isFixIn); } - describe('when boolean fixed input amount is true', async () => { + describe('when boolean fixed input amount is true', () => { it('should return the correct trade calldata', async () => { isFixIn = true; const dataParam = await generateDataParam(); @@ -79,7 +79,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { }); }); - describe('when boolean fixed input amount is false', async () => { + describe('when boolean fixed input amount is false', () => { it('should return the correct trade calldata', async () => { isFixIn = false; const dataParam = await generateDataParam(); @@ -92,7 +92,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { }); }); - describe('getTradeCalldata', async () => { + describe('getTradeCalldata', () => { const srcQuantity = btcToWei(1); // Trade 1 WBTC; const minDestQuantity = ethToWei(30000); // Receive at least 30k DAI; @@ -112,7 +112,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { return await uniswapV2ExchangeAdapterV2.getTradeCalldata(srcToken, destToken, matrixTokenAddress, srcQuantity, minDestQuantity, dataBytes); } - describe('when swap exact tokens for tokens', async () => { + describe('when swap exact tokens for tokens', () => { it('should return the correct trade calldata', async () => { const shouldSwapExactTokensForTokens = true; const path = [srcToken, systemFixture.weth.address, destToken]; @@ -133,7 +133,7 @@ describe('contract UniswapV2ExchangeAdapterV2', async () => { }); }); - describe('when swap tokens for exact tokens', async () => { + describe('when swap tokens for exact tokens', () => { it('should return the correct trade calldata', async () => { const shouldSwapExactTokensForTokens = false; const path = [srcToken, systemFixture.weth.address, destToken]; diff --git a/test/protocol/integration/lib/aaveV2.test.js b/test/protocol/integration/lib/aaveV2.test.js index c75bf15..d9f167f 100644 --- a/test/protocol/integration/lib/aaveV2.test.js +++ b/test/protocol/integration/lib/aaveV2.test.js @@ -14,8 +14,8 @@ const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUt const { ZERO, ONE, TWO, MAX_UINT_256, ZERO_ADDRESS } = require('../../../helpers/constants'); const { deployContract, deployContractAndLinkLibraries } = require('../../../helpers/deploy'); -describe('library AaveV2', async () => { - const [owner, protocolFeeRecipient] = await getSigners(); +describe('library AaveV2', () => { + const [owner, protocolFeeRecipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const aaveV2Fixture = new AaveV2Fixture(owner); const stableInterestRateMode = ONE; @@ -74,7 +74,7 @@ describe('library AaveV2', async () => { await revertBlockchain(snapshotId); }); - describe('getDepositCalldata', async () => { + describe('getDepositCalldata', () => { let asset; let onBehalfOf; let referralCode; @@ -108,7 +108,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeDeposit', async () => { + describe('invokeDeposit', () => { let asset; let matrixTokenAddress; let lendingPoolAddress; @@ -140,7 +140,7 @@ describe('library AaveV2', async () => { }); }); - describe('getSetUserUseReserveAsCollateralCalldata', async () => { + describe('getSetUserUseReserveAsCollateralCalldata', () => { let asset; let isUseAsCollateral; let lendingPoolAddress; @@ -182,7 +182,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeSetUserUseReserveAsCollateral', async () => { + describe('invokeSetUserUseReserveAsCollateral', () => { let asset; let matrixTokenAddress; let isUseAsCollateral; @@ -223,7 +223,7 @@ describe('library AaveV2', async () => { }); }); - describe('getWithdrawCalldata', async () => { + describe('getWithdrawCalldata', () => { let asset; let receiver; let lendingPoolAddress; @@ -255,7 +255,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeWithdraw', async () => { + describe('invokeWithdraw', () => { let asset; let matrixTokenAddress; let lendingPoolAddress; @@ -293,7 +293,7 @@ describe('library AaveV2', async () => { }); }); - describe('getBorrowCalldata', async () => { + describe('getBorrowCalldata', () => { let asset; let onBehalfOf; let referralCode; @@ -335,7 +335,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeBorrow', async () => { + describe('invokeBorrow', () => { let asset; let interestRateMode; let matrixTokenAddress; @@ -379,7 +379,7 @@ describe('library AaveV2', async () => { }); }); - describe('getRepayCalldata', async () => { + describe('getRepayCalldata', () => { let asset; let onBehalfOf; let interestRateMode; @@ -413,7 +413,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeRepay', async () => { + describe('invokeRepay', () => { let asset; let interestRateMode; let matrixTokenAddress; @@ -462,7 +462,7 @@ describe('library AaveV2', async () => { }); }); - describe('getSwapBorrowRateModeCalldata', async () => { + describe('getSwapBorrowRateModeCalldata', () => { let asset; let rateMode; let lendingPoolAddress; @@ -505,7 +505,7 @@ describe('library AaveV2', async () => { }); }); - describe('invokeSwapBorrowRateMode', async () => { + describe('invokeSwapBorrowRateMode', () => { let asset; let rateMode; let matrixTokenAddress; diff --git a/test/protocol/integration/oracles/ChainlinkOracleAdapter.test.js b/test/protocol/integration/oracles/ChainlinkOracleAdapter.test.js index dada14c..b6c7334 100644 --- a/test/protocol/integration/oracles/ChainlinkOracleAdapter.test.js +++ b/test/protocol/integration/oracles/ChainlinkOracleAdapter.test.js @@ -11,12 +11,12 @@ const { deployContract } = require('../../../helpers/deploy'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract ChainlinkOracleAdapter', async () => { - const [owner] = await getSigners(); +describe('contract ChainlinkOracleAdapter', () => { + const [owner] = getSigners(); const price = BigNumber.from(1000); const expectedPrice = price.mul(BigNumber.from(10).pow(18)); - const BTC = await getRandomAddress(); - const USD = await getRandomAddress(); + let BTC; + let USD; let baseAsset; let quotaAsset; @@ -26,6 +26,8 @@ describe('contract ChainlinkOracleAdapter', async () => { let snapshotId; before(async () => { + BTC = await getRandomAddress(); + USD = await getRandomAddress(); snapshotId = await snapshotBlockchain(); chainlinkFeedRegistryMock = await deployContract('ChainlinkFeedRegistryMock', [], owner); @@ -36,13 +38,13 @@ describe('contract ChainlinkOracleAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('getFeedRegistry', async () => { + describe('getFeedRegistry', () => { it('should return the correct registry address', async () => { expect(await chainlinkSerialOracleAdapter.getFeedRegistry()).eq(chainlinkFeedRegistryMock.address); }); }); - describe('getPrice', async () => { + describe('getPrice', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/protocol/integration/oracles/ChainlinkSerialOracle.test.js b/test/protocol/integration/oracles/ChainlinkSerialOracle.test.js index 0f3dfbd..c6de7f8 100644 --- a/test/protocol/integration/oracles/ChainlinkSerialOracle.test.js +++ b/test/protocol/integration/oracles/ChainlinkSerialOracle.test.js @@ -11,8 +11,8 @@ const { deployContract } = require('../../../helpers/deploy'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract ChainlinkSerialOracle', async () => { - const [owner] = await getSigners(); +describe('contract ChainlinkSerialOracle', () => { + const [owner] = getSigners(); const name = 'BTC/ETH/USD'; const price1 = BigNumber.from(1000); const price2 = BigNumber.from(10); @@ -35,7 +35,7 @@ describe('contract ChainlinkSerialOracle', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -86,7 +86,7 @@ describe('contract ChainlinkSerialOracle', async () => { }); }); - describe('read', async () => { + describe('read', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/protocol/integration/oracles/ChainlinkSerialOracleAdapter.test.js b/test/protocol/integration/oracles/ChainlinkSerialOracleAdapter.test.js index a1a2fdf..507039a 100644 --- a/test/protocol/integration/oracles/ChainlinkSerialOracleAdapter.test.js +++ b/test/protocol/integration/oracles/ChainlinkSerialOracleAdapter.test.js @@ -11,14 +11,14 @@ const { deployContract } = require('../../../helpers/deploy'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract ChainlinkSerialOracleAdapter', async () => { - const [owner] = await getSigners(); +describe('contract ChainlinkSerialOracleAdapter', () => { + const [owner] = getSigners(); const price1 = BigNumber.from(1000); const price2 = BigNumber.from(10); const expectedPrice = price1.mul(price2).mul(BigNumber.from(10).pow(18)); - const BTC = await getRandomAddress(); - const ETH = await getRandomAddress(); - const USD = await getRandomAddress(); + let BTC; + let ETH; + let USD; const intermediaryAsset = ETH; let baseAsset; @@ -30,6 +30,9 @@ describe('contract ChainlinkSerialOracleAdapter', async () => { let snapshotId; before(async () => { + BTC = await getRandomAddress(); + ETH = await getRandomAddress(); + USD = await getRandomAddress(); snapshotId = await snapshotBlockchain(); chainlinkFeedRegistryMock = await deployContract('ChainlinkFeedRegistryMock', [], owner); @@ -40,19 +43,19 @@ describe('contract ChainlinkSerialOracleAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('getFeedRegistry', async () => { + describe('getFeedRegistry', () => { it('should return the correct registry address', async () => { expect(await chainlinkSerialOracleAdapter.getFeedRegistry()).eq(chainlinkFeedRegistryMock.address); }); }); - describe('getIntermediaryAsset', async () => { + describe('getIntermediaryAsset', () => { it('should return the correct intermediary asset', async () => { expect(await chainlinkSerialOracleAdapter.getIntermediaryAsset()).eq(intermediaryAsset); }); }); - describe('getPrice', async () => { + describe('getPrice', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/protocol/integration/oracles/chainLinkOracle.test.js b/test/protocol/integration/oracles/chainLinkOracle.test.js index 53466fa..2c12f6b 100644 --- a/test/protocol/integration/oracles/chainLinkOracle.test.js +++ b/test/protocol/integration/oracles/chainLinkOracle.test.js @@ -12,8 +12,8 @@ const { deployContract } = require('../../../helpers/deploy'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract ChainlinkOracle', async () => { - const [owner] = await getSigners(); +describe('contract ChainlinkOracle', () => { + const [owner] = getSigners(); const name = 'TEST/USD'; const price = 1000; const expectedPrice = BigNumber.from(10).pow(18).mul(price); @@ -30,7 +30,7 @@ describe('contract ChainlinkOracle', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { let priceFeedAddress; let snapshotId; @@ -68,7 +68,7 @@ describe('contract ChainlinkOracle', async () => { }); }); - describe('read from ChainlinkPriceFeedMock', async () => { + describe('read from ChainlinkPriceFeedMock', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -93,7 +93,7 @@ describe('contract ChainlinkOracle', async () => { } }); - describe('read from ChainlinkAggregatorMock', async () => { + describe('read from ChainlinkAggregatorMock', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/protocol/integration/oracles/uniswapV2PairPriceAdapter.test.js b/test/protocol/integration/oracles/uniswapV2PairPriceAdapter.test.js index 9268f9a..6ddfa2b 100644 --- a/test/protocol/integration/oracles/uniswapV2PairPriceAdapter.test.js +++ b/test/protocol/integration/oracles/uniswapV2PairPriceAdapter.test.js @@ -15,8 +15,8 @@ const { preciseMul, preciseDiv } = require('../../../helpers/mathUtil'); const { ZERO_ADDRESS, ZERO, MAX_UINT_256 } = require('../../../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract UniswapV2PairPriceAdapter', async () => { - const [owner, protocolFeeRecipient, attacker] = await getSigners(); +describe('contract UniswapV2PairPriceAdapter', () => { + const [owner, protocolFeeRecipient, attacker] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const uniswapFixture = new UniswapFixture(owner); @@ -75,7 +75,7 @@ describe('contract UniswapV2PairPriceAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { let uniswapPools; // let snapshotId; @@ -139,7 +139,7 @@ describe('contract UniswapV2PairPriceAdapter', async () => { }); }); - describe('getPrice', async () => { + describe('getPrice', () => { let asset1; let asset2; @@ -301,7 +301,7 @@ describe('contract UniswapV2PairPriceAdapter', async () => { }); }); - describe('addPool', async () => { + describe('addPool', () => { let poolAddress; let token1Address; let token2Address; @@ -364,7 +364,7 @@ describe('contract UniswapV2PairPriceAdapter', async () => { }); }); - describe('removePair', async () => { + describe('removePair', () => { let poolAddress; let snapshotId; diff --git a/test/protocol/integration/staking/curveStakingAdapter.test.js b/test/protocol/integration/staking/curveStakingAdapter.test.js index 093abe8..d122f37 100644 --- a/test/protocol/integration/staking/curveStakingAdapter.test.js +++ b/test/protocol/integration/staking/curveStakingAdapter.test.js @@ -14,8 +14,8 @@ const { SystemFixture } = require('../../../fixtures/systemFixture'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract CurveStakingAdapter', async () => { - const [owner, protocolFeeRecipient] = await getSigners(); +describe('contract CurveStakingAdapter', () => { + const [owner, protocolFeeRecipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); let curveStakingAdapter; @@ -34,13 +34,13 @@ describe('contract CurveStakingAdapter', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('set the correct variables', async () => { expect(await curveStakingAdapter.getGaugeController()).eq(gaugeControllerMock.address); }); }); - describe('getSpenderAddress', async () => { + describe('getSpenderAddress', () => { it('should return the correct address', async () => { const stakingContract = await getRandomAddress(); const spender = await curveStakingAdapter.getSpenderAddress(stakingContract); @@ -48,7 +48,7 @@ describe('contract CurveStakingAdapter', async () => { }); }); - describe('getStakeCallData', async () => { + describe('getStakeCallData', () => { const amount = ethToWei(1); const stakeSignature = '0xb6b55f25'; // deposit(uint256) const generateCallData = (amount) => stakeSignature + bigNumberToData(amount); @@ -85,7 +85,7 @@ describe('contract CurveStakingAdapter', async () => { }); }); - describe('getUnstakeCallData', async () => { + describe('getUnstakeCallData', () => { const amount = ethToWei(1); const unstakeSignature = '0x2e1a7d4d'; // withdraw(uint256) const generateCallData = (amount) => unstakeSignature + bigNumberToData(amount); diff --git a/test/protocol/integration/wrapV2/aaveV2WrapV2Adapter.test.js b/test/protocol/integration/wrapV2/aaveV2WrapV2Adapter.test.js index 64c2f0f..c52dbac 100644 --- a/test/protocol/integration/wrapV2/aaveV2WrapV2Adapter.test.js +++ b/test/protocol/integration/wrapV2/aaveV2WrapV2Adapter.test.js @@ -14,8 +14,8 @@ const { AaveV2Fixture } = require('../../../fixtures/aaveV2Fixture'); const { getSigners, getRandomAddress } = require('../../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../../helpers/evmUtil.js'); -describe('contract AaveV2WrapV2Adapter', async () => { - const [owner, protocolFeeRecipient, INVALID_TOKEN] = await getSigners(); +describe('contract AaveV2WrapV2Adapter', () => { + const [owner, protocolFeeRecipient, INVALID_TOKEN] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const aaveV2Fixture = new AaveV2Fixture(owner); @@ -40,19 +40,19 @@ describe('contract AaveV2WrapV2Adapter', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should have the correct lending pool addresses provider', async () => { expect(await aaveV2WrapV2Adapter.ADDRESSES_PROVIDER()).eq(aaveV2Fixture.lendingPoolAddressesProvider.address); }); }); - describe('getSpenderAddress', async () => { + describe('getSpenderAddress', () => { it('should return the correct spender address', async () => { expect(await aaveV2WrapV2Adapter.getSpenderAddress(underlyingToken.address, wrappedToken.address)).eq(aaveV2Fixture.lendingPool.address); }); }); - describe('getWrapCallData', async () => { + describe('getWrapCallData', () => { const subjectUnderlyingUnits = ethToWei(2); const subjectWrapData = ZERO_BYTES; @@ -90,7 +90,7 @@ describe('contract AaveV2WrapV2Adapter', async () => { }); }); - describe('getUnwrapCallData', async () => { + describe('getUnwrapCallData', () => { let unwrapData = ZERO_BYTES; let wrappedTokenUnits = ethToWei(2); diff --git a/test/protocol/integrationRegistry.test.js b/test/protocol/integrationRegistry.test.js index f352184..23809b7 100644 --- a/test/protocol/integrationRegistry.test.js +++ b/test/protocol/integrationRegistry.test.js @@ -12,7 +12,7 @@ const { ZERO_ADDRESS } = require('../helpers/constants'); const { getSigners } = require('../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('contract IntegrationRegistry', async () => { +describe('contract IntegrationRegistry', () => { const [firstAdapterName, secondAdapterName, thirdAdapterName] = ['COMPOUND', 'KYBER', 'ONEINCH']; const [owner, firstAdapter, secondAdapter, firstModule, secondModule, thirdModule, randomAccount] = getSigners(); @@ -31,7 +31,7 @@ describe('contract IntegrationRegistry', async () => { revertBlockchain(snapshotId); }); - describe('addIntegration', async () => { + describe('addIntegration', () => { let module; let adapterName; let adapter; @@ -90,7 +90,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('batchAddIntegration', async () => { + describe('batchAddIntegration', () => { let modules; let adapterNames; let adapters; @@ -186,7 +186,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('removeIntegration', async () => { + describe('removeIntegration', () => { let module; let adapterName; @@ -236,7 +236,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('editIntegration', async () => { + describe('editIntegration', () => { let subjectModule; let subjectAdapterName; let subjectAdapter; @@ -298,7 +298,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('batchEditIntegration', async () => { + describe('batchEditIntegration', () => { let modules; let adapterNames; let adapters; @@ -388,7 +388,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('isValidIntegration', async () => { + describe('isValidIntegration', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -410,7 +410,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('getIntegrationAdapter', async () => { + describe('getIntegrationAdapter', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -442,7 +442,7 @@ describe('contract IntegrationRegistry', async () => { }); }); - describe('getIntegrationAdapterWithHash', async () => { + describe('getIntegrationAdapterWithHash', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); diff --git a/test/protocol/matrixToken.test.js b/test/protocol/matrixToken.test.js index a45b850..bf77b2a 100644 --- a/test/protocol/matrixToken.test.js +++ b/test/protocol/matrixToken.test.js @@ -16,7 +16,7 @@ const { getSigners, getEthBalance, getRandomAddress } = require('../helpers/acco const { preciseMul, preciseDivFloorInt, preciseMulFloorInt } = require('../helpers/mathUtil'); const { ZERO, ONE, ZERO_ADDRESS, PRECISE_UNIT, EMPTY_BYTES, MODULE_STATE, POSITION_STATE } = require('../helpers/constants'); -describe('contract MatrixToken', async () => { +describe('contract MatrixToken', () => { const [owner, feeRecipient, manager, mockBasicIssuanceModule, mockLockedModule, unaddedModule, pendingModule, testAccount, randomAccount] = getSigners(); const firstComponentUnits = ethToWei(1); const secondComponentUnits = ethToWei(2); @@ -32,8 +32,8 @@ describe('contract MatrixToken', async () => { let modules; let units; - async function shouldRevertIfModuleDisabled(aTestFun) { - describe('when the calling module is disabled', async () => { + function shouldRevertIfModuleDisabled(aTestFun) { + describe('when the calling module is disabled', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -50,15 +50,15 @@ describe('contract MatrixToken', async () => { }); } - async function shouldRevertIfCallerIsNotModule(aTestFun) { + function shouldRevertIfCallerIsNotModule(aTestFun) { it('should revert when the caller is not a module', async () => { caller = randomAccount; await expect(aTestFun()).revertedWith('T11a'); }); } - async function shouldRevertIfMatrixTokenIsLocked(aTestFun) { - describe('when the MatrixToken is locked', async () => { + function shouldRevertIfMatrixTokenIsLocked(aTestFun) { + describe('when the MatrixToken is locked', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -84,7 +84,7 @@ describe('contract MatrixToken', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { before(async () => { firstComponent = await deployContract('Erc20Mock', ['First', 'MOCK', 18], owner); secondComponent = await deployContract('Erc20Mock', ['Second', 'MOCK', 18], owner); @@ -162,14 +162,14 @@ describe('contract MatrixToken', async () => { }); }); - describe('when there is a deployed MatrixToken', async () => { + describe('when there is a deployed MatrixToken', () => { before(async () => { await controller.initialize([], modules, [], []); await matrixToken.connect(mockBasicIssuanceModule).initializeModule(); await matrixToken.connect(mockLockedModule).initializeModule(); }); - describe('invoke', async () => { + describe('invoke', () => { let testSpender; let burnQuantity; let callData; @@ -275,7 +275,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('addComponent', async () => { + describe('addComponent', () => { let component; let snapshotId; @@ -318,7 +318,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(addComponent); }); - describe('removeComponent', async () => { + describe('removeComponent', () => { let component; let snapshotId; @@ -358,7 +358,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(removeComponent); }); - describe('editDefaultPositionUnit', async () => { + describe('editDefaultPositionUnit', () => { const multiplier = ethToWei(2); let component; @@ -420,7 +420,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(editDefaultPositionUnit); }); - describe('addExternalPositionModule', async () => { + describe('addExternalPositionModule', () => { let component; let externalModule; @@ -467,7 +467,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(addExternalPositionModule); }); - describe('removeExternalPositionModule', async () => { + describe('removeExternalPositionModule', () => { let component; let externalModule; @@ -525,7 +525,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(removeExternalPositionModule); }); - describe('editExternalPositionUnit', async () => { + describe('editExternalPositionUnit', () => { const multiplier = ethToWei(2); let component; @@ -593,7 +593,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(editExternalPositionUnit); }); - describe('editExternalPositionData', async () => { + describe('editExternalPositionData', () => { let component; let module; let data; @@ -633,7 +633,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfMatrixTokenIsLocked(editExternalPositionData); }); - describe('editPositionMultiplier', async () => { + describe('editPositionMultiplier', () => { let subjectPositionMultiplier; let snapshotId; @@ -697,7 +697,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfModuleDisabled(editPositionMultiplier); }); - describe('lock', async () => { + describe('lock', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -738,7 +738,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfModuleDisabled(lock); }); - describe('unlock', async () => { + describe('unlock', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -790,7 +790,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfModuleDisabled(unlock); }); - describe('mint', async () => { + describe('mint', () => { const quantity = ethToWei(3); const mintee = manager.address; @@ -839,7 +839,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfModuleDisabled(mint); }); - describe('burn', async () => { + describe('burn', () => { const mintQuantity = ethToWei(4); const burnQuantity = ethToWei(3); @@ -897,7 +897,7 @@ describe('contract MatrixToken', async () => { shouldRevertIfModuleDisabled(burn); }); - describe('addModule', async () => { + describe('addModule', () => { let module; let snapshotId; @@ -943,7 +943,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let module; let moduleMock; @@ -1021,7 +1021,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('removePendingModule', async () => { + describe('removePendingModule', () => { let module; let moduleMock; @@ -1071,7 +1071,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('setManager', async () => { + describe('setManager', () => { const testManager = testAccount.address; caller = manager; @@ -1109,7 +1109,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('initializeModule', async () => { + describe('initializeModule', () => { const module = testAccount.address; let snapshotId; @@ -1161,7 +1161,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getDefaultPositionRealUnit', async () => { + describe('getDefaultPositionRealUnit', () => { const multiplier = ethToWei(2); let snapshotId; @@ -1181,7 +1181,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getExternalPositionRealUnit', async () => { + describe('getExternalPositionRealUnit', () => { const multiplier = ethToWei(2); const externalUnitToAdd = ethToWei(9); @@ -1204,7 +1204,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getComponents', async () => { + describe('getComponents', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -1220,7 +1220,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getExternalPositionModules', async () => { + describe('getExternalPositionModules', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -1240,7 +1240,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getExternalPositionData', async () => { + describe('getExternalPositionData', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -1260,7 +1260,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('getPositions', async () => { + describe('getPositions', () => { const externalData = '0x11'; const multiplier = ethToWei(0.5); const externalRealUnit = ethToWei(-1); @@ -1325,14 +1325,14 @@ describe('contract MatrixToken', async () => { }); }); - describe('getModules', async () => { + describe('getModules', () => { it('should return the correct modules', async () => { const result = await matrixToken.getModules(); expect(compareArray(result, modules)).is.true; }); }); - describe('getTotalComponentRealUnits', async () => { + describe('getTotalComponentRealUnits', () => { const externalRealUnit1 = ethToWei(6); const externalRealUnit2 = ethToWei(-1); @@ -1360,7 +1360,7 @@ describe('contract MatrixToken', async () => { }); }); - describe('isInitializedModule', async () => { + describe('isInitializedModule', () => { it('should return ture if module is initialized', async () => { const result = await matrixToken.isInitializedModule(modules[0]); expect(result).is.true; diff --git a/test/protocol/matrixTokenFactory.test.js b/test/protocol/matrixTokenFactory.test.js index 811ef2c..15bc443 100644 --- a/test/protocol/matrixTokenFactory.test.js +++ b/test/protocol/matrixTokenFactory.test.js @@ -12,7 +12,7 @@ const { getCreatedMatrixTokenAddress } = require('../helpers/protocolUtil'); const { ZERO_ADDRESS, ZERO, PRECISE_UNIT } = require('../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); -describe('contract MatrixTokenFactory', async () => { +describe('contract MatrixTokenFactory', () => { const [owner, feeRecipient] = getSigners(); let controller; @@ -31,14 +31,14 @@ describe('contract MatrixTokenFactory', async () => { revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should have the correct controller', async () => { const result = await factoryMock.getController(); expect(result).eq(controller.address); }); }); - describe('create', async () => { + describe('create', () => { let firstComponent; let secondComponent; let firstModule; diff --git a/test/protocol/matrixValuer.test.js b/test/protocol/matrixValuer.test.js index 6077429..ced9309 100644 --- a/test/protocol/matrixValuer.test.js +++ b/test/protocol/matrixValuer.test.js @@ -13,7 +13,7 @@ const { preciseMul, preciseDiv } = require('../helpers/mathUtil'); const { snapshotBlockchain, revertBlockchain } = require('../helpers/evmUtil.js'); const { ETH_USD_PRICE, USD_USD_PRICE, SystemFixture } = require('../fixtures/systemFixture'); -describe('contract MatrixValuer', async () => { +describe('contract MatrixValuer', () => { const [owner, feeRecipient, moduleOne] = getSigners(); const units = [usdToWei(100), ethToWei(1)]; // 100 USDC at $1 and 1 WETH at $230 const baseUnits = [usdToWei(1), ethToWei(1)]; // Base units of USDC and WETH @@ -38,14 +38,14 @@ describe('contract MatrixValuer', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should have the correct controller address', async () => { const result = await systemFixture.matrixValuer.getController(); expect(result).eq(systemFixture.controller.address); }); }); - describe('calculateMatrixTokenValuation', async () => { + describe('calculateMatrixTokenValuation', () => { let quoteAsset; beforeEach(async () => { diff --git a/test/protocol/modules/aaveLeverageModule.test.js b/test/protocol/modules/aaveLeverageModule.test.js index f3012ba..d3a584f 100644 --- a/test/protocol/modules/aaveLeverageModule.test.js +++ b/test/protocol/modules/aaveLeverageModule.test.js @@ -19,8 +19,8 @@ const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil. const { deployContract, deployContractAndLinkLibraries } = require('../../helpers/deploy'); const { ZERO, ZERO_ADDRESS, EMPTY_BYTES, MAX_UINT_256 } = require('../../helpers/constants'); -describe('contract AaveLeverageModule', async () => { - const [owner, protocolFeeRecipient, mockModule, randomAccount] = await getSigners(); +describe('contract AaveLeverageModule', () => { + const [owner, protocolFeeRecipient, mockModule, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; const aaveV2Fixture = new AaveV2Fixture(owner); @@ -185,7 +185,7 @@ describe('contract AaveLeverageModule', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should set the correct controller', async () => { const controller = await aaveLeverageModule.getController(); expect(controller).eq(systemFixture.controller.address); @@ -210,7 +210,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('initialize', async () => { + describe('initialize', () => { let caller; let isAllowed; let matrixToken; @@ -289,7 +289,7 @@ describe('contract AaveLeverageModule', async () => { expect(isRegistered).is.true; }); - describe('when debt issuance module is not added to integration registry', async () => { + describe('when debt issuance module is not added to integration registry', () => { beforeEach(async () => { await systemFixture.integrationRegistry.removeIntegration(aaveLeverageModule.address, 'DEFAULT_ISSUANCE_MODULE'); }); @@ -304,7 +304,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when debt issuance module is not initialized on MatrixToken', async () => { + describe('when debt issuance module is not initialized on MatrixToken', () => { beforeEach(async () => { await matrixToken.removeModule(debtIssuanceMock.address); }); @@ -340,7 +340,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when isAllowed is false', async () => { + describe('when isAllowed is false', () => { beforeEach(async () => { isAllowed = false; await initContracts(); @@ -360,7 +360,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('lever', async () => { + describe('lever', () => { const destTokenQuantity = ethToWei(1); const minCollateralQuantity = ethToWei(1); @@ -447,7 +447,7 @@ describe('contract AaveLeverageModule', async () => { .lever(matrixTokenAddress, borrowAsset, collateralAsset, borrowQuantity, minCollateralQuantity, tradeAdapterName, tradeData); } - describe('when module is initialized', async () => { + describe('when module is initialized', () => { beforeEach(async () => { notInitialized = true; await initContracts(); @@ -540,7 +540,7 @@ describe('contract AaveLeverageModule', async () => { await expect(lever()).revertedWith('M1b'); }); - describe('when the leverage position has been liquidated', async () => { + describe('when the leverage position has been liquidated', () => { const ethSeized = ethToWei(1); beforeEach(async () => { @@ -613,7 +613,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when there is a protocol fee charged', async () => { + describe('when there is a protocol fee charged', () => { const feePercentage = ethToWei(0.05); beforeEach(async () => { @@ -723,7 +723,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -850,7 +850,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('delever', async () => { + describe('delever', () => { let redeemQuantity; let caller; @@ -975,7 +975,7 @@ describe('contract AaveLeverageModule', async () => { .delever(matrixTokenAddress, collateralAsset, repayAsset, redeemQuantity, minRepayQuantity, tradeAdapterName, tradeData); } - describe('when module is initialized', async () => { + describe('when module is initialized', () => { beforeEach(async () => { notInitialized = true; await initContracts(); @@ -1068,7 +1068,7 @@ describe('contract AaveLeverageModule', async () => { await expect(delever()).revertedWith('M1b'); }); - describe('when there is a protocol fee charged', async () => { + describe('when there is a protocol fee charged', () => { let feePercentage; beforeEach(async () => { @@ -1148,7 +1148,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when used to delever to zero', async () => { + describe('when used to delever to zero', () => { beforeEach(async () => { minRepayQuantity = ethToWei(1001); await oneInchExchangeMockFromWeth.updateReceiveAmount(minRepayQuantity); @@ -1218,7 +1218,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -1231,7 +1231,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('deleverToZeroBorrowBalance', async () => { + describe('deleverToZeroBorrowBalance', () => { const uniswapFixture = new UniswapFixture(owner); let caller; @@ -1356,7 +1356,7 @@ describe('contract AaveLeverageModule', async () => { .deleverToZeroBorrowBalance(matrixTokenAddress, collateralAsset, repayAsset, redeemQuantity, tradeAdapterName, tradeData); } - describe('when module is initialized', async () => { + describe('when module is initialized', () => { beforeEach(async () => { notInitialized = true; await initContracts(); @@ -1471,7 +1471,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -1484,7 +1484,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('sync', async () => { + describe('sync', () => { let caller; let matrixToken; let notInitialized; @@ -1602,7 +1602,7 @@ describe('contract AaveLeverageModule', async () => { } }; - describe('when module is initialized', async () => { + describe('when module is initialized', () => { beforeEach(async () => { notInitialized = true; await initContracts(); @@ -1661,7 +1661,7 @@ describe('contract AaveLeverageModule', async () => { expect(newFourthPosition.unit).eq(expectedFourthPositionUnit); }); - describe('when leverage position has been liquidated', async () => { + describe('when leverage position has been liquidated', () => { let liquidationRepayQuantity; beforeEach(async () => { @@ -1763,7 +1763,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { it('should revert when module is not initialized', async () => { notInitialized = false; await expect(sync()).revertedWith('M3'); @@ -1771,7 +1771,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when MatrixToken total supply is 0', async () => { + describe('when MatrixToken total supply is 0', () => { async function initContracts() { matrixToken = await systemFixture.createMatrixToken( [aWETH.address, aDAI.address], @@ -1818,7 +1818,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('addCollateralAssets', async () => { + describe('addCollateralAssets', () => { let caller; let matrixToken; let notInitialized; @@ -1893,7 +1893,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when re-adding a removed collateral asset', async () => { + describe('when re-adding a removed collateral asset', () => { beforeEach(async () => { // Mint aTokens await systemFixture.weth.approve(aaveV2Fixture.lendingPool.address, ethToWei(1000)); @@ -1928,7 +1928,7 @@ describe('contract AaveLeverageModule', async () => { await expect(addCollateralAssets()).revertedWith('L12a'); }); - describe('when a new Aave reserve is added as collateral', async () => { + describe('when a new Aave reserve is added as collateral', () => { beforeEach(async () => { // Create a new reserve await aaveV2Fixture.createAndEnableReserve( @@ -1966,7 +1966,7 @@ describe('contract AaveLeverageModule', async () => { await expect(addCollateralAssets()).revertedWith('L12c'); }); - describe('when collateral asset reserve is frozen on Aave', async () => { + describe('when collateral asset reserve is frozen on Aave', () => { beforeEach(async () => { await aaveV2Fixture.lendingPoolConfigurator.connect(owner).freezeReserve(systemFixture.dai.address); }); @@ -2005,7 +2005,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -2018,7 +2018,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('addBorrowAssets', async () => { + describe('addBorrowAssets', () => { let caller; let matrixToken; let borrowAssets; @@ -2114,7 +2114,7 @@ describe('contract AaveLeverageModule', async () => { await expect(addBorrowAssets()).revertedWith('M1a'); }); - describe('when borrow asset reserve is frozen on Aave', async () => { + describe('when borrow asset reserve is frozen on Aave', () => { beforeEach(async () => { await aaveV2Fixture.lendingPoolConfigurator.connect(owner).freezeReserve(systemFixture.dai.address); }); @@ -2128,7 +2128,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when a new Aave reserve is added as borrow', async () => { + describe('when a new Aave reserve is added as borrow', () => { beforeEach(async () => { // Create a new reserve await aaveV2Fixture.createAndEnableReserve( @@ -2162,7 +2162,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -2175,7 +2175,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('registerToModule', async () => { + describe('registerToModule', () => { let matrixToken; let notInitialized; let matrixTokenAddress; @@ -2254,7 +2254,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -2267,7 +2267,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('moduleIssueHook', async () => { + describe('moduleIssueHook', () => { let caller; let matrixToken; let notInitialized; @@ -2453,7 +2453,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('moduleRedeemHook', async () => { + describe('moduleRedeemHook', () => { let caller; let matrixToken; let notInitialized; @@ -2639,7 +2639,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('componentIssueHook', async () => { + describe('componentIssueHook', () => { const issueQuantity = ethToWei(1); let caller; @@ -2775,7 +2775,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('componentRedeemHook', async () => { + describe('componentRedeemHook', () => { const issueQuantity = ethToWei(1); let caller; @@ -2917,7 +2917,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let module; let matrixToken; @@ -3022,7 +3022,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('removeCollateralAssets', async () => { + describe('removeCollateralAssets', () => { let caller; let matrixToken; let notInitialized; @@ -3097,7 +3097,7 @@ describe('contract AaveLeverageModule', async () => { await expect(removeCollateralAssets()).revertedWith('M1a'); }); - describe('when removing a collateral asset which has been enabled to be used as collateral on aave', async () => { + describe('when removing a collateral asset which has been enabled to be used as collateral on aave', () => { beforeEach(async () => { // Mint aTokens await systemFixture.weth.approve(aaveV2Fixture.lendingPool.address, ethToWei(1000)); @@ -3125,7 +3125,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -3138,7 +3138,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('removeBorrowAssets', async () => { + describe('removeBorrowAssets', () => { let caller; let matrixToken; let borrowAssets; @@ -3219,7 +3219,7 @@ describe('contract AaveLeverageModule', async () => { await expect(removeBorrowAssets()).revertedWith('L6a'); }); - describe('when borrow balance exists', async () => { + describe('when borrow balance exists', () => { beforeEach(async () => { // Add MatrixToken as token sender / recipient await oneInchExchangeMockToWeth.connect(owner).addMatrixTokenAddress(matrixToken.address); @@ -3263,7 +3263,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { beforeEach(async () => { notInitialized = false; await initContracts(); @@ -3276,7 +3276,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('updateAllowedMatrixToken', async () => { + describe('updateAllowedMatrixToken', () => { let caller; let status; let matrixToken; @@ -3315,7 +3315,7 @@ describe('contract AaveLeverageModule', async () => { await expect(updateAllowedMatrixToken()).emit(aaveLeverageModule, 'UpdateMatrixTokenStatus').withArgs(matrixTokenAddress, status); }); - describe('when disabling a MatrixToken', async () => { + describe('when disabling a MatrixToken', () => { beforeEach(async () => { await updateAllowedMatrixToken(); status = false; @@ -3348,7 +3348,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('updateAnyMatrixAllowed', async () => { + describe('updateAnyMatrixAllowed', () => { let caller; let isAnyMatrixAllowed; @@ -3383,7 +3383,7 @@ describe('contract AaveLeverageModule', async () => { }); }); - describe('addUnderlyingToReserveTokensMappings', async () => { + describe('addUnderlyingToReserveTokensMappings', () => { let caller; let underlying; let usdcReserveTokens; // ReserveTokens diff --git a/test/protocol/modules/airdropModule.test.js b/test/protocol/modules/airdropModule.test.js index 0510409..1411960 100644 --- a/test/protocol/modules/airdropModule.test.js +++ b/test/protocol/modules/airdropModule.test.js @@ -15,8 +15,8 @@ const { getSigners, getRandomAddress } = require('../../helpers/accountUtil'); const { ZERO, ZERO_ADDRESS, PRECISE_UNIT } = require('../../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); -describe('contract AirdropModule', async () => { - const [owner, protocolFeeRecipient, feeRecipient, tokenHolder] = await getSigners(); +describe('contract AirdropModule', () => { + const [owner, protocolFeeRecipient, feeRecipient, tokenHolder] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -39,7 +39,7 @@ describe('contract AirdropModule', async () => { await revertBlockchain(snapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let airdrops; let airdropFee; let anyoneAbsorb; @@ -98,7 +98,7 @@ describe('contract AirdropModule', async () => { expect(usdcIsAirdrop).is.true; }); - describe('when the airdrops array is empty', async () => { + describe('when the airdrops array is empty', () => { before(async () => { airdrops = []; }); @@ -114,7 +114,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when there are duplicate components in the airdrops array', async () => { + describe('when there are duplicate components in the airdrops array', () => { before(async () => { airdrops = [systemFixture.weth.address, systemFixture.weth.address]; }); @@ -128,7 +128,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when the airdrop fee is greater than 100%', async () => { + describe('when the airdrop fee is greater than 100%', () => { before(async () => { airdropFee = ethToWei(1.01); }); @@ -142,7 +142,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when the fee recipient is the ZERO_ADDRESS', async () => { + describe('when the fee recipient is the ZERO_ADDRESS', () => { before(async () => { airdropFeeRecipient = ZERO_ADDRESS; }); @@ -179,7 +179,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('absorb', async () => { + describe('absorb', () => { let token; let airdrops; let airdropFee; @@ -292,7 +292,7 @@ describe('contract AirdropModule', async () => { .withArgs(matrixToken.address, systemFixture.usdc.address, airdroppedTokens, expectedManagerTake, expectedProtocolTake); }); - describe('when protocolFee is 0 but airdropFee > 0', async () => { + describe('when protocolFee is 0 but airdropFee > 0', () => { before(async () => { protocolFee = ZERO; }); @@ -337,7 +337,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when airdropFee is 0', async () => { + describe('when airdropFee is 0', () => { before(async () => { airdropFee = ZERO; }); @@ -375,7 +375,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when anyoneAbsorb is false and the caller is the MatrixToken manager', async () => { + describe('when anyoneAbsorb is false and the caller is the MatrixToken manager', () => { before(async () => { anyoneAbsorb = false; }); @@ -400,7 +400,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when anyoneAbsorb is false and the caller is not the MatrixToken manager', async () => { + describe('when anyoneAbsorb is false and the caller is not the MatrixToken manager', () => { before(async () => { anyoneAbsorb = false; }); @@ -419,7 +419,7 @@ describe('contract AirdropModule', async () => { await expect(absorb()).revertedWith('AD3'); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -442,7 +442,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('batchAbsorb', async () => { + describe('batchAbsorb', () => { let tokens; let airdrops; let airdropFee; @@ -616,7 +616,7 @@ describe('contract AirdropModule', async () => { .withArgs(matrixToken.address, systemFixture.weth.address, airdroppedTokens, expectedManagerTake, expectedProtocolTake); }); - describe('when protocolFee is 0 but airdropFee > 0', async () => { + describe('when protocolFee is 0 but airdropFee > 0', () => { before(async () => { protocolFee = ZERO; }); @@ -699,7 +699,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when airdropFee is 0', async () => { + describe('when airdropFee is 0', () => { before(async () => { airdropFee = ZERO; }); @@ -766,7 +766,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when anyoneAbsorb is false and the caller is the MatrixToken manager', async () => { + describe('when anyoneAbsorb is false and the caller is the MatrixToken manager', () => { before(async () => { anyoneAbsorb = false; }); @@ -814,7 +814,7 @@ describe('contract AirdropModule', async () => { await expect(batchAbsorb()).revertedWith('AD3'); }); - describe('when anyoneAbsorb is false and the caller is not the MatrixToken manager', async () => { + describe('when anyoneAbsorb is false and the caller is not the MatrixToken manager', () => { before(async () => { anyoneAbsorb = false; }); @@ -828,7 +828,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -851,7 +851,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let module; let snapshotId; @@ -896,7 +896,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('addAirdrop and removeAirdrop', async () => { + describe('addAirdrop and removeAirdrop', () => { let notInitialized; let airdropTokenAddress; @@ -926,7 +926,7 @@ describe('contract AirdropModule', async () => { await revertBlockchain(snapshotId); }); - describe('addAirdrop', async () => { + describe('addAirdrop', () => { beforeEach(async () => { caller = owner; airdropTokenAddress = systemFixture.wbtc.address; @@ -964,7 +964,7 @@ describe('contract AirdropModule', async () => { await expect(addAirdrop()).revertedWith('M1b'); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -979,7 +979,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('removeAirdrop', async () => { + describe('removeAirdrop', () => { beforeEach(async () => { caller = owner; airdropTokenAddress = systemFixture.usdc.address; @@ -1017,7 +1017,7 @@ describe('contract AirdropModule', async () => { await expect(removeAirdrop()).revertedWith('M1b'); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -1033,7 +1033,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('updateAirdropFee', async () => { + describe('updateAirdropFee', () => { let newFee; let airdrops; let airdropFee; @@ -1119,7 +1119,7 @@ describe('contract AirdropModule', async () => { await expect(updateAirdropFee()).revertedWith('AD1'); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -1140,7 +1140,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('updateAnyoneAbsorb', async () => { + describe('updateAnyoneAbsorb', () => { let notInitialized; let isAnyoneAbsorb; @@ -1187,7 +1187,7 @@ describe('contract AirdropModule', async () => { await expect(updateAnyoneAbsorb()).emit(airdropModule, 'UpdateAnyoneAbsorb').withArgs(matrixTokenAddress, isAnyoneAbsorb); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -1208,7 +1208,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('updateFeeRecipient', async () => { + describe('updateFeeRecipient', () => { let notInitialized; let newFeeRecipient; @@ -1260,7 +1260,7 @@ describe('contract AirdropModule', async () => { await expect(updateFeeRecipient()).revertedWith('AD0'); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -1281,7 +1281,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('getAirdrops', async () => { + describe('getAirdrops', () => { let airdrops; let snapshotId; @@ -1312,7 +1312,7 @@ describe('contract AirdropModule', async () => { }); }); - describe('isAirdrop', async () => { + describe('isAirdrop', () => { let token; let snapshotId; diff --git a/test/protocol/modules/basicIssuanceModule.test.js b/test/protocol/modules/basicIssuanceModule.test.js index eecc299..0086edd 100644 --- a/test/protocol/modules/basicIssuanceModule.test.js +++ b/test/protocol/modules/basicIssuanceModule.test.js @@ -14,8 +14,8 @@ const { getSigners, getRandomAddress } = require('../../helpers/accountUtil'); const { ZERO_ADDRESS, ZERO, ONE, MODULE_STATE } = require('../../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); -describe('contract BasicIssuanceModule', async () => { - const [owner, feeRecipient, recipient, randomAccount] = await getSigners(); +describe('contract BasicIssuanceModule', () => { + const [owner, feeRecipient, recipient, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, feeRecipient); let caller; @@ -32,7 +32,7 @@ describe('contract BasicIssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let preIssueHookAddress; let snapshotId; @@ -94,13 +94,13 @@ describe('contract BasicIssuanceModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { it('should revert when remove BasicIssuanceModule', async () => { await expect(systemFixture.basicIssuanceModule.connect(owner).removeModule()).revertedWith('BI0'); }); }); - describe('issue', async () => { + describe('issue', () => { const units = [ethToWei(1), btcToWei(2)]; let components; @@ -268,7 +268,7 @@ describe('contract BasicIssuanceModule', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { const units = [ethToWei(1), btcToWei(2)]; let components; diff --git a/test/protocol/modules/debtIssuanceModule.test.js b/test/protocol/modules/debtIssuanceModule.test.js index b1f147a..5a57b40 100644 --- a/test/protocol/modules/debtIssuanceModule.test.js +++ b/test/protocol/modules/debtIssuanceModule.test.js @@ -14,8 +14,8 @@ const { preciseMul, preciseMulCeilUint } = require('../../helpers/mathUtil'); const { getSigners, getRandomAddress } = require('../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); -describe('contract DebtIssuanceModule', async () => { - const [owner, manager, protocolFeeRecipient, feeRecipient, recipient, dummyModule, randomAccount] = await getSigners(); +describe('contract DebtIssuanceModule', () => { + const [owner, manager, protocolFeeRecipient, feeRecipient, recipient, dummyModule, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -51,7 +51,7 @@ describe('contract DebtIssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let maxManagerFee; let managerIssueFee; let managerRedeemFee; @@ -148,7 +148,7 @@ describe('contract DebtIssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('removeModule', async () => { + describe('removeModule', () => { let testModule; beforeEach(async () => { @@ -177,7 +177,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('registerToIssuanceModule', async () => { + describe('registerToIssuanceModule', () => { beforeEach(async () => { caller = dummyModule; matrixTokenAddress = matrixToken.address; @@ -202,7 +202,7 @@ describe('contract DebtIssuanceModule', async () => { expect(isModuleHook).is.true; }); - describe('when DebtIssuanceModule is not initialized', async () => { + describe('when DebtIssuanceModule is not initialized', () => { before(async () => { isInitialized = true; }); @@ -222,7 +222,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('unregisterFromIssuanceModule', async () => { + describe('unregisterFromIssuanceModule', () => { let isRegistered = false; beforeEach(async () => { @@ -254,7 +254,7 @@ describe('contract DebtIssuanceModule', async () => { expect(isModuleHook).is.false; }); - describe('when calling module is not registered', async () => { + describe('when calling module is not registered', () => { before(async () => { isRegistered = true; }); @@ -274,7 +274,7 @@ describe('contract DebtIssuanceModule', async () => { await debtModuleMock.connect(manager).initialize(matrixToken.address); }); - describe('getRequiredComponentIssuanceUnits', async () => { + describe('getRequiredComponentIssuanceUnits', () => { const debtUnits = ethToWei(100); let issueQuantity; @@ -343,7 +343,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('getRequiredComponentRedemptionUnits', async () => { + describe('getRequiredComponentRedemptionUnits', () => { let redeemQuantity; const debtUnits = ethToWei(100); @@ -414,7 +414,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('issue', async () => { + describe('issue', () => { const debtUnits = ethToWei(100); let to; @@ -505,7 +505,7 @@ describe('contract DebtIssuanceModule', async () => { await expect(issue()).revertedWith('M3'); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -550,7 +550,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('when the manager issuance fee is 0', async () => { + describe('when the manager issuance fee is 0', () => { before(async () => { issueFee = ZERO; }); @@ -596,7 +596,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('when protocol fees are enabled', async () => { + describe('when protocol fees are enabled', () => { const protocolFee = ethToWei(0.2); beforeEach(async () => { @@ -623,7 +623,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('when manager issuance hook is defined', async () => { + describe('when manager issuance hook is defined', () => { before(async () => { preIssueHook = managerIssuanceHookMock.address; }); @@ -640,7 +640,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { const debtUnits = ethToWei(100); let to; @@ -735,7 +735,7 @@ describe('contract DebtIssuanceModule', async () => { await expect(redeem()).revertedWith('M3'); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -780,7 +780,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('when the manager redemption fee is 0', async () => { + describe('when the manager redemption fee is 0', () => { before(async () => { redeemFee = ZERO; }); @@ -826,7 +826,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('when protocol fees are enabled', async () => { + describe('when protocol fees are enabled', () => { const protocolFee = ethToWei(0.2); beforeEach(async () => { @@ -854,7 +854,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('updateFeeRecipient', async () => { + describe('updateFeeRecipient', () => { let newFeeRecipient; beforeEach(async () => { @@ -900,7 +900,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('updateIssueFee', async () => { + describe('updateIssueFee', () => { let newIssueFee; beforeEach(async () => { @@ -945,7 +945,7 @@ describe('contract DebtIssuanceModule', async () => { }); }); - describe('updateRedeemFee', async () => { + describe('updateRedeemFee', () => { let newRedeemFee; beforeEach(async () => { diff --git a/test/protocol/modules/debtIssuanceModuleV2.test.js b/test/protocol/modules/debtIssuanceModuleV2.test.js index 9ec524f..dc2f16c 100644 --- a/test/protocol/modules/debtIssuanceModuleV2.test.js +++ b/test/protocol/modules/debtIssuanceModuleV2.test.js @@ -14,8 +14,8 @@ const { ZERO, ONE, ZERO_ADDRESS } = require('../../helpers/constants'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); const { preciseMul, preciseDiv, preciseMulCeilUint } = require('../../helpers/mathUtil'); -describe('contract DebtIssuanceModuleV2', async () => { - const [owner, manager, protocolFeeRecipient, feeRecipient, recipient] = await getSigners(); +describe('contract DebtIssuanceModuleV2', () => { + const [owner, manager, protocolFeeRecipient, feeRecipient, recipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -87,7 +87,7 @@ describe('contract DebtIssuanceModuleV2', async () => { // This is to ensure the DebtIssuanceModuleV2 behaves exactly similar to DebtIssuanceModule // when there is no rounding error present in it's constituent components. - describe('issue', async () => { + describe('issue', () => { const debtUnits = ethToWei(100); let to; @@ -175,7 +175,7 @@ describe('contract DebtIssuanceModuleV2', async () => { await expect(issue()).revertedWith('M3'); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -220,7 +220,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('when the manager issuance fee is 0', async () => { + describe('when the manager issuance fee is 0', () => { before(async () => { issueFee = ZERO; }); @@ -288,7 +288,7 @@ describe('contract DebtIssuanceModuleV2', async () => { expect(newBalanceOfProtocol.sub(oldBalanceOfProtocol)).eq(protocolSplit); }); - describe('when manager issuance hook is defined', async () => { + describe('when manager issuance hook is defined', () => { before(async () => { preIssueHook = managerIssuanceHookMock.address; }); @@ -305,7 +305,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { const debtUnits = ethToWei(100); let to; @@ -386,7 +386,7 @@ describe('contract DebtIssuanceModuleV2', async () => { await expect(redeem()).emit(debtIssuanceModuleV2, 'RedeemMatrixToken').withArgs(matrixToken.address, caller.address, to, quantity, feeQuantity, ZERO); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -431,7 +431,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('when the manager redemption fee is 0', async () => { + describe('when the manager redemption fee is 0', () => { before(async () => { redeemFee = ZERO; }); @@ -511,7 +511,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('getRequiredComponentIssuanceUnits', async () => { + describe('getRequiredComponentIssuanceUnits', () => { const debtUnits = ethToWei(100); beforeEach(async () => { @@ -588,7 +588,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); context('when MatrixToken components do have rounding errors', async () => { - describe('issue', async () => { + describe('issue', () => { const debtUnits = ethToWei(100); let to; @@ -610,7 +610,7 @@ describe('contract DebtIssuanceModuleV2', async () => { return debtIssuanceModuleV2.connect(caller).issue(matrixTokenAddress, quantity, to); } - describe('when rounding error is negative one', async () => { + describe('when rounding error is negative one', () => { beforeEach(async () => { await errorErc20.setError(-1); }); @@ -637,7 +637,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('when rounding error is positive one', async () => { + describe('when rounding error is positive one', () => { beforeEach(async () => { await errorErc20.setError(ONE); }); @@ -676,7 +676,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { const debtUnits = ethToWei(100); let to; @@ -702,7 +702,7 @@ describe('contract DebtIssuanceModuleV2', async () => { return debtIssuanceModuleV2.connect(caller).redeem(matrixTokenAddress, quantity, to); } - describe('when rounding error is negative one', async () => { + describe('when rounding error is negative one', () => { beforeEach(async () => { await errorErc20.setError(-1); }); @@ -729,7 +729,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('when rounding error is positive one', async () => { + describe('when rounding error is positive one', () => { beforeEach(async () => { await errorErc20.setError(ONE); }); @@ -768,7 +768,7 @@ describe('contract DebtIssuanceModuleV2', async () => { }); }); - describe('getRequiredComponentIssuanceUnits', async () => { + describe('getRequiredComponentIssuanceUnits', () => { const debtUnits = ethToWei(100); const accruedBalance = ethToWei(0.00001); @@ -842,7 +842,7 @@ describe('contract DebtIssuanceModuleV2', async () => { expect(JSON.stringify(expectedDebtFlows)).eq(JSON.stringify(totalDebtUnits)); }); - describe('when tokens have been issued', async () => { + describe('when tokens have been issued', () => { beforeEach(async () => { const { totalEquityUnits } = await debtIssuanceModuleV2.getRequiredComponentIssuanceUnits(matrixToken.address, ethToWei(1)); await errorErc20.approve(debtIssuanceModuleV2.address, totalEquityUnits[0].mul(ethToWei(1.005))); diff --git a/test/protocol/modules/issuanceModule.test.js b/test/protocol/modules/issuanceModule.test.js index 6daeb28..ce5003c 100644 --- a/test/protocol/modules/issuanceModule.test.js +++ b/test/protocol/modules/issuanceModule.test.js @@ -14,8 +14,8 @@ const { ZERO, ONE, ZERO_ADDRESS } = require('../../helpers/constants'); const { getSigners, getRandomAddress } = require('../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); -describe('contract IssuanceModule', async () => { - const [owner, protocolFeeRecipient, recipient, randomAccount] = await getSigners(); +describe('contract IssuanceModule', () => { + const [owner, protocolFeeRecipient, recipient, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); let caller; @@ -42,7 +42,7 @@ describe('contract IssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let snapshotId; beforeEach(async () => { snapshotId = await snapshotBlockchain(); @@ -93,14 +93,14 @@ describe('contract IssuanceModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { it('should revert when removeModule', async () => { caller = owner; await expect(issuanceModule.connect(caller).removeModule()).revertedWith('IM2'); }); }); - describe('issue', async () => { + describe('issue', () => { let issueQuantity; let snapshotId; @@ -229,7 +229,7 @@ describe('contract IssuanceModule', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { let to; let redeemQuantity; diff --git a/test/protocol/modules/navIssuanceModule.test.js b/test/protocol/modules/navIssuanceModule.test.js index 0814aa3..bd432c0 100644 --- a/test/protocol/modules/navIssuanceModule.test.js +++ b/test/protocol/modules/navIssuanceModule.test.js @@ -43,8 +43,8 @@ async function reconcileBalances(matrixToken, testFun, signer) { } } -describe('contract NavIssuanceModule', async () => { - const [owner, protocolFeeRecipient, feeRecipient, recipient, randomAccount] = await getSigners(); +describe('contract NavIssuanceModule', () => { + const [owner, protocolFeeRecipient, feeRecipient, recipient, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -62,7 +62,7 @@ describe('contract NavIssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should set the correct controller', async () => { const controller = await systemFixture.navIssuanceModule.getController(); expect(controller).eq(systemFixture.controller.address); @@ -74,7 +74,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('initialize', async () => { + describe('initialize', () => { const managerFees = [ethToWei(0.001), ethToWei(0.002)]; // Set manager issue fee to 0.1% and redeem to 0.2% const maxManagerFee = ethToWei(0.02); // Set max managerFee to 2% const premiumPercentage = ethToWei(0.01); // Set premium to 1% @@ -232,7 +232,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -305,7 +305,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getReserveAssets', async () => { + describe('getReserveAssets', () => { let reserveAssets; let snapshotId; @@ -349,7 +349,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getIssuePremium', async () => { + describe('getIssuePremium', () => { let premiumPercentage; let snapshotId; @@ -394,7 +394,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getRedeemPremium', async () => { + describe('getRedeemPremium', () => { let premiumPercentage; let snapshotId; @@ -439,7 +439,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getManagerFee', async () => { + describe('getManagerFee', () => { let managerFees; let snapshotId; @@ -482,7 +482,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getExpectedMatrixTokenIssueQuantity', async () => { + describe('getExpectedMatrixTokenIssueQuantity', () => { let managerFees; let protocolDirectFee; let premiumPercentage; @@ -547,7 +547,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('getExpectedReserveRedeemQuantity', async () => { + describe('getExpectedReserveRedeemQuantity', () => { let managerFees; let protocolDirectFee; let premiumPercentage; @@ -620,7 +620,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('isIssueValid', async () => { + describe('isIssueValid', () => { let reserveAsset; let reserveQuantity; @@ -702,7 +702,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('isRedeemValid', async () => { + describe('isRedeemValid', () => { let reserveAsset; let matrixTokenQuantity; @@ -800,7 +800,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('issue', async () => { + describe('issue', () => { const units = [ethToWei(1), usdToWei(270), btcToWei(1).div(10), ethToWei(600)]; // Valued at 2000 USDC let reserveAsset; @@ -987,7 +987,7 @@ describe('contract NavIssuanceModule', async () => { await expect(issue()).revertedWith('M3'); }); - describe('case 1.1: when the issue quantity is extremely small', async () => { + describe('case 1.1: when the issue quantity is extremely small', () => { beforeEach(async () => { reserveQuantity = ONE; }); @@ -1053,7 +1053,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('case 1.2: when a MatrixToken position is not in default state', async () => { + describe('case 1.2: when a MatrixToken position is not in default state', () => { beforeEach(async () => { // Add self as module and update the position state await systemFixture.controller.addModule(owner.address); @@ -1241,7 +1241,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('issueWithEther', async () => { + describe('issueWithEther', () => { const units = [ethToWei(1), usdToWei(270), btcToWei(1).div(10), ethToWei(600)]; // Valued at 2000 USDC let minMatrixTokenReceived; @@ -1421,7 +1421,7 @@ describe('contract NavIssuanceModule', async () => { await expect(issueWithEther()).revertedWith('M3'); }); - describe('case 1.1: when a MatrixToken position is not in default state', async () => { + describe('case 1.1: when a MatrixToken position is not in default state', () => { beforeEach(async () => { // Add self as module and update the position state await systemFixture.controller.addModule(owner.address); @@ -1590,7 +1590,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('redeem', async () => { + describe('redeem', () => { const units = [ethToWei(1), usdToWei(570), btcToWei(1).div(10), ethToWei(300)]; // Valued at 2000 USDC let reserveAsset; @@ -1801,7 +1801,7 @@ describe('contract NavIssuanceModule', async () => { await expect(redeem()).revertedWith('M3'); }); - describe('case 1.1: when the redeem quantity is extremely small', async () => { + describe('case 1.1: when the redeem quantity is extremely small', () => { beforeEach(async () => { matrixTokenQuantity = ONE; }); @@ -1871,7 +1871,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('case 1.2: when a MatrixToken position is not in default state', async () => { + describe('case 1.2: when a MatrixToken position is not in default state', () => { beforeEach(async () => { // Add self as module and update the position state await systemFixture.controller.addModule(owner.address); @@ -2075,7 +2075,7 @@ describe('contract NavIssuanceModule', async () => { }); }); - describe('redeemIntoEther', async () => { + describe('redeemIntoEther', () => { const units = [ethToWei(1), usdToWei(270), btcToWei(1).div(10), ethToWei(600)]; // Valued at 2000 USDC let matrixToken; @@ -2477,7 +2477,7 @@ describe('contract NavIssuanceModule', async () => { revertBlockchain(snapshotId); }); - describe('addReserveAsset', async () => { + describe('addReserveAsset', () => { let reserveAsset; beforeEach(async () => { @@ -2512,7 +2512,7 @@ describe('contract NavIssuanceModule', async () => { shouldRevertIfModuleDisabled(addReserveAsset); }); - describe('removeReserveAsset', async () => { + describe('removeReserveAsset', () => { let reserveAsset; beforeEach(async () => { @@ -2548,7 +2548,7 @@ describe('contract NavIssuanceModule', async () => { shouldRevertIfModuleDisabled(removeReserveAsset); }); - describe('editPremium', async () => { + describe('editPremium', () => { let premium; beforeEach(async () => { @@ -2581,7 +2581,7 @@ describe('contract NavIssuanceModule', async () => { shouldRevertIfModuleDisabled(editPremium); }); - describe('editManagerFee', async () => { + describe('editManagerFee', () => { let managerFee; let feeIndex; @@ -2624,7 +2624,7 @@ describe('contract NavIssuanceModule', async () => { shouldRevertIfModuleDisabled(editManagerFee); }); - describe('editFeeRecipient', async () => { + describe('editFeeRecipient', () => { let feeRecipientAddress; beforeEach(async () => { diff --git a/test/protocol/modules/slippageIssuanceModule.test.js b/test/protocol/modules/slippageIssuanceModule.test.js index 3f69632..26d9e5f 100644 --- a/test/protocol/modules/slippageIssuanceModule.test.js +++ b/test/protocol/modules/slippageIssuanceModule.test.js @@ -14,8 +14,8 @@ const { ethToWei, btcToWei, usdToWei } = require('../../helpers/unitUtil'); const { preciseMul, preciseMulCeilUint } = require('../../helpers/mathUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); -describe('contract SlippageIssuanceModule', async () => { - const [owner, manager, protocolFeeRecipient, feeRecipient, recipient] = await getSigners(); +describe('contract SlippageIssuanceModule', () => { + const [owner, manager, protocolFeeRecipient, feeRecipient, recipient] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const protocolFeeRecipientAddress = protocolFeeRecipient.address; @@ -79,7 +79,7 @@ describe('contract SlippageIssuanceModule', async () => { await revertBlockchain(snapshotId); }); - describe('getRequiredComponentIssuanceUnitsOffChain', async () => { + describe('getRequiredComponentIssuanceUnitsOffChain', () => { const debtUnits = ethToWei(100); let issueQuantity; @@ -149,7 +149,7 @@ describe('contract SlippageIssuanceModule', async () => { expect(JSON.stringify(expectedDebtFlows)).eq(JSON.stringify(totalDebtUnits)); }); - describe('when positional adjustments are needed to account for positions changed during issuance', async () => { + describe('when positional adjustments are needed to account for positions changed during issuance', () => { let ethIssuanceAdjustment; let daiDebtAdjustment; @@ -158,7 +158,7 @@ describe('contract SlippageIssuanceModule', async () => { await debtModuleMock.addDebtIssuanceAdjustment(systemFixture.dai.address, daiDebtAdjustment); }); - describe('when positional adjustments are positive numbers', async () => { + describe('when positional adjustments are positive numbers', () => { before(async () => { ethIssuanceAdjustment = ethToWei(0.01); daiDebtAdjustment = ethToWei(1.5); @@ -186,7 +186,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when positional adjustments are negative numbers', async () => { + describe('when positional adjustments are negative numbers', () => { before(async () => { ethIssuanceAdjustment = ethToWei(0.01).mul(-1); daiDebtAdjustment = ethToWei(1.5).mul(-1); @@ -214,7 +214,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when equity positional adjustments lead to negative results', async () => { + describe('when equity positional adjustments lead to negative results', () => { before(async () => { ethIssuanceAdjustment = ethToWei(1.1).mul(-1); }); @@ -229,7 +229,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when debt positional adjustments lead to negative results', async () => { + describe('when debt positional adjustments lead to negative results', () => { before(async () => { daiDebtAdjustment = ethToWei(101); }); @@ -246,7 +246,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('getRequiredComponentRedemptionUnitsOffChain', async () => { + describe('getRequiredComponentRedemptionUnitsOffChain', () => { const debtUnits = ethToWei(100); let redeemQuantity; @@ -277,7 +277,7 @@ describe('contract SlippageIssuanceModule', async () => { expect(JSON.stringify(expectedDebtFlows)).eq(JSON.stringify(totalDebtUnits)); }); - describe('when an additive external equity position is in place', async () => { + describe('when an additive external equity position is in place', () => { const externalUnits = ethToWei(1); beforeEach(async () => { @@ -301,7 +301,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when a non-additive external equity position is in place', async () => { + describe('when a non-additive external equity position is in place', () => { const externalUnits = btcToWei(0.5); beforeEach(async () => { @@ -326,7 +326,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when positional adjustments are needed to account for positions changed during redemption', async () => { + describe('when positional adjustments are needed to account for positions changed during redemption', () => { let daiDebtAdjustment; let ethIssuanceAdjustment; @@ -335,7 +335,7 @@ describe('contract SlippageIssuanceModule', async () => { await debtModuleMock.addEquityIssuanceAdjustment(systemFixture.weth.address, ethIssuanceAdjustment); }); - describe('when positional adjustments are positive numbers', async () => { + describe('when positional adjustments are positive numbers', () => { before(async () => { daiDebtAdjustment = ethToWei(1.5); ethIssuanceAdjustment = ethToWei(0.01); @@ -358,7 +358,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when positional adjustments are negative numbers', async () => { + describe('when positional adjustments are negative numbers', () => { before(async () => { ethIssuanceAdjustment = ethToWei(0.01).mul(-1); daiDebtAdjustment = ethToWei(1.5).mul(-1); @@ -381,7 +381,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when equity positional adjustments lead to negative results', async () => { + describe('when equity positional adjustments lead to negative results', () => { before(async () => { ethIssuanceAdjustment = ethToWei(1.1).mul(-1); }); @@ -396,7 +396,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when debt positional adjustments lead to negative results', async () => { + describe('when debt positional adjustments lead to negative results', () => { before(async () => { daiDebtAdjustment = ethToWei(101); }); @@ -413,7 +413,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('issueWithSlippage', async () => { + describe('issueWithSlippage', () => { const debtUnits = ethToWei(100); let to; @@ -492,7 +492,7 @@ describe('contract SlippageIssuanceModule', async () => { .withArgs(matrixToken.address, caller.address, to, preIssueHook, issueQuantity, feeQuantity, ZERO); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -535,7 +535,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when the manager issuance fee is 0', async () => { + describe('when the manager issuance fee is 0', () => { before(async () => { issueFee = ZERO; }); @@ -601,7 +601,7 @@ describe('contract SlippageIssuanceModule', async () => { expect(newBalanceOfProtocol.sub(oldBalanceOfProtocol)).eq(protocolSplit); }); - describe('when manager issuance hook is defined', async () => { + describe('when manager issuance hook is defined', () => { before(async () => { preIssueHook = managerIssuanceHookMock.address; }); @@ -617,7 +617,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when a max token amount in is submitted', async () => { + describe('when a max token amount in is submitted', () => { beforeEach(async () => { const mintQuantity = preciseMul(issueQuantity, ethToWei(1).add(issueFee)); const expectedWethFlows = preciseMul(mintQuantity, ethToWei(1)); @@ -708,7 +708,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('redeemWithSlippage', async () => { + describe('redeemWithSlippage', () => { const debtUnits = ethToWei(100); let to; @@ -793,7 +793,7 @@ describe('contract SlippageIssuanceModule', async () => { .withArgs(matrixToken.address, caller.address, to, testRedeemQuantity, feeQuantity, ZERO); }); - describe('when an external equity position is in place', async () => { + describe('when an external equity position is in place', () => { const externalUnits = ethToWei(1); before(async () => { @@ -836,7 +836,7 @@ describe('contract SlippageIssuanceModule', async () => { }); }); - describe('when the manager redemption fee is 0', async () => { + describe('when the manager redemption fee is 0', () => { before(async () => { redeemFee = ZERO; }); @@ -902,7 +902,7 @@ describe('contract SlippageIssuanceModule', async () => { expect(newBalanceOfProtocol.sub(oldBalanceOfProtocol)).eq(protocolSplit); }); - describe('when a min token amount out is submitted', async () => { + describe('when a min token amount out is submitted', () => { beforeEach(async () => { const mintQuantity = preciseMul(testRedeemQuantity, ethToWei(1).sub(issueFee)); const expectedWethFlows = preciseMul(mintQuantity, ethToWei(1)); diff --git a/test/protocol/modules/stakingModule.test.js b/test/protocol/modules/stakingModule.test.js index 78456fe..ce71657 100644 --- a/test/protocol/modules/stakingModule.test.js +++ b/test/protocol/modules/stakingModule.test.js @@ -16,7 +16,7 @@ const { preciseMul } = require('../../helpers/mathUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); describe('contract StakingModule', async () => { - const [owner, protocolFeeRecipient, dummyIssuanceModule, randomAccount] = await getSigners(); + const [owner, protocolFeeRecipient, dummyIssuanceModule, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const STAKE_NAME1 = 'WETH_STAKER1'; const STAKE_NAME2 = 'WETH_STAKER2'; @@ -56,7 +56,7 @@ describe('contract StakingModule', async () => { await revertBlockchain(rootSnapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let caller; let matrixToken; let matrixTokenAddress; @@ -100,7 +100,7 @@ describe('contract StakingModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let module; let snapshotId; @@ -132,7 +132,7 @@ describe('contract StakingModule', async () => { }); }); - describe('stake', async () => { + describe('stake', () => { const issuedSupply = ethToWei(2); let caller; @@ -240,7 +240,7 @@ describe('contract StakingModule', async () => { await expect(stake()).revertedWith('M1b'); }); - describe('when the position is being added to', async () => { + describe('when the position is being added to', () => { beforeEach(async () => { await stake(); }); @@ -293,7 +293,7 @@ describe('contract StakingModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -308,7 +308,7 @@ describe('contract StakingModule', async () => { }); }); - describe('unstake', async () => { + describe('unstake', () => { let issuedSupply = ethToWei(2); let caller; @@ -432,7 +432,7 @@ describe('contract StakingModule', async () => { await expect(unstake()).revertedWith('M1b'); }); - describe('when the full position is not being removed', async () => { + describe('when the full position is not being removed', () => { beforeEach(async () => { componentPositionUnits = ethToWei(0.25); }); @@ -485,7 +485,7 @@ describe('contract StakingModule', async () => { }); }); - describe('when module is not initialized', async () => { + describe('when module is not initialized', () => { before(async () => { notInitialized = false; }); @@ -500,7 +500,7 @@ describe('contract StakingModule', async () => { }); }); - describe('issueHook', async () => { + describe('issueHook', () => { const tokenTransferAmount = ethToWei(0.5); let caller; @@ -574,7 +574,7 @@ describe('contract StakingModule', async () => { }); }); - describe('redeemHook', async () => { + describe('redeemHook', () => { const tokenTransferAmount = ethToWei(0.5); const matrixTokenQuantity = ethToWei(0.5); diff --git a/test/protocol/modules/streamingFeeModule.test.js b/test/protocol/modules/streamingFeeModule.test.js index a17dbdc..994611e 100644 --- a/test/protocol/modules/streamingFeeModule.test.js +++ b/test/protocol/modules/streamingFeeModule.test.js @@ -15,8 +15,8 @@ const { ZERO_ADDRESS, ZERO, PRECISE_UNIT, ONE_YEAR_IN_SECONDS } = require('../.. const { getStreamingFee, getPostFeePositionUnits, getStreamingFeeInflationAmount } = require('../../helpers/feeModuleUtil'); const { snapshotBlockchain, revertBlockchain, increaseBlockTime, getLastBlockTimestamp } = require('../../helpers/evmUtil'); -describe('contract StreamingFeeModule', async () => { - const [owner, protocolFeeRecipient, feeRecipient, randomAccount] = await getSigners(); +describe('contract StreamingFeeModule', () => { + const [owner, protocolFeeRecipient, feeRecipient, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); let rootSnapshotId; @@ -29,7 +29,7 @@ describe('contract StreamingFeeModule', async () => { await revertBlockchain(rootSnapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let caller; let matrixToken; let feeRecipient; @@ -130,7 +130,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let matrixToken; let module; @@ -175,7 +175,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('getFee', async () => { + describe('getFee', () => { let matrixToken; let feeStateSetting; let matrixTokenAddress; @@ -223,7 +223,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('actualizeFee', async () => { + describe('actualizeFee', () => { let matrixToken; let feeStateSetting; let isInitialized = false; @@ -384,7 +384,7 @@ describe('contract StreamingFeeModule', async () => { await expect(actualizeFee()).revertedWith('M3'); }); - describe('case 1.1: when a position is negative', async () => { + describe('case 1.1: when a position is negative', () => { beforeEach(async () => { await systemFixture.controller.addModule(owner.address); await matrixToken.addModule(owner.address); @@ -427,7 +427,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('case 1.2: when protocolFee is 0', async () => { + describe('case 1.2: when protocolFee is 0', () => { beforeEach(async () => { await systemFixture.controller.editFee(systemFixture.streamingFeeModule.address, ZERO, ZERO); }); @@ -456,7 +456,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('case 1.3: when streamingFee is 0', async () => { + describe('case 1.3: when streamingFee is 0', () => { beforeEach(async () => { await systemFixture.streamingFeeModule.updateStreamingFee(matrixTokenAddress, ZERO); }); @@ -475,7 +475,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('case 1.4: when module is not initialized', async () => { + describe('case 1.4: when module is not initialized', () => { before(async () => { isInitialized = true; }); @@ -490,7 +490,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('updateStreamingFee', async () => { + describe('updateStreamingFee', () => { let matrixToken; let feeStateSetting; let matrixTokenAddress; @@ -600,7 +600,7 @@ describe('contract StreamingFeeModule', async () => { await expect(updateStreamingFee()).revertedWith('M2'); }); - describe('when the existing fee is 0', async () => { + describe('when the existing fee is 0', () => { before(async () => { isInitialized = true; }); @@ -615,7 +615,7 @@ describe('contract StreamingFeeModule', async () => { }); }); - describe('updateFeeRecipient', async () => { + describe('updateFeeRecipient', () => { let matrixToken; let feeStateSetting; let isInitialized = false; @@ -690,7 +690,7 @@ describe('contract StreamingFeeModule', async () => { await expect(updateFeeRecipient()).revertedWith('M3'); }); - describe('should revert when module is not initialized', async () => { + describe('should revert when module is not initialized', () => { before(async () => { isInitialized = true; }); diff --git a/test/protocol/modules/tradeModule.test.js b/test/protocol/modules/tradeModule.test.js index 4086ce3..da7f031 100644 --- a/test/protocol/modules/tradeModule.test.js +++ b/test/protocol/modules/tradeModule.test.js @@ -20,8 +20,8 @@ const { getSigners, getRandomAddress } = require('../../helpers/accountUtil'); const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); const { ZERO, MAX_UINT_256, ZERO_ADDRESS, EMPTY_BYTES } = require('../../helpers/constants'); -describe('contract TradeModule', async () => { - const [owner, protocolFeeRecipient, manager, mockModule, randomAccount] = await getSigners(); +describe('contract TradeModule', () => { + const [owner, protocolFeeRecipient, manager, mockModule, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const uniswapFixture = new UniswapFixture(owner); const kyberV1Fixture = new KyberV1Fixture(owner); @@ -111,7 +111,7 @@ describe('contract TradeModule', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should have the correct controller', async () => { const controller = await tradeModule.getController(); expect(controller).eq(systemFixture.controller.address); @@ -146,7 +146,7 @@ describe('contract TradeModule', async () => { await revertBlockchain(snapshotId); }); - describe('initialize', async () => { + describe('initialize', () => { let matrixTokenAddress; beforeEach(async () => { @@ -181,7 +181,7 @@ describe('contract TradeModule', async () => { }); }); - describe('trade', async () => { + describe('trade', () => { let dataBytes; let adapterName; let srcQuantity; @@ -313,7 +313,7 @@ describe('contract TradeModule', async () => { expect(newSecondPosition.component).eq(destToken.address); }); - describe('when there is a protocol fee charged', async () => { + describe('when there is a protocol fee charged', () => { let feePercentage; beforeEach(async () => { @@ -380,7 +380,7 @@ describe('contract TradeModule', async () => { ); }); - describe('when receive token is more than total position units tracked on MatrixToken', async () => { + describe('when receive token is more than total position units tracked on MatrixToken', () => { let extraTokenQuantity; beforeEach(async () => { @@ -420,7 +420,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when send token is more than total position units tracked on MatrixToken', async () => { + describe('when send token is more than total position units tracked on MatrixToken', () => { let extraTokenQuantity; beforeEach(async () => { @@ -613,7 +613,7 @@ describe('contract TradeModule', async () => { expect(newFirstPosition.unit).eq(expectedReceiveQuantity); }); - describe('when path is through multiple trading pairs', async () => { + describe('when path is through multiple trading pairs', () => { beforeEach(async () => { destTokenAddress = systemFixture.dai.address; const tradePath = [srcTokenAddress, systemFixture.weth.address, destTokenAddress]; @@ -755,7 +755,7 @@ describe('contract TradeModule', async () => { expect(newSecondPosition.unit).lte(expectedReceiveQuantity); }); - describe('when path is through multiple trading pairs', async () => { + describe('when path is through multiple trading pairs', () => { let kyberWbtcDaiPool; beforeEach(async () => { @@ -868,7 +868,7 @@ describe('contract TradeModule', async () => { return tradeModule.connect(caller).trade(matrixTokenAddress, adapterName, srcTokenAddress, srcQuantity, destTokenAddress, minDestQuantity, dataBytes); } - describe('when path is through one pair and swaps exact tokens for tokens', async () => { + describe('when path is through one pair and swaps exact tokens for tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = true; const tradePath = [srcToken.address, destToken.address]; @@ -920,7 +920,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through one pair and swaps for exact tokens', async () => { + describe('when path is through one pair and swaps for exact tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = false; const tradePath = [srcToken.address, destToken.address]; @@ -947,7 +947,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through multiple trading pairs and swaps exact tokens for tokens', async () => { + describe('when path is through multiple trading pairs and swaps exact tokens for tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = true; const tradePath = [srcToken.address, systemFixture.weth.address, systemFixture.dai.address]; @@ -978,7 +978,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through multiple trading pairs and swaps for exact tokens', async () => { + describe('when path is through multiple trading pairs and swaps for exact tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = false; const tradePath = [srcToken.address, systemFixture.weth.address, systemFixture.dai.address]; @@ -1311,7 +1311,7 @@ describe('contract TradeModule', async () => { expect(newFirstPosition.unit).eq(expectedReceiveQuantity); }); - describe('when path is through multiple trading pairs', async () => { + describe('when path is through multiple trading pairs', () => { beforeEach(async () => { await systemFixture.weth.connect(owner).approve(uniswapFixture.router.address, ethToWei(1000)); await systemFixture.dai.connect(owner).approve(uniswapFixture.router.address, ethToWei(1000000)); @@ -1449,7 +1449,7 @@ describe('contract TradeModule', async () => { expect(newSecondPosition.unit).eq(expectedReceiveQuantity); }); - describe('when path is through multiple trading pairs', async () => { + describe('when path is through multiple trading pairs', () => { beforeEach(async () => { await systemFixture.wbtc.connect(owner).approve(uniswapFixture.router.address, btcToWei(1000)); await systemFixture.dai.connect(owner).approve(uniswapFixture.router.address, ethToWei(1000000)); @@ -1538,7 +1538,7 @@ describe('contract TradeModule', async () => { return tradeModule.connect(caller).trade(matrixTokenAddress, adapterName, srcTokenAddress, srcQuantity, destTokenAddress, minDestQuantity, dataBytes); } - describe('when path is through one pair and swaps exact tokens for tokens', async () => { + describe('when path is through one pair and swaps exact tokens for tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = true; const tradePath = [srcToken.address, destToken.address]; @@ -1588,7 +1588,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through one pair and swaps for exact tokens', async () => { + describe('when path is through one pair and swaps for exact tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = false; const tradePath = [srcToken.address, destToken.address]; @@ -1615,7 +1615,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through multiple trading pairs and swaps exact tokens for tokens', async () => { + describe('when path is through multiple trading pairs and swaps exact tokens for tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = true; const tradePath = [srcToken.address, systemFixture.weth.address, systemFixture.dai.address]; @@ -1645,7 +1645,7 @@ describe('contract TradeModule', async () => { }); }); - describe('when path is through multiple trading pairs and swaps for exact tokens', async () => { + describe('when path is through multiple trading pairs and swaps for exact tokens', () => { beforeEach(async () => { const shouldSwapExactTokenForToken = false; const tradePath = [srcToken.address, systemFixture.weth.address, systemFixture.dai.address]; @@ -1704,7 +1704,7 @@ describe('contract TradeModule', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let tradeModuleAddress; beforeEach(async () => { diff --git a/test/protocol/modules/wrapModuleV2.test.js b/test/protocol/modules/wrapModuleV2.test.js index 56f3c64..5797a00 100644 --- a/test/protocol/modules/wrapModuleV2.test.js +++ b/test/protocol/modules/wrapModuleV2.test.js @@ -14,8 +14,8 @@ const { getSigners, getRandomAddress, getEthBalance } = require('../../helpers/a const { snapshotBlockchain, revertBlockchain } = require('../../helpers/evmUtil.js'); const { ZERO, ZERO_ADDRESS, ZERO_BYTES } = require('../../helpers/constants'); -describe('contract WrapModuleV2', async () => { - const [owner, protocolFeeRecipient, randomAccount] = await getSigners(); +describe('contract WrapModuleV2', () => { + const [owner, protocolFeeRecipient, randomAccount] = getSigners(); const systemFixture = new SystemFixture(owner, protocolFeeRecipient); const wrapV2AdapterName = 'WRAP_V2_ADAPTER'; @@ -39,7 +39,7 @@ describe('contract WrapModuleV2', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { it('should set the correct controller', async () => { expect(await wrapV2Module.getController()).eq(systemFixture.controller.address); }); @@ -49,7 +49,7 @@ describe('contract WrapModuleV2', async () => { }); }); - describe('initialize', async () => { + describe('initialize', () => { let caller; let matrixToken; let matrixTokenAddress; @@ -96,7 +96,7 @@ describe('contract WrapModuleV2', async () => { }); }); - describe('removeModule', async () => { + describe('removeModule', () => { let caller; let module; let matrixToken; @@ -154,7 +154,7 @@ describe('contract WrapModuleV2', async () => { await systemFixture.basicIssuanceModule.issue(matrixToken.address, matrixTokensIssued, owner.address); }); - describe('wrap', async () => { + describe('wrap', () => { let caller; let wrapData; let wrappedToken; @@ -246,7 +246,7 @@ describe('contract WrapModuleV2', async () => { }); }); - describe('wrapWithEther', async () => { + describe('wrapWithEther', () => { let caller; let wrapData; let wrappedToken; @@ -360,7 +360,7 @@ describe('contract WrapModuleV2', async () => { }); }); - describe('unwrap', async () => { + describe('unwrap', () => { let caller; let unwrapData; let wrappedToken; @@ -456,7 +456,7 @@ describe('contract WrapModuleV2', async () => { }); }); - describe('unwrapWithEther', async () => { + describe('unwrapWithEther', () => { let caller; let unwrapData; let wrappedToken; diff --git a/test/protocol/priceOracle.test.js b/test/protocol/priceOracle.test.js index b96f9f5..d4ed2ca 100644 --- a/test/protocol/priceOracle.test.js +++ b/test/protocol/priceOracle.test.js @@ -17,7 +17,7 @@ function inverse(number) { return PRECISE_UNIT.mul(PRECISE_UNIT).div(number); } -describe('contract PriceOracle', async () => { +describe('contract PriceOracle', () => { const [owner, wrappedETH, wrappedBTC, usdc, adapterAsset, randomAsset, newOracle, attacker] = getSigners(); const masterQuoteAsset = wrappedETH.address; const assetOnes = [wrappedETH.address, wrappedETH.address]; @@ -57,7 +57,7 @@ describe('contract PriceOracle', async () => { await revertBlockchain(snapshotId); }); - describe('constructor', async () => { + describe('constructor', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -102,7 +102,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('getPrice', async () => { + describe('getPrice', () => { const asset1 = wrappedETH.address; const asset2 = usdc.address; @@ -149,7 +149,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('editPair', async () => { + describe('editPair', () => { const asset1 = wrappedETH.address; const asset2 = usdc.address; const oracle = newOracle.address; @@ -170,7 +170,9 @@ describe('contract PriceOracle', async () => { }); it('should emit an EditPair event', async () => { - await expect(masterOracle.editPair(asset1, asset2, oracle)).emit(masterOracle, 'EditPair').withArgs(asset1, asset2, oracle); + await expect(masterOracle.editPair(asset1, asset2, oracle)) + .emit(masterOracle, 'EditPair') + .withArgs(asset1, asset2, oracle); }); it('should revert when the caller is not the owner', async () => { @@ -182,7 +184,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('addPair', async () => { + describe('addPair', () => { const asset1 = randomAsset.address; const asset2 = usdc.address; const oracle = newOracle.address; @@ -206,7 +208,9 @@ describe('contract PriceOracle', async () => { }); it('should emit an AddPair event', async () => { - await expect(masterOracle.addPair(asset1, asset2, oracle)).emit(masterOracle, 'AddPair').withArgs(asset1, asset2, oracle); + await expect(masterOracle.addPair(asset1, asset2, oracle)) + .emit(masterOracle, 'AddPair') + .withArgs(asset1, asset2, oracle); }); it('should return correct oracle address after create the new oracle', async () => { @@ -219,7 +223,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('removePair', async () => { + describe('removePair', () => { const asset1 = wrappedETH.address; const asset2 = usdc.address; @@ -251,7 +255,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('addAdapter', async () => { + describe('addAdapter', () => { const adapter = randomAsset.address; let snapshotId; @@ -281,7 +285,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('removeAdapter', async () => { + describe('removeAdapter', () => { let snapshotId; before(async () => { snapshotId = await snapshotBlockchain(); @@ -314,7 +318,7 @@ describe('contract PriceOracle', async () => { }); }); - describe('editMasterQuoteAsset', async () => { + describe('editMasterQuoteAsset', () => { const newMasterQuoteAsset = usdc.address; let snapshotId; diff --git a/yarn.lock b/yarn.lock index 7214d39..72d3e00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -856,33 +856,65 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomicfoundation/ethereumjs-block@5.0.4": - version "5.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.4.tgz#ff2acb98a86b9290e35e315a6abfb9aebb9cf39e" - integrity sha512-AcyacJ9eX/uPEvqsPiB+WO1ymE+kyH48qGGiGV+YTojdtas8itUTW5dehDSOXEEItWGbbzEJ4PRqnQZlWaPvDw== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - ethereum-cryptography "0.1.3" +"@nomicfoundation/edr-darwin-arm64@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.2.tgz#be1f696d429aecdf47d292a75958551e7cc34294" + integrity sha512-l6wfSBUUbGJiCENT6272CDI8yoMuf0sZH56H5qz3HnAyVzenkOvmzyF6/lar54m986kdAQqWls4cLvDxiOuLxg== -"@nomicfoundation/ethereumjs-blockchain@7.0.4": - version "7.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.4.tgz#b77511b389290b186c8d999e70f4b15c27ef44ea" - integrity sha512-jYsd/kwzbmpnxx86tXsYV8wZ5xGvFL+7/P0c6OlzpClHsbFzeF41KrYA9scON8Rg6bZu3ZTv6JOAgj3t7USUfg== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-ethash" "3.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - lru-cache "^10.0.0" +"@nomicfoundation/edr-darwin-x64@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.2.tgz#efd2a5a302dc0a806fb2439a7e2c8ed7bd482ff8" + integrity sha512-OboExL7vEw+TRJQl3KkaEKU4K7PTdZPTInZ0fxMAtOpcWp7EKR+dQo68vc/iAOusB3xszHKxt7t+WpisItfdcg== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.2.tgz#4d7d4f28e13d426b5e3cf9731dbfed573f819245" + integrity sha512-xtEK+1eg++3pHi6405NDXd80S3CGOFEGQIyVGCwjMGQFOLSzBGGCsrb/0GB4J19zd1o/8ftCd/HjZcbVAWWTLQ== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.2.tgz#10702ae4db386cc21efef9e6276bb56a09581e0a" + integrity sha512-3cIsskJOXQ1yEVsImmCacY7O03tUTiWrmd54F05PnPFrDLkjbzodQ3b2gUWzfbzUZWl67ZTJd1CvVSzpe7XGzw== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.2.tgz#a29590bea8d490aa2129f2cb7fab1559ec9d25ee" + integrity sha512-ouPdphHNsyO7wqwa4hwahC5WqBglK/fIvMmhR/SXNZ9qruIpsA8ZZKIURaHMOv/2h2BbNGcyTX9uEk6+5rK/MQ== + +"@nomicfoundation/edr-linux-x64-musl@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.2.tgz#fe2b4c282c80c792b3a03e04d517d140a927cf92" + integrity sha512-sRhwhiPbkpJMOUwXW1FZw9ks6xWyQhIhM0E8o3TXEXKSPKTE6whQLEk1R37iFITaI36vb6rSwLKTU1cb32gCoA== + +"@nomicfoundation/edr-win32-arm64-msvc@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-arm64-msvc/-/edr-win32-arm64-msvc-0.3.2.tgz#6f09cf20f7e7be3ea70f61888cde238d924ec369" + integrity sha512-IEwVealKfumu1HSSnama26yPuQC/uthRPK5IWtFsQUOGwOXaS1r9Bu7cGYH2jBHl3IT/JbxD4xzPq/2pM9uK0A== + +"@nomicfoundation/edr-win32-ia32-msvc@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-ia32-msvc/-/edr-win32-ia32-msvc-0.3.2.tgz#ba4cd9744d95f491329efdfbefb527a8c9f5f31d" + integrity sha512-jYMnf6SFgguqROswwdsjJ1wvneD/5c16pVu9OD4DxNqhKNP5bHEw6L2N4DcJ89tpXMpJ6AlOpc0QuwzddiZ3tA== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.2.tgz#331e3cea1618134e8d9f4ccb999086af6362a3af" + integrity sha512-Byn4QuWczRy/DUUQM3WjglgX/jGVUURVFaUsmIhnGg//MPlCLawubBGRqsrMuvaYedlIIJ4I2rgKvZlxdgHrqg== + +"@nomicfoundation/edr@^0.3.1": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.2.tgz#a81500746f8f8c342606a9be04a9f6176f8e2d54" + integrity sha512-HGWtjibAK1mo4I2A7nJ/fXqe/J9G54OrSPJnnkY2K8TiXotYLShGd9GvHkae3PuFjTJKm6ZgBy7tveJj5yrCfw== + optionalDependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.2" + "@nomicfoundation/edr-darwin-x64" "0.3.2" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.2" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.2" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.2" + "@nomicfoundation/edr-linux-x64-musl" "0.3.2" + "@nomicfoundation/edr-win32-arm64-msvc" "0.3.2" + "@nomicfoundation/edr-win32-ia32-msvc" "0.3.2" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.2" "@nomicfoundation/ethereumjs-common@4.0.4": version "4.0.4" @@ -891,62 +923,11 @@ dependencies: "@nomicfoundation/ethereumjs-util" "9.0.4" -"@nomicfoundation/ethereumjs-ethash@3.0.4": - version "3.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.4.tgz#06cb2502b3012fb6c11cffd44af08aecf71310da" - integrity sha512-xvIrwIMl9sSaiYKRem68+O7vYdj7Q2XWv5P7JXiIkn83918QzWHvqbswTRsH7+r6X1UEvdsURRnZbvZszEjAaQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - bigint-crypto-utils "^3.2.2" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-evm@2.0.4": - version "2.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.4.tgz#c9c761767283ac53946185474362230b169f8f63" - integrity sha512-lTyZZi1KpeMHzaO6cSVisR2tjiTTedjo7PcmhI/+GNFo9BmyY6QYzGeSti0sFttmjbEMioHgXxl5yrLNRg6+1w== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@types/debug" "^4.1.9" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - rustbn-wasm "^0.2.0" - "@nomicfoundation/ethereumjs-rlp@5.0.4": version "5.0.4" resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== -"@nomicfoundation/ethereumjs-statemanager@2.0.4": - version "2.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.4.tgz#bf14415e1f31b5ea8b98a0c027c547d0555059b6" - integrity sha512-HPDjeFrxw6llEi+BzqXkZ+KkvFnTOPczuHBtk21hRlDiuKuZz32dPzlhpRsDBGV1b5JTmRDUVqCS1lp3Gghw4Q== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - js-sdsl "^4.1.4" - lru-cache "^10.0.0" - -"@nomicfoundation/ethereumjs-trie@6.0.4": - version "6.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.4.tgz#688a3f76646c209365ee6d959c3d7330ede5e609" - integrity sha512-3nSwQiFMvr2VFe/aZUyinuohYvtytUqZCUCvIWcPJ/BwJH6oQdZRB42aNFBJ/8nAh2s3OcroWpBLskzW01mFKA== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@types/readable-stream" "^2.3.13" - ethereum-cryptography "0.1.3" - lru-cache "^10.0.0" - readable-stream "^3.6.0" - "@nomicfoundation/ethereumjs-tx@5.0.4": version "5.0.4" resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" @@ -965,33 +946,6 @@ "@nomicfoundation/ethereumjs-rlp" "5.0.4" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-verkle@0.0.2": - version "0.0.2" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-verkle/-/ethereumjs-verkle-0.0.2.tgz#7686689edec775b2efea5a71548f417c18f7dea4" - integrity sha512-bjnfZElpYGK/XuuVRmLS3yDvr+cDs85D9oonZ0YUa5A3lgFgokWMp76zXrxX2jVQ0BfHaw12y860n1+iOi6yFQ== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - lru-cache "^10.0.0" - rust-verkle-wasm "^0.0.1" - -"@nomicfoundation/ethereumjs-vm@7.0.4": - version "7.0.4" - resolved "https://registry.npmmirror.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.4.tgz#e5a6eec4877dc62dda93003c6d7afd1fe4b9625b" - integrity sha512-gsA4IhmtWHI4BofKy3kio9W+dqZQs5Ji5mLjLYxHCkat+JQBUt5szjRKra2F9nGDJ2XcI/wWb0YWUFNgln4zRQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-blockchain" "7.0.4" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-evm" "2.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" resolved "https://registry.npmmirror.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" @@ -1169,7 +1123,7 @@ path-browserify "^1.0.0" url "^0.11.0" -"@scure/base@^1.1.1", "@scure/base@~1.1.0", "@scure/base@~1.1.2", "@scure/base@~1.1.4": +"@scure/base@~1.1.0", "@scure/base@~1.1.2", "@scure/base@~1.1.4": version "1.1.5" resolved "https://registry.npmmirror.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== @@ -1377,13 +1331,6 @@ "@types/node" "*" "@types/responselike" "^1.0.0" -"@types/debug@^4.1.9": - version "4.1.12" - resolved "https://registry.npmmirror.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" - integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== - dependencies: - "@types/ms" "*" - "@types/glob@^7.1.1": version "7.2.0" resolved "https://registry.npmmirror.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" @@ -1431,11 +1378,6 @@ dependencies: "@types/node" "*" -"@types/ms@*": - version "0.7.34" - resolved "https://registry.npmmirror.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" - integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== - "@types/node-fetch@^2.5.5": version "2.6.11" resolved "https://registry.npmmirror.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24" @@ -1471,14 +1413,6 @@ resolved "https://registry.npmmirror.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== -"@types/readable-stream@^2.3.13": - version "2.3.15" - resolved "https://registry.npmmirror.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" - integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== - dependencies: - "@types/node" "*" - safe-buffer "~5.1.1" - "@types/resolve@^0.0.8": version "0.0.8" resolved "https://registry.npmmirror.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -2542,11 +2476,6 @@ bech32@1.1.4: resolved "https://registry.npmmirror.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bigint-crypto-utils@^3.2.2: - version "3.3.0" - resolved "https://registry.npmmirror.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" - integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== - bignumber.js@*, bignumber.js@^9.0.0: version "9.0.2" resolved "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" @@ -3451,7 +3380,7 @@ debug@4, debug@^4.1.1, debug@^4.3.2: dependencies: ms "2.1.2" -debug@4.3.4, debug@^4.3.1, debug@^4.3.3: +debug@4.3.4, debug@^4.3.1: version "4.3.4" resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -5570,24 +5499,17 @@ hardhat-gas-reporter@^2.0.2: sha1 "^1.1.1" viem "2.7.14" -hardhat@~2.20.1: - version "2.20.1" - resolved "https://registry.npmmirror.com/hardhat/-/hardhat-2.20.1.tgz#3ad8f2b003a96c9ce80a55fec3575580ff2ddcd4" - integrity sha512-q75xDQiQtCZcTMBwjTovrXEU5ECr49baxr4/OBkIu/ULTPzlB20yk1dRWNmD2IFbAeAeXggaWvQAdpiScaHtPw== +hardhat@~2.22.2: + version "2.22.2" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.2.tgz#0cadd7ec93bf39bab09f81603e75bc5e92acea3d" + integrity sha512-0xZ7MdCZ5sJem4MrvpQWLR3R3zGDoHw5lsR+pBFimqwagimIOn3bWuZv69KA+veXClwI1s/zpqgwPwiFrd4Dxw== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-blockchain" "7.0.4" + "@nomicfoundation/edr" "^0.3.1" "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-evm" "2.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" "@nomicfoundation/ethereumjs-tx" "5.0.4" "@nomicfoundation/ethereumjs-util" "9.0.4" - "@nomicfoundation/ethereumjs-verkle" "0.0.2" - "@nomicfoundation/ethereumjs-vm" "7.0.4" "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" "@types/bn.js" "^5.1.0" @@ -6426,11 +6348,6 @@ jackspeak@^2.3.5: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -js-sdsl@^4.1.4: - version "4.4.2" - resolved "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" - integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== - js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.npmmirror.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -6959,11 +6876,6 @@ lru-cache@5.1.1, lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -lru-cache@^10.0.0, "lru-cache@^9.1.1 || ^10.0.0": - version "10.2.0" - resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" - integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== - lru-cache@^3.2.0: version "3.2.0" resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" @@ -6978,6 +6890,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +"lru-cache@^9.1.1 || ^10.0.0": + version "10.2.0" + resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" + integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== + lru_map@^0.3.3: version "0.3.3" resolved "https://registry.npmmirror.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" @@ -8739,18 +8656,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rust-verkle-wasm@^0.0.1: - version "0.0.1" - resolved "https://registry.npmmirror.com/rust-verkle-wasm/-/rust-verkle-wasm-0.0.1.tgz#fd8396a7060d8ee8ea10da50ab6e862948095a74" - integrity sha512-BN6fiTsxcd2dCECz/cHtGTt9cdLJR925nh7iAuRcj8ymKw7OOaPmCneQZ7JePOJ/ia27TjEL91VdOi88Yf+mcA== - -rustbn-wasm@^0.2.0: - version "0.2.0" - resolved "https://registry.npmmirror.com/rustbn-wasm/-/rustbn-wasm-0.2.0.tgz#0407521fb55ae69eeb4968d01885d63efd1c4ff9" - integrity sha512-FThvYFNTqrEKGqXuseeg0zR7yROh/6U1617mCHF68OVqrN1tNKRN7Tdwy4WayPVsCmmK+eMxtIZX1qL6JxTkMg== - dependencies: - "@scure/base" "^1.1.1" - rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.npmmirror.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" @@ -9375,7 +9280,7 @@ strict-uri-encode@^1.0.0: resolved "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9393,15 +9298,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -9473,7 +9369,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -9496,13 +9392,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -10850,7 +10739,7 @@ workerpool@6.2.1: resolved "https://registry.npmmirror.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -10867,15 +10756,6 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"