diff --git a/.github/workflows/ci-helpers.yml b/.github/workflows/ci-helpers.yml deleted file mode 100644 index 51307838..00000000 --- a/.github/workflows/ci-helpers.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Helpers CI - -env: - CI: true - -on: - push: - branches: "*" - paths: - - packages/helpers/** - pull_request: - branches: "*" - paths: - - packages/helpers/** - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up environment - uses: ./.github/actions/setup - - name: Lint - run: yarn workspace @mimic-fi/v3-helpers lint - - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up environment - uses: ./.github/actions/setup - - name: Build - run: yarn build - - name: Test - run: yarn workspace @mimic-fi/v3-helpers test diff --git a/.github/workflows/ci-price-oracle.yml b/.github/workflows/ci-price-oracle.yml index 7c5e9786..08538d3c 100644 --- a/.github/workflows/ci-price-oracle.yml +++ b/.github/workflows/ci-price-oracle.yml @@ -35,19 +35,3 @@ jobs: run: yarn build - name: Test run: yarn workspace @mimic-fi/v3-price-oracle test - - integration: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up environment - uses: ./.github/actions/setup - - name: Set up hardhat config - run: .github/scripts/setup-hardhat-config.sh ${{secrets.MAINNET_RPC}} ${{secrets.POLYGON_RPC}} ${{secrets.OPTIMISM_RPC}} ${{secrets.ARBITRUM_RPC}} ${{secrets.GNOSIS_RPC}} ${{secrets.AVALANCHE_RPC}} ${{secrets.BSC_RPC}} ${{secrets.FANTOM_RPC}} ${{secrets.ZKEVM_RPC}} - - name: Build - run: yarn build - - name: Test mainnet - run: yarn workspace @mimic-fi/v3-price-oracle test:mainnet - - name: Test polygon - run: yarn workspace @mimic-fi/v3-price-oracle test:polygon diff --git a/.github/workflows/ci-tasks.yml b/.github/workflows/ci-tasks.yml index 01be3ec5..22c26fa0 100644 --- a/.github/workflows/ci-tasks.yml +++ b/.github/workflows/ci-tasks.yml @@ -39,17 +39,3 @@ jobs: env: CC_SECRET: ${{ secrets.CODECHECKS_SECRET }} run: yarn workspace @mimic-fi/v3-tasks codechecks - - integration: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up environment - uses: ./.github/actions/setup - - name: Set up hardhat config - run: .github/scripts/setup-hardhat-config.sh ${{secrets.MAINNET_RPC}} ${{secrets.POLYGON_RPC}} ${{secrets.OPTIMISM_RPC}} ${{secrets.ARBITRUM_RPC}} ${{secrets.GNOSIS_RPC}} ${{secrets.AVALANCHE_RPC}} ${{secrets.BSC_RPC}} ${{secrets.FANTOM_RPC}} ${{secrets.ZKEVM_RPC}} - - name: Build - run: yarn build - - name: Test mainnet - run: yarn workspace @mimic-fi/v3-tasks test:mainnet diff --git a/README.md b/README.md index b23daa30..8070e4aa 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ This monorepo holds the key components of the Mimic protocol: - [Connectors](./packages/connectors) - [Deployer](./packages/deployer) - [Fee controller](./packages/fee-controller) -- [Helpers](./packages/helpers) - [Price oracle](./packages/price-oracle) - [Registry](./packages/registry) - [Relayer](./packages/relayer) diff --git a/package.json b/package.json index d935a0c1..1a0fe028 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@ "test": "yarn workspaces run test" }, "workspaces": { - "packages": [ - "packages/helpers", + "packages": [ "packages/registry", "packages/fee-controller", "packages/authorizer", diff --git a/packages/authorizer/package.json b/packages/authorizer/package.json index 92848b3d..6a906b72 100644 --- a/packages/authorizer/package.json +++ b/packages/authorizer/package.json @@ -23,7 +23,7 @@ "prove:ci": "yarn prove --solc solc8.17" }, "dependencies": { - "@mimic-fi/v3-helpers": "0.1.0", + "@mimic-fi/helpers": "1.0.0", "@openzeppelin/contracts": "4.9.3" }, "devDependencies": { diff --git a/packages/authorizer/test/AuthorizedHelpers.test.ts b/packages/authorizer/test/AuthorizedHelpers.test.ts index 34b74161..20d00d16 100644 --- a/packages/authorizer/test/AuthorizedHelpers.test.ts +++ b/packages/authorizer/test/AuthorizedHelpers.test.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract, utils } from 'ethers' diff --git a/packages/authorizer/test/Authorizer.test.ts b/packages/authorizer/test/Authorizer.test.ts index 23961e80..87d63768 100644 --- a/packages/authorizer/test/Authorizer.test.ts +++ b/packages/authorizer/test/Authorizer.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployProxy, getSigner, getSigners, ONES_ADDRESS, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deployProxy, getSigner, getSigners, ONES_ADDRESS, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/contracts/1inch/OneInchV5Connector.sol b/packages/connectors/contracts/1inch/OneInchV5Connector.sol index 94691533..0ad24b39 100644 --- a/packages/connectors/contracts/1inch/OneInchV5Connector.sol +++ b/packages/connectors/contracts/1inch/OneInchV5Connector.sol @@ -18,7 +18,7 @@ import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/1inch/IOneInchV5Connector.sol'; diff --git a/packages/connectors/contracts/axelar/AxelarConnector.sol b/packages/connectors/contracts/axelar/AxelarConnector.sol index 4c0e9e33..aab0ee42 100644 --- a/packages/connectors/contracts/axelar/AxelarConnector.sol +++ b/packages/connectors/contracts/axelar/AxelarConnector.sol @@ -17,7 +17,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/axelar/IAxelarGateway.sol'; import '../interfaces/axelar/IAxelarConnector.sol'; diff --git a/packages/connectors/contracts/balancer/BalancerV2PoolConnector.sol b/packages/connectors/contracts/balancer/BalancerV2PoolConnector.sol index fce8ced6..e7a3a3a0 100644 --- a/packages/connectors/contracts/balancer/BalancerV2PoolConnector.sol +++ b/packages/connectors/contracts/balancer/BalancerV2PoolConnector.sol @@ -17,8 +17,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/balancer/IBalancerPool.sol'; import '../interfaces/balancer/IBalancerV2Vault.sol'; diff --git a/packages/connectors/contracts/balancer/BalancerV2SwapConnector.sol b/packages/connectors/contracts/balancer/BalancerV2SwapConnector.sol index 74d84fdb..40f600a6 100644 --- a/packages/connectors/contracts/balancer/BalancerV2SwapConnector.sol +++ b/packages/connectors/contracts/balancer/BalancerV2SwapConnector.sol @@ -17,8 +17,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Arrays.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/Arrays.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/balancer/IBalancerV2Vault.sol'; import '../interfaces/balancer/IBalancerV2SwapConnector.sol'; diff --git a/packages/connectors/contracts/bebop/BebopConnector.sol b/packages/connectors/contracts/bebop/BebopConnector.sol index 310f74ae..fbceb541 100644 --- a/packages/connectors/contracts/bebop/BebopConnector.sol +++ b/packages/connectors/contracts/bebop/BebopConnector.sol @@ -17,7 +17,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/bebop/IBebopConnector.sol'; diff --git a/packages/connectors/contracts/connext/ConnextConnector.sol b/packages/connectors/contracts/connext/ConnextConnector.sol index d0080281..93a9a983 100644 --- a/packages/connectors/contracts/connext/ConnextConnector.sol +++ b/packages/connectors/contracts/connext/ConnextConnector.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/connext/IConnext.sol'; import '../interfaces/connext/IConnextConnector.sol'; diff --git a/packages/connectors/contracts/convex/ConvexConnector.sol b/packages/connectors/contracts/convex/ConvexConnector.sol index 86a8c82e..20eae5dd 100644 --- a/packages/connectors/contracts/convex/ConvexConnector.sol +++ b/packages/connectors/contracts/convex/ConvexConnector.sol @@ -16,8 +16,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/convex/ICvxPool.sol'; import '../interfaces/convex/ICvxBooster.sol'; diff --git a/packages/connectors/contracts/curve/Curve2CrvConnector.sol b/packages/connectors/contracts/curve/Curve2CrvConnector.sol index 9d513a9d..a057f916 100644 --- a/packages/connectors/contracts/curve/Curve2CrvConnector.sol +++ b/packages/connectors/contracts/curve/Curve2CrvConnector.sol @@ -17,8 +17,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/curve/I2CrvPool.sol'; import '../interfaces/curve/ICurve2CrvConnector.sol'; diff --git a/packages/connectors/contracts/erc4626/ERC4626Connector.sol b/packages/connectors/contracts/erc4626/ERC4626Connector.sol index 6932f35a..38411410 100644 --- a/packages/connectors/contracts/erc4626/ERC4626Connector.sol +++ b/packages/connectors/contracts/erc4626/ERC4626Connector.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/interfaces/IERC4626.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/erc4626/IERC4626Connector.sol'; diff --git a/packages/connectors/contracts/hop/HopBridgeConnector.sol b/packages/connectors/contracts/hop/HopBridgeConnector.sol index a4d99e81..aa22f7fe 100644 --- a/packages/connectors/contracts/hop/HopBridgeConnector.sol +++ b/packages/connectors/contracts/hop/HopBridgeConnector.sol @@ -17,10 +17,10 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/IWrappedNativeToken.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/IWrappedNativeToken.sol'; import '../interfaces/hop/IHopL2Amm.sol'; import '../interfaces/hop/IHopL1Bridge.sol'; diff --git a/packages/connectors/contracts/hop/HopSwapConnector.sol b/packages/connectors/contracts/hop/HopSwapConnector.sol index 3bcbefa3..f783787d 100644 --- a/packages/connectors/contracts/hop/HopSwapConnector.sol +++ b/packages/connectors/contracts/hop/HopSwapConnector.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/hop/IHopDex.sol'; import '../interfaces/hop/IHopSwapConnector.sol'; diff --git a/packages/connectors/contracts/kyberswap/KyberSwapV2Connector.sol b/packages/connectors/contracts/kyberswap/KyberSwapV2Connector.sol index 3f46c87d..5a0c7db5 100644 --- a/packages/connectors/contracts/kyberswap/KyberSwapV2Connector.sol +++ b/packages/connectors/contracts/kyberswap/KyberSwapV2Connector.sol @@ -18,7 +18,7 @@ import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/kyberswap/IKyberSwapV2Connector.sol'; diff --git a/packages/connectors/contracts/morpho/MorphoAaveV2Connector.sol b/packages/connectors/contracts/morpho/MorphoAaveV2Connector.sol index e0df4328..5ed6040a 100644 --- a/packages/connectors/contracts/morpho/MorphoAaveV2Connector.sol +++ b/packages/connectors/contracts/morpho/MorphoAaveV2Connector.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/morpho/ILendingPool.sol'; import '../interfaces/morpho/ILens.sol'; diff --git a/packages/connectors/contracts/morpho/MorphoAaveV3Connector.sol b/packages/connectors/contracts/morpho/MorphoAaveV3Connector.sol index 2eb13492..0b81f41d 100644 --- a/packages/connectors/contracts/morpho/MorphoAaveV3Connector.sol +++ b/packages/connectors/contracts/morpho/MorphoAaveV3Connector.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/morpho/IMorphoV3.sol'; import '../interfaces/morpho/IRewardsDistributor.sol'; diff --git a/packages/connectors/contracts/odos/OdosV2Connector.sol b/packages/connectors/contracts/odos/OdosV2Connector.sol index 63140f8f..0d891394 100644 --- a/packages/connectors/contracts/odos/OdosV2Connector.sol +++ b/packages/connectors/contracts/odos/OdosV2Connector.sol @@ -18,7 +18,7 @@ import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/odos/IOdosV2Connector.sol'; diff --git a/packages/connectors/contracts/paraswap/ParaswapV5Connector.sol b/packages/connectors/contracts/paraswap/ParaswapV5Connector.sol index 06b81b3d..25ca0666 100644 --- a/packages/connectors/contracts/paraswap/ParaswapV5Connector.sol +++ b/packages/connectors/contracts/paraswap/ParaswapV5Connector.sol @@ -17,7 +17,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/paraswap/IParaswapV5Augustus.sol'; import '../interfaces/paraswap/IParaswapV5Connector.sol'; diff --git a/packages/connectors/contracts/socket/SocketConnector.sol b/packages/connectors/contracts/socket/SocketConnector.sol index e9c512d2..b61216cb 100644 --- a/packages/connectors/contracts/socket/SocketConnector.sol +++ b/packages/connectors/contracts/socket/SocketConnector.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/socket/ISocketConnector.sol'; diff --git a/packages/connectors/contracts/symbiosis/SymbiosisConnector.sol b/packages/connectors/contracts/symbiosis/SymbiosisConnector.sol index 0c3daabc..f2caccc5 100644 --- a/packages/connectors/contracts/symbiosis/SymbiosisConnector.sol +++ b/packages/connectors/contracts/symbiosis/SymbiosisConnector.sol @@ -14,9 +14,10 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; import '@openzeppelin/contracts/utils/Address.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; + import '../interfaces/symbiosis/ISymbiosisConnector.sol'; import '../interfaces/symbiosis/ISymbiosisMetaRouter.sol'; diff --git a/packages/connectors/contracts/uniswap/UniswapV2Connector.sol b/packages/connectors/contracts/uniswap/UniswapV2Connector.sol index bf068c57..7ea70259 100644 --- a/packages/connectors/contracts/uniswap/UniswapV2Connector.sol +++ b/packages/connectors/contracts/uniswap/UniswapV2Connector.sol @@ -17,8 +17,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Arrays.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/Arrays.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/uniswap/IUniswapV2Factory.sol'; import '../interfaces/uniswap/IUniswapV2Router02.sol'; diff --git a/packages/connectors/contracts/uniswap/UniswapV3Connector.sol b/packages/connectors/contracts/uniswap/UniswapV3Connector.sol index f79519a8..00759e8b 100644 --- a/packages/connectors/contracts/uniswap/UniswapV3Connector.sol +++ b/packages/connectors/contracts/uniswap/UniswapV3Connector.sol @@ -16,9 +16,9 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Arrays.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/Arrays.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/uniswap/IUniswapV3Factory.sol'; import '../interfaces/uniswap/IUniswapV3SwapRouter.sol'; diff --git a/packages/connectors/contracts/wormhole/WormholeConnector.sol b/packages/connectors/contracts/wormhole/WormholeConnector.sol index 78ef2817..a12a3711 100644 --- a/packages/connectors/contracts/wormhole/WormholeConnector.sol +++ b/packages/connectors/contracts/wormhole/WormholeConnector.sol @@ -17,7 +17,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../interfaces/wormhole/IWormhole.sol'; import '../interfaces/wormhole/IWormholeConnector.sol'; diff --git a/packages/connectors/hardhat.config.ts b/packages/connectors/hardhat.config.ts index d9a7d54c..2ecc05ca 100644 --- a/packages/connectors/hardhat.config.ts +++ b/packages/connectors/hardhat.config.ts @@ -1,6 +1,6 @@ import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-waffle' -import '@mimic-fi/v3-helpers/dist/tests' +import '@mimic-fi/helpers/dist/tests' import 'hardhat-local-networks-config-plugin' import { homedir } from 'os' diff --git a/packages/connectors/package.json b/packages/connectors/package.json index 653bd776..fd1d5a8f 100644 --- a/packages/connectors/package.json +++ b/packages/connectors/package.json @@ -28,8 +28,8 @@ "prepare": "yarn build" }, "dependencies": { + "@mimic-fi/helpers": "1.0.0", "@mimic-fi/erc4626-adapter": "0.0.1-rc.0", - "@mimic-fi/v3-helpers": "0.1.9", "@openzeppelin/contracts": "4.9.3" }, "devDependencies": { diff --git a/packages/connectors/src/hop.ts b/packages/connectors/src/hop.ts index 4441e136..f5a02a40 100644 --- a/packages/connectors/src/hop.ts +++ b/packages/connectors/src/hop.ts @@ -1,4 +1,4 @@ -import { bn } from '@mimic-fi/v3-helpers' +import { bn } from '@mimic-fi/helpers' import axios, { AxiosError } from 'axios' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/src/paraswap-v5.ts b/packages/connectors/src/paraswap-v5.ts index 8cfc631c..39791f28 100644 --- a/packages/connectors/src/paraswap-v5.ts +++ b/packages/connectors/src/paraswap-v5.ts @@ -1,4 +1,4 @@ -import { bn, currentTimestamp, MINUTE, pct } from '@mimic-fi/v3-helpers' +import { bn, currentTimestamp, MINUTE, pct } from '@mimic-fi/helpers' import axios, { AxiosError } from 'axios' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/1inch/OneInchV5Connector.behavior.ts b/packages/connectors/test/1inch/OneInchV5Connector.behavior.ts index cb5e600b..92a7d737 100644 --- a/packages/connectors/test/1inch/OneInchV5Connector.behavior.ts +++ b/packages/connectors/test/1inch/OneInchV5Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/1inch/OneInchV5Connector.mainnet.ts b/packages/connectors/test/1inch/OneInchV5Connector.mainnet.ts index 9f62c859..1b8ced66 100644 --- a/packages/connectors/test/1inch/OneInchV5Connector.mainnet.ts +++ b/packages/connectors/test/1inch/OneInchV5Connector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeOneInchV5Connector } from './OneInchV5Connector.behavior' diff --git a/packages/connectors/test/1inch/OneInchV5Connector.polygon.ts b/packages/connectors/test/1inch/OneInchV5Connector.polygon.ts index 6359b2c9..d61c9774 100644 --- a/packages/connectors/test/1inch/OneInchV5Connector.polygon.ts +++ b/packages/connectors/test/1inch/OneInchV5Connector.polygon.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeOneInchV5Connector } from './OneInchV5Connector.behavior' diff --git a/packages/connectors/test/axelar/AxelarConnector.arbitrum.ts b/packages/connectors/test/axelar/AxelarConnector.arbitrum.ts index 738588a2..26a91968 100644 --- a/packages/connectors/test/axelar/AxelarConnector.arbitrum.ts +++ b/packages/connectors/test/axelar/AxelarConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeAxelarConnector } from './AxelarConnector.behavior' diff --git a/packages/connectors/test/axelar/AxelarConnector.behavior.ts b/packages/connectors/test/axelar/AxelarConnector.behavior.ts index 2d68431d..d166dada 100644 --- a/packages/connectors/test/axelar/AxelarConnector.behavior.ts +++ b/packages/connectors/test/axelar/AxelarConnector.behavior.ts @@ -1,4 +1,4 @@ -import { bn, fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { bn, fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/axelar/AxelarConnector.fantom.ts b/packages/connectors/test/axelar/AxelarConnector.fantom.ts index 6f7de9f8..8675dc1a 100644 --- a/packages/connectors/test/axelar/AxelarConnector.fantom.ts +++ b/packages/connectors/test/axelar/AxelarConnector.fantom.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeAxelarConnector } from './AxelarConnector.behavior' diff --git a/packages/connectors/test/balancer/BalancerV2PoolConnector.mainnet.ts b/packages/connectors/test/balancer/BalancerV2PoolConnector.mainnet.ts index 4a62692c..a6378df4 100644 --- a/packages/connectors/test/balancer/BalancerV2PoolConnector.mainnet.ts +++ b/packages/connectors/test/balancer/BalancerV2PoolConnector.mainnet.ts @@ -1,10 +1,12 @@ -import { BigNumberish, deploy, fp, impersonate, instanceAt, tokens, toUSDC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { BigNumberish, deploy, fp, impersonate, instanceAt, toUSDC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' /* eslint-disable no-secrets/no-secrets */ +const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' +const WETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' const BALANCER_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' describe('BalancerV2PoolConnector', function () { @@ -148,13 +150,13 @@ describe('BalancerV2PoolConnector', function () { const POOL_ID = '0x5c6ee304399dbdb9c8ef030ab642b10820db8f56000200000000000000000014' // BAL-WETH 80/20 const WHALE = '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621' - itHandlesPoolsLiquidityProperly(POOL_ID, tokens.mainnet.WETH, fp(5), WHALE) + itHandlesPoolsLiquidityProperly(POOL_ID, WETH, fp(5), WHALE) }) context('stable pool', () => { const POOL_ID = '0x06df3b2bbb68adc8b0e302443692037ed9f91b42000000000000000000000063' // staBAL3 const WHALE = '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621' - itHandlesPoolsLiquidityProperly(POOL_ID, tokens.mainnet.USDC, toUSDC(500), WHALE) + itHandlesPoolsLiquidityProperly(POOL_ID, USDC, toUSDC(500), WHALE) }) }) diff --git a/packages/connectors/test/balancer/BalancerV2SwapConnector.arbitrum.ts b/packages/connectors/test/balancer/BalancerV2SwapConnector.arbitrum.ts index 08869408..d6536483 100644 --- a/packages/connectors/test/balancer/BalancerV2SwapConnector.arbitrum.ts +++ b/packages/connectors/test/balancer/BalancerV2SwapConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { deploy, deployProxy, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deploy, deployProxy, ZERO_ADDRESS } from '@mimic-fi/helpers' import { itBehavesLikeBalancerV2SwapConnector } from './BalancerV2SwapConnector.behavior' diff --git a/packages/connectors/test/balancer/BalancerV2SwapConnector.behavior.ts b/packages/connectors/test/balancer/BalancerV2SwapConnector.behavior.ts index fea3d614..16825100 100644 --- a/packages/connectors/test/balancer/BalancerV2SwapConnector.behavior.ts +++ b/packages/connectors/test/balancer/BalancerV2SwapConnector.behavior.ts @@ -1,4 +1,4 @@ -import { fp, impersonate, instanceAt, pct, toUSDC, toWBTC } from '@mimic-fi/v3-helpers' +import { fp, impersonate, instanceAt, pct, toUSDC, toWBTC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/balancer/BalancerV2SwapConnector.mainnet.ts b/packages/connectors/test/balancer/BalancerV2SwapConnector.mainnet.ts index f0e4192c..d3e1646e 100644 --- a/packages/connectors/test/balancer/BalancerV2SwapConnector.mainnet.ts +++ b/packages/connectors/test/balancer/BalancerV2SwapConnector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy, deployProxy, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deploy, deployProxy, ZERO_ADDRESS } from '@mimic-fi/helpers' import { itBehavesLikeBalancerV2SwapConnector } from './BalancerV2SwapConnector.behavior' diff --git a/packages/connectors/test/bebop/BebopConnector.arbitrum.ts b/packages/connectors/test/bebop/BebopConnector.arbitrum.ts index 6d23ff33..611d5f19 100644 --- a/packages/connectors/test/bebop/BebopConnector.arbitrum.ts +++ b/packages/connectors/test/bebop/BebopConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeBebopConnector } from './BebopConnector.behavior' diff --git a/packages/connectors/test/bebop/BebopConnector.base.ts b/packages/connectors/test/bebop/BebopConnector.base.ts index afa0844f..7fd4f345 100644 --- a/packages/connectors/test/bebop/BebopConnector.base.ts +++ b/packages/connectors/test/bebop/BebopConnector.base.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeBebopConnector } from './BebopConnector.behavior' diff --git a/packages/connectors/test/bebop/BebopConnector.behavior.ts b/packages/connectors/test/bebop/BebopConnector.behavior.ts index c21d6fcd..92dbfed0 100644 --- a/packages/connectors/test/bebop/BebopConnector.behavior.ts +++ b/packages/connectors/test/bebop/BebopConnector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/connext/ConnextConnector.behavior.ts b/packages/connectors/test/connext/ConnextConnector.behavior.ts index e38f1469..fe941cc8 100644 --- a/packages/connectors/test/connext/ConnextConnector.behavior.ts +++ b/packages/connectors/test/connext/ConnextConnector.behavior.ts @@ -1,4 +1,4 @@ -import { fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/connext/ConnextConnector.bsc.ts b/packages/connectors/test/connext/ConnextConnector.bsc.ts index 7805cd9c..db3f5042 100644 --- a/packages/connectors/test/connext/ConnextConnector.bsc.ts +++ b/packages/connectors/test/connext/ConnextConnector.bsc.ts @@ -1,4 +1,4 @@ -import { deploy, toUSDC } from '@mimic-fi/v3-helpers' +import { deploy, toUSDC } from '@mimic-fi/helpers' import { itBehavesLikeConnextConnector } from './ConnextConnector.behavior' diff --git a/packages/connectors/test/connext/ConnextConnector.optimism.ts b/packages/connectors/test/connext/ConnextConnector.optimism.ts index 3b5ffe6e..ddbc7d83 100644 --- a/packages/connectors/test/connext/ConnextConnector.optimism.ts +++ b/packages/connectors/test/connext/ConnextConnector.optimism.ts @@ -1,4 +1,4 @@ -import { deploy, toUSDC } from '@mimic-fi/v3-helpers' +import { deploy, toUSDC } from '@mimic-fi/helpers' import { itBehavesLikeConnextConnector } from './ConnextConnector.behavior' diff --git a/packages/connectors/test/convex/ConvexConnector.arbitrum.ts b/packages/connectors/test/convex/ConvexConnector.arbitrum.ts index f32d7214..7e49454d 100644 --- a/packages/connectors/test/convex/ConvexConnector.arbitrum.ts +++ b/packages/connectors/test/convex/ConvexConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { advanceTime, deploy, fp, impersonate, instanceAt, MONTH, toUSDC } from '@mimic-fi/v3-helpers' +import { advanceTime, deploy, fp, impersonate, instanceAt, MONTH, toUSDC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/curve/Curve2CrvConnector.arbitrum.ts b/packages/connectors/test/curve/Curve2CrvConnector.arbitrum.ts index 0e6d5e45..87546fba 100644 --- a/packages/connectors/test/curve/Curve2CrvConnector.arbitrum.ts +++ b/packages/connectors/test/curve/Curve2CrvConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { assertAlmostEqual, deploy, fp, impersonate, instanceAt, toUSDC } from '@mimic-fi/v3-helpers' +import { assertAlmostEqual, deploy, fp, impersonate, instanceAt, toUSDC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/erc4626/ERC4626Connector.mainnet.ts b/packages/connectors/test/erc4626/ERC4626Connector.mainnet.ts index 666dc72f..15ad2ea9 100644 --- a/packages/connectors/test/erc4626/ERC4626Connector.mainnet.ts +++ b/packages/connectors/test/erc4626/ERC4626Connector.mainnet.ts @@ -8,7 +8,7 @@ import { MONTH, ONES_ADDRESS, toUSDC, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/helpers/1inch-v5/index.ts b/packages/connectors/test/helpers/1inch-v5/index.ts index 1e43cb66..f07d0f7f 100644 --- a/packages/connectors/test/helpers/1inch-v5/index.ts +++ b/packages/connectors/test/helpers/1inch-v5/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/bebop/index.ts b/packages/connectors/test/helpers/bebop/index.ts index e92321c5..7a2ab956 100644 --- a/packages/connectors/test/helpers/bebop/index.ts +++ b/packages/connectors/test/helpers/bebop/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/kyberswap/index.ts b/packages/connectors/test/helpers/kyberswap/index.ts index 2128f86d..f737b64d 100644 --- a/packages/connectors/test/helpers/kyberswap/index.ts +++ b/packages/connectors/test/helpers/kyberswap/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/odos/index.ts b/packages/connectors/test/helpers/odos/index.ts index b99064ee..0520cf0d 100644 --- a/packages/connectors/test/helpers/odos/index.ts +++ b/packages/connectors/test/helpers/odos/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/paraswap-v5/index.ts b/packages/connectors/test/helpers/paraswap-v5/index.ts index d39702a8..0f466ae9 100644 --- a/packages/connectors/test/helpers/paraswap-v5/index.ts +++ b/packages/connectors/test/helpers/paraswap-v5/index.ts @@ -1,4 +1,4 @@ -import { bn, currentBlockNumber } from '@mimic-fi/v3-helpers' +import { bn, currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/socket/index.ts b/packages/connectors/test/helpers/socket/index.ts index a2eebdf8..ec9dee86 100644 --- a/packages/connectors/test/helpers/socket/index.ts +++ b/packages/connectors/test/helpers/socket/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/helpers/symbiosis/index.ts b/packages/connectors/test/helpers/symbiosis/index.ts index 97fe246f..86bf2871 100644 --- a/packages/connectors/test/helpers/symbiosis/index.ts +++ b/packages/connectors/test/helpers/symbiosis/index.ts @@ -1,4 +1,4 @@ -import { currentBlockNumber } from '@mimic-fi/v3-helpers' +import { currentBlockNumber } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' import fs from 'fs' import hre from 'hardhat' diff --git a/packages/connectors/test/hop/HopBridgeConnector.gnosis.ts b/packages/connectors/test/hop/HopBridgeConnector.gnosis.ts index b7e6c913..e7856541 100644 --- a/packages/connectors/test/hop/HopBridgeConnector.gnosis.ts +++ b/packages/connectors/test/hop/HopBridgeConnector.gnosis.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeHopERC20Connector } from './HopL2ERC20Connector.behavior' import { itBehavesLikeHopNativeConnector } from './HopL2NativeConnector.behavior' diff --git a/packages/connectors/test/hop/HopBridgeConnector.mainnet.ts b/packages/connectors/test/hop/HopBridgeConnector.mainnet.ts index 65011295..62861236 100644 --- a/packages/connectors/test/hop/HopBridgeConnector.mainnet.ts +++ b/packages/connectors/test/hop/HopBridgeConnector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy, fp, impersonate, instanceAt, MAX_UINT256, toUSDC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deploy, fp, impersonate, instanceAt, MAX_UINT256, toUSDC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/hop/HopL2ERC20Connector.behavior.ts b/packages/connectors/test/hop/HopL2ERC20Connector.behavior.ts index 88c16258..92cf0073 100644 --- a/packages/connectors/test/hop/HopL2ERC20Connector.behavior.ts +++ b/packages/connectors/test/hop/HopL2ERC20Connector.behavior.ts @@ -1,4 +1,4 @@ -import { bn, fp, impersonate, instanceAt, MAX_UINT256, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { bn, fp, impersonate, instanceAt, MAX_UINT256, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/hop/HopL2NativeConnector.behavior.ts b/packages/connectors/test/hop/HopL2NativeConnector.behavior.ts index 7b6c7364..85fc310f 100644 --- a/packages/connectors/test/hop/HopL2NativeConnector.behavior.ts +++ b/packages/connectors/test/hop/HopL2NativeConnector.behavior.ts @@ -1,4 +1,4 @@ -import { bn, fp, impersonate, instanceAt, MAX_UINT256, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { bn, fp, impersonate, instanceAt, MAX_UINT256, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/hop/HopSwapConnector.arbitrum.ts b/packages/connectors/test/hop/HopSwapConnector.arbitrum.ts index 6d61f473..92b5023a 100644 --- a/packages/connectors/test/hop/HopSwapConnector.arbitrum.ts +++ b/packages/connectors/test/hop/HopSwapConnector.arbitrum.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeHopSwapConnector } from './HopSwapConnector.behavior' diff --git a/packages/connectors/test/hop/HopSwapConnector.behavior.ts b/packages/connectors/test/hop/HopSwapConnector.behavior.ts index 6c007105..a0a3ead6 100644 --- a/packages/connectors/test/hop/HopSwapConnector.behavior.ts +++ b/packages/connectors/test/hop/HopSwapConnector.behavior.ts @@ -1,4 +1,4 @@ -import { fp, impersonate, instanceAt, toUSDC } from '@mimic-fi/v3-helpers' +import { fp, impersonate, instanceAt, toUSDC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/hop/HopSwapConnector.gnosis.ts b/packages/connectors/test/hop/HopSwapConnector.gnosis.ts index dd9e370d..7ba0ac00 100644 --- a/packages/connectors/test/hop/HopSwapConnector.gnosis.ts +++ b/packages/connectors/test/hop/HopSwapConnector.gnosis.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeHopSwapConnector } from './HopSwapConnector.behavior' diff --git a/packages/connectors/test/kyberswap/KyberSwapV2Connector.base.ts b/packages/connectors/test/kyberswap/KyberSwapV2Connector.base.ts index bf6ce1c9..ec53b4cd 100644 --- a/packages/connectors/test/kyberswap/KyberSwapV2Connector.base.ts +++ b/packages/connectors/test/kyberswap/KyberSwapV2Connector.base.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeKyberSwapV2Connector } from './KyberSwapV2Connector.behavior' diff --git a/packages/connectors/test/kyberswap/KyberSwapV2Connector.behavior.ts b/packages/connectors/test/kyberswap/KyberSwapV2Connector.behavior.ts index 7e056727..c828e5e9 100644 --- a/packages/connectors/test/kyberswap/KyberSwapV2Connector.behavior.ts +++ b/packages/connectors/test/kyberswap/KyberSwapV2Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/kyberswap/KyberSwapV2Connector.mainnet.ts b/packages/connectors/test/kyberswap/KyberSwapV2Connector.mainnet.ts index 8ec9db8f..5dd96199 100644 --- a/packages/connectors/test/kyberswap/KyberSwapV2Connector.mainnet.ts +++ b/packages/connectors/test/kyberswap/KyberSwapV2Connector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeKyberSwapV2Connector } from './KyberSwapV2Connector.behavior' diff --git a/packages/connectors/test/morpho/MorphoAaveV2Connector.mainnet.ts b/packages/connectors/test/morpho/MorphoAaveV2Connector.mainnet.ts index f7f74d75..6f1b8752 100644 --- a/packages/connectors/test/morpho/MorphoAaveV2Connector.mainnet.ts +++ b/packages/connectors/test/morpho/MorphoAaveV2Connector.mainnet.ts @@ -1,13 +1,4 @@ -import { - advanceTime, - assertAlmostEqual, - deploy, - fp, - impersonate, - instanceAt, - MONTH, - toUSDC, -} from '@mimic-fi/v3-helpers' +import { advanceTime, assertAlmostEqual, deploy, fp, impersonate, instanceAt, MONTH, toUSDC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/morpho/MorphoAaveV3Connector.mainnet.ts b/packages/connectors/test/morpho/MorphoAaveV3Connector.mainnet.ts index 479b8a8c..5d60d78a 100644 --- a/packages/connectors/test/morpho/MorphoAaveV3Connector.mainnet.ts +++ b/packages/connectors/test/morpho/MorphoAaveV3Connector.mainnet.ts @@ -1,13 +1,4 @@ -import { - advanceTime, - assertAlmostEqual, - deploy, - fp, - impersonate, - instanceAt, - MONTH, - toUSDC, -} from '@mimic-fi/v3-helpers' +import { advanceTime, assertAlmostEqual, deploy, fp, impersonate, instanceAt, MONTH, toUSDC } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/connectors/test/odos/OdosV2Connector.base.ts b/packages/connectors/test/odos/OdosV2Connector.base.ts index 1bf7028c..a9fc05b9 100644 --- a/packages/connectors/test/odos/OdosV2Connector.base.ts +++ b/packages/connectors/test/odos/OdosV2Connector.base.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeOdosV2Connector } from './OdosV2Connector.behavior' diff --git a/packages/connectors/test/odos/OdosV2Connector.behavior.ts b/packages/connectors/test/odos/OdosV2Connector.behavior.ts index 0ea7a721..ac2ed4b5 100644 --- a/packages/connectors/test/odos/OdosV2Connector.behavior.ts +++ b/packages/connectors/test/odos/OdosV2Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/paraswap/ParaswapV5Connector.behavior.ts b/packages/connectors/test/paraswap/ParaswapV5Connector.behavior.ts index 95563310..e983f075 100644 --- a/packages/connectors/test/paraswap/ParaswapV5Connector.behavior.ts +++ b/packages/connectors/test/paraswap/ParaswapV5Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/socket/SocketConnector.behavior.ts b/packages/connectors/test/socket/SocketConnector.behavior.ts index 6380e3ce..2138173e 100644 --- a/packages/connectors/test/socket/SocketConnector.behavior.ts +++ b/packages/connectors/test/socket/SocketConnector.behavior.ts @@ -1,4 +1,4 @@ -import { fp, impersonate, instanceAt } from '@mimic-fi/v3-helpers' +import { fp, impersonate, instanceAt } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/socket/SocketConnector.bsc.ts b/packages/connectors/test/socket/SocketConnector.bsc.ts index c77d53b7..19b4d659 100644 --- a/packages/connectors/test/socket/SocketConnector.bsc.ts +++ b/packages/connectors/test/socket/SocketConnector.bsc.ts @@ -1,4 +1,4 @@ -import { deploy, fp, tokens } from '@mimic-fi/v3-helpers' +import { deploy, fp } from '@mimic-fi/helpers' import { itBehavesLikeSocketConnector } from './SocketConnector.behavior' @@ -10,7 +10,7 @@ const WHALE = '0x8894e0a0c962cb723c1976a4421c95949be2d4e3' describe('SocketConnector', () => { const fromChainId = 56 - const fromToken = tokens.bsc.USDC + const fromToken = '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' const fromAmount = fp(50000) before('create socket connector', async function () { @@ -19,14 +19,14 @@ describe('SocketConnector', () => { context('to mainnet', () => { const toChainId = 1 - const toToken = tokens.mainnet.USDC + const toToken = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' itBehavesLikeSocketConnector(fromChainId, fromToken, fromAmount, toChainId, toToken, WHALE) }) context('to optimism', () => { const toChainId = 10 - const toToken = tokens.optimism.USDC + const toToken = '0x7F5c764cBc14f9669B88837ca1490cCa17c31607' itBehavesLikeSocketConnector(fromChainId, fromToken, fromAmount, toChainId, toToken, WHALE) }) diff --git a/packages/connectors/test/symbiosis/SymbiosisConnector.behavior.ts b/packages/connectors/test/symbiosis/SymbiosisConnector.behavior.ts index a3085837..8d47dbbb 100644 --- a/packages/connectors/test/symbiosis/SymbiosisConnector.behavior.ts +++ b/packages/connectors/test/symbiosis/SymbiosisConnector.behavior.ts @@ -1,4 +1,4 @@ -import { fp, impersonate, instanceAt } from '@mimic-fi/v3-helpers' +import { fp, impersonate, instanceAt } from '@mimic-fi/helpers' import { expect } from 'chai' import { BigNumber } from 'ethers' diff --git a/packages/connectors/test/symbiosis/SymbiosisConnector.zkevm.ts b/packages/connectors/test/symbiosis/SymbiosisConnector.zkevm.ts index aa9d30c4..1d9ae62f 100644 --- a/packages/connectors/test/symbiosis/SymbiosisConnector.zkevm.ts +++ b/packages/connectors/test/symbiosis/SymbiosisConnector.zkevm.ts @@ -1,4 +1,4 @@ -import { deploy, fp, toUSDC } from '@mimic-fi/v3-helpers' +import { deploy, fp, toUSDC } from '@mimic-fi/helpers' import { itBehavesLikeSymbiosisConnectorBridgingUSDC, diff --git a/packages/connectors/test/uniswap/UniswapV2Connector.behavior.ts b/packages/connectors/test/uniswap/UniswapV2Connector.behavior.ts index 2267777a..3b3676cb 100644 --- a/packages/connectors/test/uniswap/UniswapV2Connector.behavior.ts +++ b/packages/connectors/test/uniswap/UniswapV2Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/uniswap/UniswapV2Connector.mainnet.ts b/packages/connectors/test/uniswap/UniswapV2Connector.mainnet.ts index 8a8fb285..2b7ffcf6 100644 --- a/packages/connectors/test/uniswap/UniswapV2Connector.mainnet.ts +++ b/packages/connectors/test/uniswap/UniswapV2Connector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeUniswapV2Connector } from './UniswapV2Connector.behavior' diff --git a/packages/connectors/test/uniswap/UniswapV2Connector.polygon.ts b/packages/connectors/test/uniswap/UniswapV2Connector.polygon.ts index d2e79405..d4580dfc 100644 --- a/packages/connectors/test/uniswap/UniswapV2Connector.polygon.ts +++ b/packages/connectors/test/uniswap/UniswapV2Connector.polygon.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeUniswapV2Connector } from './UniswapV2Connector.behavior' diff --git a/packages/connectors/test/uniswap/UniswapV3Connector.behavior.ts b/packages/connectors/test/uniswap/UniswapV3Connector.behavior.ts index bcfef2f4..d39dc49b 100644 --- a/packages/connectors/test/uniswap/UniswapV3Connector.behavior.ts +++ b/packages/connectors/test/uniswap/UniswapV3Connector.behavior.ts @@ -1,4 +1,4 @@ -import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deployProxy, fp, impersonate, instanceAt, pct, toUSDC, toWBTC, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/uniswap/UniswapV3Connector.mainnet.ts b/packages/connectors/test/uniswap/UniswapV3Connector.mainnet.ts index 2464977d..c0020482 100644 --- a/packages/connectors/test/uniswap/UniswapV3Connector.mainnet.ts +++ b/packages/connectors/test/uniswap/UniswapV3Connector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeUniswapV3Connector } from './UniswapV3Connector.behavior' diff --git a/packages/connectors/test/uniswap/UniswapV3Connector.polygon.ts b/packages/connectors/test/uniswap/UniswapV3Connector.polygon.ts index a7328c22..fe3a99bd 100644 --- a/packages/connectors/test/uniswap/UniswapV3Connector.polygon.ts +++ b/packages/connectors/test/uniswap/UniswapV3Connector.polygon.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeUniswapV3Connector } from './UniswapV3Connector.behavior' diff --git a/packages/connectors/test/wormhole/WormholeConnector.avalanche.ts b/packages/connectors/test/wormhole/WormholeConnector.avalanche.ts index f1d39991..0ac3a460 100644 --- a/packages/connectors/test/wormhole/WormholeConnector.avalanche.ts +++ b/packages/connectors/test/wormhole/WormholeConnector.avalanche.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeWormholeConnector } from './WormholeConnector.behavior' diff --git a/packages/connectors/test/wormhole/WormholeConnector.behavior.ts b/packages/connectors/test/wormhole/WormholeConnector.behavior.ts index cbce9b37..3035064f 100644 --- a/packages/connectors/test/wormhole/WormholeConnector.behavior.ts +++ b/packages/connectors/test/wormhole/WormholeConnector.behavior.ts @@ -1,4 +1,4 @@ -import { bn, fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { bn, fp, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/connectors/test/wormhole/WormholeConnector.mainnet.ts b/packages/connectors/test/wormhole/WormholeConnector.mainnet.ts index 992135bf..c1c01371 100644 --- a/packages/connectors/test/wormhole/WormholeConnector.mainnet.ts +++ b/packages/connectors/test/wormhole/WormholeConnector.mainnet.ts @@ -1,4 +1,4 @@ -import { deploy } from '@mimic-fi/v3-helpers' +import { deploy } from '@mimic-fi/helpers' import { itBehavesLikeWormholeConnector } from './WormholeConnector.behavior' diff --git a/packages/deployer/hardhat.config.ts b/packages/deployer/hardhat.config.ts index fca1e0b0..d8cd4796 100644 --- a/packages/deployer/hardhat.config.ts +++ b/packages/deployer/hardhat.config.ts @@ -1,6 +1,6 @@ import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-waffle' -import '@mimic-fi/v3-helpers/dist/tests' +import '@mimic-fi/helpers/dist/tests' import 'hardhat-local-networks-config-plugin' import { homedir } from 'os' diff --git a/packages/deployer/package.json b/packages/deployer/package.json index 659857d3..473b7733 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -18,8 +18,8 @@ "prepare": "yarn build" }, "dependencies": { + "@mimic-fi/helpers": "1.0.0", "@mimic-fi/v3-authorizer": "0.1.0", - "@mimic-fi/v3-helpers": "0.1.0", "@mimic-fi/v3-price-oracle": "0.1.0", "@mimic-fi/v3-registry": "0.1.0", "@mimic-fi/v3-smart-vault": "0.1.0", diff --git a/packages/deployer/test/Deployer.test.ts b/packages/deployer/test/Deployer.test.ts index eaa5b786..b520d451 100644 --- a/packages/deployer/test/Deployer.test.ts +++ b/packages/deployer/test/Deployer.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, deploy, getSigners, instanceAt, ZERO_BYTES32 } from '@mimic-fi/v3-helpers' +import { assertEvent, deploy, getSigners, instanceAt, ZERO_BYTES32 } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/fee-controller/contracts/FeeController.sol b/packages/fee-controller/contracts/FeeController.sol index 0c7ffc3c..6ecb706b 100644 --- a/packages/fee-controller/contracts/FeeController.sol +++ b/packages/fee-controller/contracts/FeeController.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import './interfaces/IFeeController.sol'; diff --git a/packages/fee-controller/package.json b/packages/fee-controller/package.json index af102953..7a7b12f6 100644 --- a/packages/fee-controller/package.json +++ b/packages/fee-controller/package.json @@ -18,7 +18,7 @@ "prepare": "yarn build" }, "dependencies": { - "@mimic-fi/v3-helpers": "0.1.0", + "@mimic-fi/helpers": "1.0.0", "@openzeppelin/contracts": "4.9.3" }, "devDependencies": { diff --git a/packages/fee-controller/test/FeeController.test.ts b/packages/fee-controller/test/FeeController.test.ts index 520edcf5..7bdc3a33 100644 --- a/packages/fee-controller/test/FeeController.test.ts +++ b/packages/fee-controller/test/FeeController.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, assertNoEvent, BigNumberish, deploy, fp, getSigners, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, assertNoEvent, BigNumberish, deploy, fp, getSigners, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/helpers/.prettierrc.js b/packages/helpers/.prettierrc.js deleted file mode 100644 index 01dbc74e..00000000 --- a/packages/helpers/.prettierrc.js +++ /dev/null @@ -1,9 +0,0 @@ -const ts = require('eslint-config-mimic/prettier') -const solidity = require('solhint-config-mimic/prettier') - -module.exports = { - overrides: [ - ts, - solidity - ] -} diff --git a/packages/helpers/LICENSE b/packages/helpers/LICENSE deleted file mode 100644 index f288702d..00000000 --- a/packages/helpers/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/packages/helpers/README.md b/packages/helpers/README.md deleted file mode 100644 index 6221d7bc..00000000 --- a/packages/helpers/README.md +++ /dev/null @@ -1,70 +0,0 @@ -

- Mimic Finance -

- -

DeFi automation platform

- -

- - NPM - - - CI Helpers - - - Discord - - - GLP 3.0 - -

- -

- Content • - Setup • - Security • - License -

- ---- - -## Content - -This package contains a bunch of Solidity and TypeScript helpers used among all Mimic v3 repositories. - -## Setup - -To set up this project you'll need [git](https://git-scm.com) and [yarn](https://classic.yarnpkg.com) installed. -From your command line: - -```bash -# Clone this repository -$ git clone https://github.com/mimic-fi/v3-core - -# Go into the repository's package -$ cd v3-core/packages/helpers - -# Install dependencies -$ yarn - -# Run tests to make sure everything is set up correctly -$ yarn test -``` - -## Security - -To read more about our auditing and related security processes please refer to the [security section](https://docs.mimic.fi/miscellaneous/security) of our docs site. - -However, if you found any potential issue in any of our smart contracts or in any piece of code you consider critical -for the safety of the protocol, please contact us through security@mimic.fi. - -## License - -GPL 3.0 - ---- - -> Website [mimic.fi](https://mimic.fi)  ·  -> GitHub [@mimic-fi](https://github.com/mimic-fi)  ·  -> Twitter [@mimicfi](https://twitter.com/mimicfi)  ·  -> Discord [mimic](https://discord.mimic.fi) diff --git a/packages/helpers/contracts/math/FixedPoint.sol b/packages/helpers/contracts/math/FixedPoint.sol deleted file mode 100644 index df98dac3..00000000 --- a/packages/helpers/contracts/math/FixedPoint.sol +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -/** - * @title FixedPoint - * @dev Math library to operate with fixed point values with 18 decimals - */ -library FixedPoint { - // 1 in fixed point value: 18 decimal places - uint256 internal constant ONE = 1e18; - - /** - * @dev Multiplication overflow - */ - error FixedPointMulOverflow(uint256 a, uint256 b); - - /** - * @dev Division by zero - */ - error FixedPointZeroDivision(); - - /** - * @dev Division internal error - */ - error FixedPointDivInternal(uint256 a, uint256 aInflated); - - /** - * @dev Multiplies two fixed point numbers rounding down - */ - function mulDown(uint256 a, uint256 b) internal pure returns (uint256) { - unchecked { - uint256 product = a * b; - if (a != 0 && product / a != b) revert FixedPointMulOverflow(a, b); - return product / ONE; - } - } - - /** - * @dev Multiplies two fixed point numbers rounding up - */ - function mulUp(uint256 a, uint256 b) internal pure returns (uint256) { - unchecked { - uint256 product = a * b; - if (a != 0 && product / a != b) revert FixedPointMulOverflow(a, b); - return product == 0 ? 0 : (((product - 1) / ONE) + 1); - } - } - - /** - * @dev Divides two fixed point numbers rounding down - */ - function divDown(uint256 a, uint256 b) internal pure returns (uint256) { - unchecked { - if (b == 0) revert FixedPointZeroDivision(); - if (a == 0) return 0; - uint256 aInflated = a * ONE; - if (aInflated / a != ONE) revert FixedPointDivInternal(a, aInflated); - return aInflated / b; - } - } - - /** - * @dev Divides two fixed point numbers rounding up - */ - function divUp(uint256 a, uint256 b) internal pure returns (uint256) { - unchecked { - if (b == 0) revert FixedPointZeroDivision(); - if (a == 0) return 0; - uint256 aInflated = a * ONE; - if (aInflated / a != ONE) revert FixedPointDivInternal(a, aInflated); - return ((aInflated - 1) / b) + 1; - } - } -} diff --git a/packages/helpers/contracts/mocks/TokenMock.sol b/packages/helpers/contracts/mocks/TokenMock.sol deleted file mode 100644 index 919b95fb..00000000 --- a/packages/helpers/contracts/mocks/TokenMock.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; - -contract TokenMock is ERC20 { - uint8 internal _decimals; - - constructor(string memory symbol, uint8 dec) ERC20(symbol, symbol) { - _decimals = dec; - } - - function mint(address account, uint256 amount) external { - _mint(account, amount); - } - - function decimals() public view override returns (uint8) { - return _decimals; - } -} diff --git a/packages/helpers/contracts/mocks/WrappedNativeTokenMock.sol b/packages/helpers/contracts/mocks/WrappedNativeTokenMock.sol deleted file mode 100644 index 966e4ce0..00000000 --- a/packages/helpers/contracts/mocks/WrappedNativeTokenMock.sol +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '../utils/IWrappedNativeToken.sol'; - -contract WrappedNativeTokenMock is IWrappedNativeToken { - uint8 public decimals = 18; - string public name = 'Wrapped Native Token'; - string public symbol = 'WNT'; - - event Deposit(address indexed to, uint256 amount); - event Withdrawal(address indexed from, uint256 amount); - - mapping (address => uint256) public override balanceOf; - mapping (address => mapping (address => uint256)) public override allowance; - - receive() external payable { - deposit(); - } - - function deposit() public payable override { - balanceOf[msg.sender] += msg.value; - emit Deposit(msg.sender, msg.value); - } - - function withdraw(uint256 amount) public override { - require(balanceOf[msg.sender] >= amount, 'WNT_NOT_ENOUGH_BALANCE'); - balanceOf[msg.sender] -= amount; - payable(msg.sender).transfer(amount); - emit Withdrawal(msg.sender, amount); - } - - function totalSupply() public view override returns (uint256) { - return address(this).balance; - } - - function approve(address spender, uint256 amount) public override returns (bool) { - allowance[msg.sender][spender] = amount; - emit Approval(msg.sender, spender, amount); - return true; - } - - function transfer(address to, uint256 amount) public override returns (bool) { - return transferFrom(msg.sender, to, amount); - } - - function transferFrom(address from, address to, uint256 amount) public override returns (bool) { - require(balanceOf[from] >= amount, 'NOT_ENOUGH_BALANCE'); - - if (from != msg.sender && allowance[from][msg.sender] != type(uint256).max) { - require(allowance[from][msg.sender] >= amount, 'NOT_ENOUGH_ALLOWANCE'); - allowance[from][msg.sender] -= amount; - } - - balanceOf[from] -= amount; - balanceOf[to] += amount; - emit Transfer(from, to, amount); - return true; - } -} diff --git a/packages/helpers/contracts/test/math/FixedPointMock.sol b/packages/helpers/contracts/test/math/FixedPointMock.sol deleted file mode 100644 index ae3be55d..00000000 --- a/packages/helpers/contracts/test/math/FixedPointMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '../../math/FixedPoint.sol'; - -contract FixedPointMock { - using FixedPoint for uint256; - - function mulUp(uint256 a, uint256 b) external pure returns (uint256) { - return a.mulUp(b); - } - - function mulDown(uint256 a, uint256 b) external pure returns (uint256) { - return a.mulDown(b); - } - - function divUp(uint256 a, uint256 b) external pure returns (uint256) { - return a.divUp(b); - } - - function divDown(uint256 a, uint256 b) external pure returns (uint256) { - return a.divDown(b); - } -} diff --git a/packages/helpers/contracts/test/utils/ArraysMock.sol b/packages/helpers/contracts/test/utils/ArraysMock.sol deleted file mode 100644 index eb6ed216..00000000 --- a/packages/helpers/contracts/test/utils/ArraysMock.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '../../utils/Arrays.sol'; - -library ArraysMock { - function from1(address a, address b) external pure returns (address[] memory result) { - return Arrays.from(a, b); - } - - function from2(address a, address[] memory b, address c) external pure returns (address[] memory result) { - return Arrays.from(a, b, c); - } - - function from3(uint24 a, uint24[] memory b) external pure returns (uint24[] memory result) { - return Arrays.from(a, b); - } - - function from4(bytes32 a, bytes32[] memory b) external pure returns (bytes32[] memory result) { - return Arrays.from(a, b); - } -} diff --git a/packages/helpers/contracts/test/utils/BytesHelpersMock.sol b/packages/helpers/contracts/test/utils/BytesHelpersMock.sol deleted file mode 100644 index 6607c5d1..00000000 --- a/packages/helpers/contracts/test/utils/BytesHelpersMock.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '../../utils/BytesHelpers.sol'; - -library BytesHelpersMock { - function concat1(bytes memory self, address value) external pure returns (bytes memory) { - return BytesHelpers.concat(self, value); - } - - function concat2(bytes memory self, uint24 value) external pure returns (bytes memory) { - return BytesHelpers.concat(self, value); - } - - function toUint256(bytes memory self, uint256 start) external pure returns (uint256) { - return BytesHelpers.toUint256(self, start); - } -} diff --git a/packages/helpers/contracts/test/utils/DenominationsMock.sol b/packages/helpers/contracts/test/utils/DenominationsMock.sol deleted file mode 100644 index ee07532b..00000000 --- a/packages/helpers/contracts/test/utils/DenominationsMock.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '../../utils/Denominations.sol'; - -// solhint-disable func-name-mixedcase - -contract DenominationsMock { - function NATIVE_TOKEN() external pure returns (address) { - return Denominations.NATIVE_TOKEN; - } -} diff --git a/packages/helpers/contracts/test/utils/ERC20HelpersMock.sol b/packages/helpers/contracts/test/utils/ERC20HelpersMock.sol deleted file mode 100644 index 9cf16fdf..00000000 --- a/packages/helpers/contracts/test/utils/ERC20HelpersMock.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '../../utils/ERC20Helpers.sol'; - -contract ERC20HelpersMock { - receive() external payable { - // solhint-disable-previous-line no-empty-blocks - } - - function approve(address token, address to, uint256 amount) external { - ERC20Helpers.approve(token, to, amount); - } - - function transfer(address token, address to, uint256 amount) external { - ERC20Helpers.transfer(token, to, amount); - } - - function balanceOf(address token, address account) external view returns (uint256) { - return ERC20Helpers.balanceOf(token, account); - } -} diff --git a/packages/helpers/contracts/test/utils/EnumerableMapAddressToAddressMock.sol b/packages/helpers/contracts/test/utils/EnumerableMapAddressToAddressMock.sol deleted file mode 100644 index ea0ee0ed..00000000 --- a/packages/helpers/contracts/test/utils/EnumerableMapAddressToAddressMock.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '../../utils/EnumerableMap.sol'; - -// solhint-disable func-name-mixedcase - -contract EnumerableMapAddressToAddressMock { - using EnumerableMap for EnumerableMap.AddressToAddressMap; - - event OperationResult(bool result); - - EnumerableMap.AddressToAddressMap private _map; - - function length() public view returns (uint256) { - return _map.length(); - } - - function contains(address key) public view returns (bool) { - return _map.contains(key); - } - - function set(address key, address value) public { - bool result = _map.set(key, value); - emit OperationResult(result); - } - - function remove(address key) public { - bool result = _map.remove(key); - emit OperationResult(result); - } - - function at(uint256 index) public view returns (address key, address value) { - return _map.at(index); - } - - function get(address key) public view returns (address) { - return _map.get(key); - } - - function tryGet(address key) public view returns (bool exists, address value) { - return _map.tryGet(key); - } - - function keys() public view returns (address[] memory) { - return _map.keys(); - } - - function values() public view returns (address[] memory) { - return _map.values(); - } -} diff --git a/packages/helpers/contracts/test/utils/EnumerableMapAddressToUintMock.sol b/packages/helpers/contracts/test/utils/EnumerableMapAddressToUintMock.sol deleted file mode 100644 index 5951f6be..00000000 --- a/packages/helpers/contracts/test/utils/EnumerableMapAddressToUintMock.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '../../utils/EnumerableMap.sol'; - -// solhint-disable func-name-mixedcase - -contract EnumerableMapAddressToUintMock { - using EnumerableMap for EnumerableMap.AddressToUintMap; - - event OperationResult(bool result); - - EnumerableMap.AddressToUintMap private _map; - - function set(address key, uint256 value) public { - bool result = _map.set(key, value); - emit OperationResult(result); - } - - function remove(address key) public { - bool result = _map.remove(key); - emit OperationResult(result); - } - - function length() public view returns (uint256) { - return _map.length(); - } - - function contains(address key) public view returns (bool) { - return _map.contains(key); - } - - function at(uint256 index) public view returns (address key, uint256 value) { - return _map.at(index); - } - - function get(address key) public view returns (uint256) { - return _map.get(key); - } - - function tryGet(address key) public view returns (bool exists, uint256 value) { - return _map.tryGet(key); - } - - function keys() public view returns (address[] memory) { - return _map.keys(); - } - - function values() public view returns (uint256[] memory) { - return _map.values(); - } -} diff --git a/packages/helpers/contracts/utils/Arrays.sol b/packages/helpers/contracts/utils/Arrays.sol deleted file mode 100644 index 40db8c89..00000000 --- a/packages/helpers/contracts/utils/Arrays.sol +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -/** - * @title Arrays - * @dev Helper methods to operate arrays - */ -library Arrays { - /** - * @dev Builds an array of addresses based on the given ones - */ - function from(address a, address b) internal pure returns (address[] memory result) { - result = new address[](2); - result[0] = a; - result[1] = b; - } - - /** - * @dev Builds an array of addresses based on the given ones - */ - function from(address a, address[] memory b, address c) internal pure returns (address[] memory result) { - result = new address[](b.length + 2); - result[0] = a; - for (uint256 i = 0; i < b.length; i++) { - result[i + 1] = b[i]; - } - result[b.length + 1] = c; - } - - /** - * @dev Builds an array of uint24s based on the given ones - */ - function from(uint24 a, uint24[] memory b) internal pure returns (uint24[] memory result) { - result = new uint24[](b.length + 1); - result[0] = a; - for (uint256 i = 0; i < b.length; i++) { - result[i + 1] = b[i]; - } - } - - /** - * @dev Builds an array of bytes32 based on the given ones - */ - function from(bytes32 a, bytes32[] memory b) internal pure returns (bytes32[] memory result) { - result = new bytes32[](b.length + 1); - result[0] = a; - for (uint256 i = 0; i < b.length; i++) { - result[i + 1] = b[i]; - } - } -} diff --git a/packages/helpers/contracts/utils/BytesHelpers.sol b/packages/helpers/contracts/utils/BytesHelpers.sol deleted file mode 100644 index 4d6076ec..00000000 --- a/packages/helpers/contracts/utils/BytesHelpers.sol +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -/** - * @title BytesHelpers - * @dev Provides a list of Bytes helper methods - */ -library BytesHelpers { - /** - * @dev The length is shorter than start plus 32 - */ - error BytesOutOfBounds(uint256 start, uint256 length); - - /** - * @dev Concatenates an address to a bytes array - */ - function concat(bytes memory self, address value) internal pure returns (bytes memory) { - return abi.encodePacked(self, value); - } - - /** - * @dev Concatenates an uint24 to a bytes array - */ - function concat(bytes memory self, uint24 value) internal pure returns (bytes memory) { - return abi.encodePacked(self, value); - } - - /** - * @dev Decodes a bytes array into an uint256 - */ - function toUint256(bytes memory self) internal pure returns (uint256) { - return toUint256(self, 0); - } - - /** - * @dev Reads an uint256 from a bytes array starting at a given position - */ - function toUint256(bytes memory self, uint256 start) internal pure returns (uint256 result) { - if (self.length < start + 32) revert BytesOutOfBounds(start, self.length); - assembly { - result := mload(add(add(self, 0x20), start)) - } - } -} diff --git a/packages/helpers/contracts/utils/Denominations.sol b/packages/helpers/contracts/utils/Denominations.sol deleted file mode 100644 index 333c8c3e..00000000 --- a/packages/helpers/contracts/utils/Denominations.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -/** - * @title Denominations - * @dev Provides a list of ground denominations for those tokens that cannot be represented by an ERC20. - * For now, the only needed is the native token that could be ETH, MATIC, or other depending on the layer being operated. - */ -library Denominations { - address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; - - // Fiat currencies follow https://en.wikipedia.org/wiki/ISO_4217 - address internal constant USD = address(840); - - function isNativeToken(address token) internal pure returns (bool) { - return token == NATIVE_TOKEN; - } -} diff --git a/packages/helpers/contracts/utils/ERC20Helpers.sol b/packages/helpers/contracts/utils/ERC20Helpers.sol deleted file mode 100644 index 1b1bf56e..00000000 --- a/packages/helpers/contracts/utils/ERC20Helpers.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; - -import './Denominations.sol'; - -/** - * @title ERC20Helpers - * @dev Provides a list of ERC20 helper methods - */ -library ERC20Helpers { - function approve(address token, address to, uint256 amount) internal { - SafeERC20.forceApprove(IERC20(token), to, amount); - } - - function transfer(address token, address to, uint256 amount) internal { - if (Denominations.isNativeToken(token)) Address.sendValue(payable(to), amount); - else SafeERC20.safeTransfer(IERC20(token), to, amount); - } - - function balanceOf(address token, address account) internal view returns (uint256) { - if (Denominations.isNativeToken(token)) return address(account).balance; - else return IERC20(token).balanceOf(address(account)); - } -} diff --git a/packages/helpers/contracts/utils/EnumerableMap.sol b/packages/helpers/contracts/utils/EnumerableMap.sol deleted file mode 100644 index a932a23a..00000000 --- a/packages/helpers/contracts/utils/EnumerableMap.sol +++ /dev/null @@ -1,244 +0,0 @@ -// SPDX-License-Identifier: MIT - -// Based on the EnumerableMap library from OpenZeppelin Contracts - -pragma solidity ^0.8.0; - -import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; - -/** - * @dev Library for managing an enumerable variant of Solidity's - * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] - * type. - * - * Maps have the following properties: - * - * - Entries are added, removed, and checked for existence in constant time - * (O(1)). - * - Entries are enumerated in O(n). No guarantees are made on the ordering. - * - * ``` - * contract Example { - * // Add the library methods - * using EnumerableMap for EnumerableMap.AddressToAddressMap; - * - * // Declare a set state variable - * EnumerableMap.AddressToAddressMap private myMap; - * } - * ``` - */ - -library EnumerableMap { - using EnumerableSet for EnumerableSet.AddressSet; - - /** - * @dev Address to uint map - * @param _keys Set of map keys - * @param _values Map of values - */ - struct AddressToUintMap { - EnumerableSet.AddressSet _keys; - mapping (address => uint256) _values; - } - - /** - * @dev The key doesn't exist in the map - */ - error EnumerableMapNonExistentKey(address key); - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing - * key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(AddressToUintMap storage map, address key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(AddressToUintMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(AddressToUintMap storage map, address key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Return the entire set of keys - */ - function keys(AddressToUintMap storage map) internal view returns (address[] memory) { - return map._keys.values(); - } - - /** - * @dev Return the entire set of values - */ - function values(AddressToUintMap storage map) internal view returns (uint256[] memory items) { - items = new uint256[](length(map)); - for (uint256 i = 0; i < items.length; i++) { - address key = map._keys.at(i); - items[i] = map._values[key]; - } - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly lower than {length}. - */ - function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) { - address key = map._keys.at(index); - return (key, map._values[key]); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(AddressToUintMap storage map, address key) internal view returns (uint256) { - uint256 value = map._values[key]; - if (value == 0 && !contains(map, key)) revert EnumerableMapNonExistentKey(key); - return value; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { - uint256 value = map._values[key]; - if (value == 0) { - return (contains(map, key), 0); - } else { - return (true, value); - } - } - - // AddressToAddressMap - - struct AddressToAddressMap { - EnumerableSet.AddressSet _keys; - mapping (address => address) _values; - } - - /** - * @dev Adds a key-value pair to a map, or updates the value for an existing key. O(1). - * - * Returns true if the key was added to the map, that is if it was not - * already present. - */ - function set(AddressToAddressMap storage map, address key, address value) internal returns (bool) { - map._values[key] = value; - return map._keys.add(key); - } - - /** - * @dev Removes a key-value pair from a map. O(1). - * - * Returns true if the key was removed from the map, that is if it was present. - */ - function remove(AddressToAddressMap storage map, address key) internal returns (bool) { - delete map._values[key]; - return map._keys.remove(key); - } - - /** - * @dev Returns the number of key-value pairs in the map. O(1). - */ - function length(AddressToAddressMap storage map) internal view returns (uint256) { - return map._keys.length(); - } - - /** - * @dev Returns true if the key is in the map. O(1). - */ - function contains(AddressToAddressMap storage map, address key) internal view returns (bool) { - return map._keys.contains(key); - } - - /** - * @dev Return the entire set of keys - */ - function keys(AddressToAddressMap storage map) internal view returns (address[] memory) { - return map._keys.values(); - } - - /** - * @dev Return the entire set of values - */ - function values(AddressToAddressMap storage map) internal view returns (address[] memory items) { - items = new address[](length(map)); - for (uint256 i = 0; i < items.length; i++) { - address key = map._keys.at(i); - items[i] = map._values[key]; - } - } - - /** - * @dev Returns the key-value pair stored at position `index` in the map. O(1). - * - * Note that there are no guarantees on the ordering of entries inside the - * array, and it may change when more entries are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ - function at(AddressToAddressMap storage map, uint256 index) internal view returns (address, address) { - address key = map._keys.at(index); - return (key, map._values[key]); - } - - /** - * @dev Returns the value associated with `key`. O(1). - * - * Requirements: - * - * - `key` must be in the map. - */ - function get(AddressToAddressMap storage map, address key) internal view returns (address) { - address value = map._values[key]; - if (value == address(0) && !contains(map, key)) revert EnumerableMapNonExistentKey(key); - return value; - } - - /** - * @dev Tries to returns the value associated with `key`. O(1). - * Does not revert if `key` is not in the map. - */ - function tryGet(AddressToAddressMap storage map, address key) internal view returns (bool, address) { - address value = map._values[key]; - if (value == address(0)) { - return (contains(map, key), address(0)); - } else { - return (true, value); - } - } -} diff --git a/packages/helpers/contracts/utils/IWrappedNativeToken.sol b/packages/helpers/contracts/utils/IWrappedNativeToken.sol deleted file mode 100644 index 414a0445..00000000 --- a/packages/helpers/contracts/utils/IWrappedNativeToken.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity ^0.8.0; - -import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; - -/** - * @title IWrappedNativeToken - */ -interface IWrappedNativeToken is IERC20 { - /** - * @dev Wraps msg.value into the wrapped-native token - */ - function deposit() external payable; - - /** - * @dev Unwraps requested amount to the native token - */ - function withdraw(uint256 amount) external; -} diff --git a/packages/helpers/hardhat.config.ts b/packages/helpers/hardhat.config.ts deleted file mode 100644 index 6b4bec75..00000000 --- a/packages/helpers/hardhat.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import '@nomiclabs/hardhat-ethers' -import '@nomiclabs/hardhat-waffle' - -export default { - solidity: { - version: '0.8.17', - settings: { - optimizer: { - enabled: true, - runs: 10000, - }, - }, - }, -} diff --git a/packages/helpers/index.ts b/packages/helpers/index.ts deleted file mode 100644 index 2d0247aa..00000000 --- a/packages/helpers/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './src/addresses' -export * from './src/asserts' -export * from './src/blocks' -export * from './src/constants' -export * from './src/contracts' -export * from './src/mocks' -export * from './src/numbers' -export * from './src/signers' -export * from './src/tests' -export * from './src/time' diff --git a/packages/helpers/package.json b/packages/helpers/package.json deleted file mode 100644 index 56b5a7e9..00000000 --- a/packages/helpers/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@mimic-fi/v3-helpers", - "version": "0.1.12", - "license": "GPL-3.0", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "artifacts/contracts/**/*", - "!artifacts/contracts/test/*", - "contracts/**/*", - "!contracts/test/*", - "dist" - ], - "scripts": { - "build": "yarn compile && rm -rf dist && tsc", - "compile": "hardhat compile", - "lint": "yarn lint:solidity && yarn lint:typescript", - "lint:solidity": "solhint 'contracts/**/*.sol' --config ../../node_modules/solhint-config-mimic/index.js", - "lint:typescript": "eslint . --ext .ts", - "test": "hardhat test", - "prepare": "yarn build" - }, - "dependencies": { - "@nomiclabs/hardhat-ethers": "^2.2.3", - "@nomiclabs/hardhat-waffle": "2.0.3", - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "@types/sinon-chai": "^3.2.3", - "chai": "^4.3.7", - "decimal.js": "~10.4.3", - "ethers": "~5.6.0", - "hardhat": "^2.14.1", - "mocha": "^6.2.3" - }, - "devDependencies": { - "eslint-config-mimic": "^0.0.2", - "ethereum-waffle": "^3.4.4", - "solhint-config-mimic": "^0.0.3", - "ts-node": "^10.9.1", - "typescript": "~4.3.4" - }, - "eslintConfig": { - "extends": "eslint-config-mimic", - "ignorePatterns": ["dist"] - } -} diff --git a/packages/helpers/src/addresses/chainlink/arbitrum.ts b/packages/helpers/src/addresses/chainlink/arbitrum.ts deleted file mode 100644 index 7bc0b751..00000000 --- a/packages/helpers/src/addresses/chainlink/arbitrum.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const DAI_USD = '0xc5C8E77B397E531B8EC06BFb0048328B30E9eCfB' -export const ETH_USD = '0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612' -export const USDC_USD = '0x50834F3163758fcC1Df9973b6e91f0F0F0434aD3' -export const USDT_USD = '0x3f3f5dF88dC9F13eac63DF89EC16ef6e7E25DdE7' diff --git a/packages/helpers/src/addresses/chainlink/avalanche.ts b/packages/helpers/src/addresses/chainlink/avalanche.ts deleted file mode 100644 index 1b9e6d27..00000000 --- a/packages/helpers/src/addresses/chainlink/avalanche.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const AVAX_USD = '0x0A77230d17318075983913bC2145DB16C7366156' -export const ETH_USD = '0x976B3D034E162d8bD72D6b9C989d545b839003b0' -export const DAI_USD = '0x51D7180edA2260cc4F6e4EebB82FEF5c3c2B8300' -export const USDC_USD = '0xF096872672F44d6EBA71458D74fe67F9a77a23B9' -export const USDT_USD = '0xEBE676ee90Fe1112671f19b6B7459bC678B67e8a' diff --git a/packages/helpers/src/addresses/chainlink/base.ts b/packages/helpers/src/addresses/chainlink/base.ts deleted file mode 100644 index a520b41b..00000000 --- a/packages/helpers/src/addresses/chainlink/base.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_USD = '0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70' -export const DAI_USD = '0x591e79239a7d679378eC8c847e5038150364C78F' -export const USDC_USD = '0x7e860098F58bBFC8648a4311b374B1D669a2bc6B' -export const USDT_USD = '0xf19d560eB8d2ADf07BD6D13ed03e1D11215721F9' diff --git a/packages/helpers/src/addresses/chainlink/bsc.ts b/packages/helpers/src/addresses/chainlink/bsc.ts deleted file mode 100644 index e1edab08..00000000 --- a/packages/helpers/src/addresses/chainlink/bsc.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const BNB_USD = '0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE' -export const ETH_USD = '0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e' -export const DAI_USD = '0x132d3C0B1D2cEa0BC552588063bdBb210FDeecfA' -export const USDC_USD = '0x51597f405303C4377E36123cBc172b13269EA163' -export const USDT_USD = '0xB97Ad0E74fa7d920791E90258A6E2085088b4320' diff --git a/packages/helpers/src/addresses/chainlink/denominations.ts b/packages/helpers/src/addresses/chainlink/denominations.ts deleted file mode 100644 index a5c24343..00000000 --- a/packages/helpers/src/addresses/chainlink/denominations.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USD = '0x0000000000000000000000000000000000000348' diff --git a/packages/helpers/src/addresses/chainlink/fantom.ts b/packages/helpers/src/addresses/chainlink/fantom.ts deleted file mode 100644 index 64ea4034..00000000 --- a/packages/helpers/src/addresses/chainlink/fantom.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const FTM_USD = '0xf4766552D15AE4d256Ad41B6cf2933482B0680dc' -export const ETH_USD = '0x11DdD3d147E5b83D01cee7070027092397d63658' -export const DAI_USD = '0x91d5DEFAFfE2854C7D02F50c80FA1fdc8A721e52' -export const USDC_USD = '0x2553f4eeb82d5A26427b8d1106C51499CBa5D99c' -export const USDT_USD = '0xF64b636c5dFe1d3555A847341cDC449f612307d0' diff --git a/packages/helpers/src/addresses/chainlink/gnosis.ts b/packages/helpers/src/addresses/chainlink/gnosis.ts deleted file mode 100644 index 56127e3b..00000000 --- a/packages/helpers/src/addresses/chainlink/gnosis.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const DAI_USD = '0x678df3415fc31947dA4324eC63212874be5a82f8' -export const ETH_USD = '0xa767f745331D267c7751297D982b050c93985627' -export const USDC_USD = '0x26C31ac71010aF62E6B486D1132E266D6298857D' -export const USDT_USD = '0x68811D7DF835B1c33e6EEae8E7C141eF48d48cc7' diff --git a/packages/helpers/src/addresses/chainlink/goerli.ts b/packages/helpers/src/addresses/chainlink/goerli.ts deleted file mode 100644 index 7a837211..00000000 --- a/packages/helpers/src/addresses/chainlink/goerli.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_USD = '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e' diff --git a/packages/helpers/src/addresses/chainlink/index.ts b/packages/helpers/src/addresses/chainlink/index.ts deleted file mode 100644 index 31fecf39..00000000 --- a/packages/helpers/src/addresses/chainlink/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * as arbitrum from './arbitrum' -export * as avalanche from './avalanche' -export * as bsc from './bsc' -export * as denominations from './denominations' -export * as fantom from './fantom' -export * as gnosis from './gnosis' -export * as goerli from './goerli' -export * as mainnet from './mainnet' -export * as mumbai from './mumbai' -export * as optimism from './optimism' -export * as polygon from './polygon' diff --git a/packages/helpers/src/addresses/chainlink/mainnet.ts b/packages/helpers/src/addresses/chainlink/mainnet.ts deleted file mode 100644 index 4e8bb3ac..00000000 --- a/packages/helpers/src/addresses/chainlink/mainnet.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USDC_ETH = '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4' -export const USDT_ETH = '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46' -export const DAI_ETH = '0x773616E4d11A78F511299002da57A0a94577F1f4' -export const MANA_ETH = '0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9' -export const BAL_ETH = '0xC1438AA3823A6Ba0C159CfA8D98dF5A994bA120b' -export const ETH_USD = '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419' diff --git a/packages/helpers/src/addresses/chainlink/mumbai.ts b/packages/helpers/src/addresses/chainlink/mumbai.ts deleted file mode 100644 index 3fe0fde1..00000000 --- a/packages/helpers/src/addresses/chainlink/mumbai.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const MATIC_USD = '0xd0D5e3DB44DE05E9F294BB0a3bEEaF030DE24Ada' diff --git a/packages/helpers/src/addresses/chainlink/optimism.ts b/packages/helpers/src/addresses/chainlink/optimism.ts deleted file mode 100644 index 6c96f185..00000000 --- a/packages/helpers/src/addresses/chainlink/optimism.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const DAI_USD = '0x8dBa75e83DA73cc766A7e5a0ee71F656BAb470d6' -export const ETH_USD = '0x13e3Ee699D1909E989722E753853AE30b17e08c5' -export const USDC_USD = '0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3' -export const USDT_USD = '0xECef79E109e997bCA29c1c0897ec9d7b03647F5E' diff --git a/packages/helpers/src/addresses/chainlink/polygon.ts b/packages/helpers/src/addresses/chainlink/polygon.ts deleted file mode 100644 index ed23acd6..00000000 --- a/packages/helpers/src/addresses/chainlink/polygon.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const DAI_USD = '0x4746DeC9e833A82EC7C2C1356372CcF2cfcD2F3D' -export const ETH_USD = '0xF9680D99D6C9589e2a93a78A04A279e509205945' -export const USDC_USD = '0xfE4A8cc5b5B2366C1B58Bea3858e81843581b2F7' -export const USDT_USD = '0x0A6513e40db6EB1b165753AD52E80663aeA50545' -export const MATIC_USD = '0xAB594600376Ec9fD91F8e885dADF0CE036862dE0' diff --git a/packages/helpers/src/addresses/hop/arbitrum.ts b/packages/helpers/src/addresses/hop/arbitrum.ts deleted file mode 100644 index 009790dd..00000000 --- a/packages/helpers/src/addresses/hop/arbitrum.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_AMM = '0x33ceb27b39d2Bb7D2e61F7564d3Df29344020417' -export const DAI_AMM = '0xe7F40BF16AB09f4a6906Ac2CAA4094aD2dA48Cc2' -export const USDC_AMM = '0xe22D2beDb3Eca35E6397e0C6D62857094aA26F52' -export const USDT_AMM = '0xCB0a4177E0A60247C0ad18Be87f8eDfF6DD30283' diff --git a/packages/helpers/src/addresses/hop/base.ts b/packages/helpers/src/addresses/hop/base.ts deleted file mode 100644 index 5d6b15c7..00000000 --- a/packages/helpers/src/addresses/hop/base.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_AMM = '0x10541b07d8Ad2647Dc6cD67abd4c03575dade261' -export const USDC_AMM = '0x7D269D3E0d61A05a0bA976b7DBF8805bF844AF3F' diff --git a/packages/helpers/src/addresses/hop/gnosis.ts b/packages/helpers/src/addresses/hop/gnosis.ts deleted file mode 100644 index 6babdd95..00000000 --- a/packages/helpers/src/addresses/hop/gnosis.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH_AMM = '0x03D7f750777eC48d39D080b020D83Eb2CB4e3547' -export const DAI_AMM = '0x6C928f435d1F3329bABb42d69CCF043e3900EcF1' -export const USDC_AMM = '0x76b22b8C1079A44F1211D867D68b1eda76a635A7' -export const USDT_AMM = '0x49094a1B3463c4e2E82ca41b8e6A023bdd6E222f' diff --git a/packages/helpers/src/addresses/hop/goerli.ts b/packages/helpers/src/addresses/hop/goerli.ts deleted file mode 100644 index 389e6ab2..00000000 --- a/packages/helpers/src/addresses/hop/goerli.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_BRIDGE = '0xC8A4FB931e8D77df8497790381CA7d228E68a41b' -export const USDC_BRIDGE = '0x7D269D3E0d61A05a0bA976b7DBF8805bF844AF3F' diff --git a/packages/helpers/src/addresses/hop/index.ts b/packages/helpers/src/addresses/hop/index.ts deleted file mode 100644 index c9eca721..00000000 --- a/packages/helpers/src/addresses/hop/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * as arbitrum from './arbitrum' -export * as base from './base' -export * as gnosis from './gnosis' -export * as goerli from './goerli' -export * as mainnet from './mainnet' -export * as mumbai from './mumbai' -export * as optimism from './optimism' -export * as polygon from './polygon' diff --git a/packages/helpers/src/addresses/hop/mainnet.ts b/packages/helpers/src/addresses/hop/mainnet.ts deleted file mode 100644 index 8b63cf6a..00000000 --- a/packages/helpers/src/addresses/hop/mainnet.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_BRIDGE = '0xb8901acB165ed027E32754E0FFe830802919727f' -export const DAI_BRIDGE = '0x3d4Cc8A61c7528Fd86C55cfe061a78dCBA48EDd1' -export const USDC_BRIDGE = '0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a' -export const USDT_BRIDGE = '0x3E4a3a4796d16c0Cd582C382691998f7c06420B6' diff --git a/packages/helpers/src/addresses/hop/mumbai.ts b/packages/helpers/src/addresses/hop/mumbai.ts deleted file mode 100644 index e3773fc3..00000000 --- a/packages/helpers/src/addresses/hop/mumbai.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USDC_AMM = '0xa81D244A1814468C734E5b4101F7b9c0c577a8fC' -export const WETH_AMM = '0x0e0E3d2C5c292161999474247956EF542caBF8dd' diff --git a/packages/helpers/src/addresses/hop/optimism.ts b/packages/helpers/src/addresses/hop/optimism.ts deleted file mode 100644 index b95a75e7..00000000 --- a/packages/helpers/src/addresses/hop/optimism.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_AMM = '0x86cA30bEF97fB651b8d866D45503684b90cb3312' -export const DAI_AMM = '0xb3C68a491608952Cb1257FC9909a537a0173b63B' -export const USDC_AMM = '0x2ad09850b0CA4c7c1B33f5AcD6cBAbCaB5d6e796' -export const USDT_AMM = '0x7D269D3E0d61A05a0bA976b7DBF8805bF844AF3F' diff --git a/packages/helpers/src/addresses/hop/polygon.ts b/packages/helpers/src/addresses/hop/polygon.ts deleted file mode 100644 index 5a4801e5..00000000 --- a/packages/helpers/src/addresses/hop/polygon.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ETH_AMM = '0xc315239cFb05F1E130E7E28E603CEa4C014c57f0' -export const DAI_AMM = '0x28529fec439cfF6d7D1D5917e956dEE62Cd3BE5c' -export const USDC_AMM = '0x76b22b8C1079A44F1211D867D68b1eda76a635A7' -export const USDT_AMM = '0x8741Ba6225A6BF91f9D73531A98A89807857a2B3' diff --git a/packages/helpers/src/addresses/index.ts b/packages/helpers/src/addresses/index.ts deleted file mode 100644 index a62c699b..00000000 --- a/packages/helpers/src/addresses/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * as chainlink from './chainlink' -export * as hop from './hop' -export * as protocols from './protocols' -export * as tokens from './tokens' diff --git a/packages/helpers/src/addresses/protocols/arbitrum.ts b/packages/helpers/src/addresses/protocols/arbitrum.ts deleted file mode 100644 index b58f7e07..00000000 --- a/packages/helpers/src/addresses/protocols/arbitrum.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const UNISWAP_V3_ROUTER = '0xE592427A0AEce92De3Edee1F18E0157C05861564' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0xe432150cce91c13a887f7D836923d5597adD8E31' -export const CONNEXT_ENTRYPOINT = '0xEE9deC2712cCE65174B561151701Bf54b99C24C8' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/aurora.ts b/packages/helpers/src/addresses/protocols/aurora.ts deleted file mode 100644 index 3911e342..00000000 --- a/packages/helpers/src/addresses/protocols/aurora.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' diff --git a/packages/helpers/src/addresses/protocols/avalanche.ts b/packages/helpers/src/addresses/protocols/avalanche.ts deleted file mode 100644 index d7753fd7..00000000 --- a/packages/helpers/src/addresses/protocols/avalanche.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const SUSHI_SWAP_ROUTER = '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0x5029C0EFf6C34351a0CEc334542cDb22c7928f78' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/base.ts b/packages/helpers/src/addresses/protocols/base.ts deleted file mode 100644 index 0177da57..00000000 --- a/packages/helpers/src/addresses/protocols/base.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' -export const PARASWAP_V5_AUGUSTUS = '0x59C7C832e96D2568bea6db468C1aAdcbbDa08A52' - -export const AXELAR_GATEWAY = '0xe432150cce91c13a887f7D836923d5597adD8E31' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/bsc.ts b/packages/helpers/src/addresses/protocols/bsc.ts deleted file mode 100644 index 00a5682f..00000000 --- a/packages/helpers/src/addresses/protocols/bsc.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const SUSHI_SWAP_ROUTER = '0xc35dadb65012ec5796536bd9864ed8773abc74c4' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0x304acf330bbE08d1e512eefaa92F6a57871fD895' -export const CONNEXT_ENTRYPOINT = '0xCd401c10afa37d641d2F594852DA94C700e4F2CE' diff --git a/packages/helpers/src/addresses/protocols/fantom.ts b/packages/helpers/src/addresses/protocols/fantom.ts deleted file mode 100644 index cc98b6e5..00000000 --- a/packages/helpers/src/addresses/protocols/fantom.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const SUSHI_SWAP_ROUTER = '0xc35dadb65012ec5796536bd9864ed8773abc74c4' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0x304acf330bbE08d1e512eefaa92F6a57871fD895' diff --git a/packages/helpers/src/addresses/protocols/gnosis.ts b/packages/helpers/src/addresses/protocols/gnosis.ts deleted file mode 100644 index e86df542..00000000 --- a/packages/helpers/src/addresses/protocols/gnosis.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const HONEY_SWAP_ROUTER = '0x1c232f01118cb8b424793ae03f870aa7d0ac7f77' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const CONNEXT_ENTRYPOINT = '0x5bB83e95f63217CDa6aE3D181BA580Ef377D2109' diff --git a/packages/helpers/src/addresses/protocols/index.ts b/packages/helpers/src/addresses/protocols/index.ts deleted file mode 100644 index 830065d7..00000000 --- a/packages/helpers/src/addresses/protocols/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * as arbitrum from './arbitrum' -export * as aurora from './aurora' -export * as avalanche from './avalanche' -export * as base from './base' -export * as bsc from './bsc' -export * as fantom from './fantom' -export * as gnosis from './gnosis' -export * as mainnet from './mainnet' -export * as optimism from './optimism' -export * as polygon from './polygon' -export * as zkevm from './zkevm' -export * as zksync from './zksync' diff --git a/packages/helpers/src/addresses/protocols/mainnet.ts b/packages/helpers/src/addresses/protocols/mainnet.ts deleted file mode 100644 index 219de5f1..00000000 --- a/packages/helpers/src/addresses/protocols/mainnet.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const UNISWAP_V2_ROUTER = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D' -export const UNISWAP_V3_ROUTER = '0xE592427A0AEce92De3Edee1F18E0157C05861564' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0x4F4495243837681061C4743b74B3eEdf548D56A5' -export const CONNEXT_ENTRYPOINT = '0x8898B472C54c31894e3B9bb83cEA802a5d0e63C6' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/optimism.ts b/packages/helpers/src/addresses/protocols/optimism.ts deleted file mode 100644 index 71eb415a..00000000 --- a/packages/helpers/src/addresses/protocols/optimism.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const UNISWAP_V3_ROUTER = '0xE592427A0AEce92De3Edee1F18E0157C05861564' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const CONNEXT_ENTRYPOINT = '0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/polygon.ts b/packages/helpers/src/addresses/protocols/polygon.ts deleted file mode 100644 index 24c0afde..00000000 --- a/packages/helpers/src/addresses/protocols/polygon.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const QUICK_SWAP_ROUTER = '0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff' -export const UNISWAP_V3_ROUTER = '0xE592427A0AEce92De3Edee1F18E0157C05861564' -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' - -export const AXELAR_GATEWAY = '0x6f015F16De9fC8791b234eF68D486d2bF203FBA8' -export const CONNEXT_ENTRYPOINT = '0x11984dc4465481512eb5b777E44061C158CF2259' -export const WORMHOLE_CIRCLE_RELAYER = '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2' diff --git a/packages/helpers/src/addresses/protocols/zkevm.ts b/packages/helpers/src/addresses/protocols/zkevm.ts deleted file mode 100644 index 64d500e9..00000000 --- a/packages/helpers/src/addresses/protocols/zkevm.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const BALANCER_V2_VAULT = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' -export const PARASWAP_V5_AUGUSTUS = '0xb83b554730d29ce4cb55bb42206c3e2c03e4a40a' diff --git a/packages/helpers/src/addresses/protocols/zksync.ts b/packages/helpers/src/addresses/protocols/zksync.ts deleted file mode 100644 index 3911e342..00000000 --- a/packages/helpers/src/addresses/protocols/zksync.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const ONE_INCH_V5_ROUTER = '0x1111111254EEB25477B68fb85Ed929f73A960582' diff --git a/packages/helpers/src/addresses/tokens/arbitrum.ts b/packages/helpers/src/addresses/tokens/arbitrum.ts deleted file mode 100644 index 2431341c..00000000 --- a/packages/helpers/src/addresses/tokens/arbitrum.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' -export const DAI = '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1' -export const USDCe = '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' -export const USDC = '0xaf88d065e77c8cc2239327c5edb3a432268e5831' -export const USDT = '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9' diff --git a/packages/helpers/src/addresses/tokens/aurora.ts b/packages/helpers/src/addresses/tokens/aurora.ts deleted file mode 100644 index 98d3b9ac..00000000 --- a/packages/helpers/src/addresses/tokens/aurora.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB' -export const USDCe = '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802' -export const USDT = '0x4988a896b1227218e4A686fdE5EabdcAbd91571f' -export const DAI = '0xe3520349F477A5F6EB06107066048508498A291b' diff --git a/packages/helpers/src/addresses/tokens/avalanche.ts b/packages/helpers/src/addresses/tokens/avalanche.ts deleted file mode 100644 index cacaaf31..00000000 --- a/packages/helpers/src/addresses/tokens/avalanche.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WAVAX = '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7' -export const WETH = '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB' -export const DAI = '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70' -export const USDC = '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' -export const USDT = '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7' diff --git a/packages/helpers/src/addresses/tokens/base.ts b/packages/helpers/src/addresses/tokens/base.ts deleted file mode 100644 index 9d674972..00000000 --- a/packages/helpers/src/addresses/tokens/base.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0x4200000000000000000000000000000000000006' -export const DAI = '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb' -export const USDC = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' diff --git a/packages/helpers/src/addresses/tokens/bsc.ts b/packages/helpers/src/addresses/tokens/bsc.ts deleted file mode 100644 index 344389bf..00000000 --- a/packages/helpers/src/addresses/tokens/bsc.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WBNB = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' -export const WETH = '0x2170Ed0880ac9A755fd29B2688956BD959F933F8' -export const DAI = '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3' -export const USDCe = '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' -export const USDT = '0x55d398326f99059ff775485246999027b3197955' -export const PSP = '0xcafe001067cdef266afb7eb5a286dcfd277f3de5' diff --git a/packages/helpers/src/addresses/tokens/fantom.ts b/packages/helpers/src/addresses/tokens/fantom.ts deleted file mode 100644 index 97f67bba..00000000 --- a/packages/helpers/src/addresses/tokens/fantom.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WFTM = '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83' -export const WETH = '0x74b23882a30290451A17c44f4F05243b6b58C76d' -export const DAI = '0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E' -export const USDCe = '0x28a92dde19d9989f39a49905d7c9c2fac7799bdf' -export const USDT = '0x049d68029688eabf473097a2fc38ef61633a3c7a' -export const PSP = '0xcafe001067cdef266afb7eb5a286dcfd277f3de5' diff --git a/packages/helpers/src/addresses/tokens/gnosis.ts b/packages/helpers/src/addresses/tokens/gnosis.ts deleted file mode 100644 index cbc293d7..00000000 --- a/packages/helpers/src/addresses/tokens/gnosis.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WXDAI = '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d' -export const WETH = '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1' -export const USDC = '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' -export const USDT = '0x4ECaBa5870353805a9F068101A40E0f32ed605C6' diff --git a/packages/helpers/src/addresses/tokens/goerli.ts b/packages/helpers/src/addresses/tokens/goerli.ts deleted file mode 100644 index b96e84b9..00000000 --- a/packages/helpers/src/addresses/tokens/goerli.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USDC = '0x98339D8C260052B7ad81c28c16C0b98420f2B46a' -export const WETH = '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6' diff --git a/packages/helpers/src/addresses/tokens/index.ts b/packages/helpers/src/addresses/tokens/index.ts deleted file mode 100644 index 58f0ad4c..00000000 --- a/packages/helpers/src/addresses/tokens/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * as arbitrum from './arbitrum' -export * as aurora from './aurora' -export * as avalanche from './avalanche' -export * as base from './base' -export * as bsc from './bsc' -export * as fantom from './fantom' -export * as gnosis from './gnosis' -export * as goerli from './goerli' -export * as mainnet from './mainnet' -export * as mumbai from './mumbai' -export * as optimism from './optimism' -export * as polygon from './polygon' -export * as zkevm from './zkevm' -export * as zksync from './zksync' diff --git a/packages/helpers/src/addresses/tokens/mainnet.ts b/packages/helpers/src/addresses/tokens/mainnet.ts deleted file mode 100644 index 4503c4e8..00000000 --- a/packages/helpers/src/addresses/tokens/mainnet.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' -export const USDT = '0xdAC17F958D2ee523a2206206994597C13D831ec7' -export const WETH = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' -export const DAI = '0x6B175474E89094C44Da98b954EedeAC495271d0F' -export const MANA = '0x0F5D2fB29fb7d3CFeE444a200298f468908cC942' -export const PSP = '0xcafe001067cdef266afb7eb5a286dcfd277f3de5' -export const BAL = '0xba100000625a3754423978a60c9317c58a424e3D' -export const AURA_BAL = '0x616e8bfa43f920657b3497dbf40d6b1a02d4608d' diff --git a/packages/helpers/src/addresses/tokens/mumbai.ts b/packages/helpers/src/addresses/tokens/mumbai.ts deleted file mode 100644 index 9300b59f..00000000 --- a/packages/helpers/src/addresses/tokens/mumbai.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const USDC = '0x6D4dd09982853F08d9966aC3cA4Eb5885F16f2b2' -export const WETH = '0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa' -export const WMATIC = '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889' diff --git a/packages/helpers/src/addresses/tokens/optimism.ts b/packages/helpers/src/addresses/tokens/optimism.ts deleted file mode 100644 index d5872e0b..00000000 --- a/packages/helpers/src/addresses/tokens/optimism.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0x4200000000000000000000000000000000000006' -export const DAI = '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' -export const USDC = '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' -export const USDCe = '0x7F5c764cBc14f9669B88837ca1490cCa17c31607' -export const USDT = '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58' -export const BAL = '0xfe8b128ba8c78aabc59d4c64cee7ff28e9379921' diff --git a/packages/helpers/src/addresses/tokens/polygon.ts b/packages/helpers/src/addresses/tokens/polygon.ts deleted file mode 100644 index 4fb5f167..00000000 --- a/packages/helpers/src/addresses/tokens/polygon.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WMATIC = '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270' -export const WETH = '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619' -export const USDC = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' -export const USDCe = '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' -export const USDT = '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' -export const DAI = '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063' -export const PSP = '0x42d61d766b85431666b39b89c43011f24451bff6' diff --git a/packages/helpers/src/addresses/tokens/zkevm.ts b/packages/helpers/src/addresses/tokens/zkevm.ts deleted file mode 100644 index 05f9c744..00000000 --- a/packages/helpers/src/addresses/tokens/zkevm.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9' -export const DAI = '0xc5015b9d9161dca7e18e32f6f25c4ad850731fd4' -export const USDCe = '0x37eAA0eF3549a5Bb7D431be78a3D99BD360d19e5' -export const USDT = '0x1e4a5963abfd975d8c9021ce480b42188849d41d' diff --git a/packages/helpers/src/addresses/tokens/zksync.ts b/packages/helpers/src/addresses/tokens/zksync.ts deleted file mode 100644 index 8f1553af..00000000 --- a/packages/helpers/src/addresses/tokens/zksync.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable no-secrets/no-secrets */ - -export const WETH = '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91' -export const USDCe = '0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4' -export const USDT = '0x493257fD37EDB34451f62EDf8D2a0C418852bA4C' diff --git a/packages/helpers/src/asserts.ts b/packages/helpers/src/asserts.ts deleted file mode 100644 index fbb69401..00000000 --- a/packages/helpers/src/asserts.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { expect } from 'chai' -import { BigNumber, Contract, ContractTransaction } from 'ethers' -import { Interface, LogDescription } from 'ethers/lib/utils' - -import { pct } from './numbers' - -// Ported from @openzeppelin/test-helpers to use with Ethers. The Test Helpers don't -// yet have Typescript typings, so we're being lax about them here. -// See https://github.com/OpenZeppelin/openzeppelin-test-helpers/issues/122 - -/* eslint-disable @typescript-eslint/no-explicit-any */ - -export function assertAlmostEqual(actual: BigNumber, expected: BigNumber, error: number): void { - const abs = pct(expected, error) - expect(actual).to.be.at.least(expected.sub(abs)) - expect(actual).to.be.at.most(expected.add(abs)) -} - -export async function assertEvent(tx: ContractTransaction, eventName: string, eventArgs = {}): Promise { - const receipt = await tx.wait() - - if (receipt.events == undefined) { - throw new Error('No events found in receipt') - } - - const events = receipt.events.filter((e) => e.event === eventName) - expect(events.length > 0).to.equal(true, `No '${eventName}' events found`) - - const exceptions: Array = [] - const event = events.find(function (e) { - for (const [k, v] of Object.entries(eventArgs)) { - try { - if (e.args == undefined) { - throw new Error('Event has no arguments') - } - - contains(e.args, k, v) - } catch (error) { - exceptions.push(error as string) - return false - } - } - return true - }) - - if (event === undefined) { - // Each event entry may have failed to match for different reasons, - // throw the first one - throw exceptions[0] - } - - return event -} - -export async function assertIndirectEvent( - tx: ContractTransaction, - emitter: Interface, - eventName: string, - eventArgs = {} -): Promise { - const receipt = await tx.wait() - const decodedEvents = receipt.logs - .map((log) => { - try { - return emitter.parseLog(log) - } catch { - return undefined - } - }) - .filter((e): e is LogDescription => e !== undefined) - - const expectedEvents = decodedEvents.filter((event) => event.name === eventName) - expect(expectedEvents.length > 0).to.equal(true, `No '${eventName}' events found`) - - const exceptions: Array = [] - const event = expectedEvents.find(function (e) { - for (const [k, v] of Object.entries(eventArgs)) { - try { - if (e.args == undefined) { - throw new Error('Event has no arguments') - } - - contains(e.args, k, v) - } catch (error) { - exceptions.push(error as string) - return false - } - } - return true - }) - - if (event === undefined) { - // Each event entry may have failed to match for different reasons, - // throw the first one - throw exceptions[0] - } - - return event -} - -export async function assertNoEvent(tx: ContractTransaction, eventName: string): Promise { - const receipt = await tx.wait() - if (receipt.events != undefined) { - const events = receipt.events.filter((e) => e.event === eventName) - expect(events.length > 0).to.equal(false, `'${eventName}' event found`) - } -} - -export async function assertNoIndirectEvent( - tx: ContractTransaction, - emitter: Interface, - eventName: string -): Promise { - const receipt = await tx.wait() - const decodedEvents = receipt.logs - .map((log) => { - try { - return emitter.parseLog(log) - } catch { - return undefined - } - }) - .filter((e): e is LogDescription => e !== undefined) - - const events = decodedEvents.filter((event) => event.name === eventName) - expect(events.length > 0).to.equal(false, `'${eventName}' event found`) -} - -function contains(args: { [key: string]: any | undefined }, key: string, value: any) { - expect(key in args).to.equal(true, `Event argument '${key}' not found`) - - if (value === null) { - expect(args[key]).to.equal(null, `expected event argument '${key}' to be null but got ${args[key]}`) - } else if (BigNumber.isBigNumber(args[key]) || BigNumber.isBigNumber(value)) { - const actual = BigNumber.isBigNumber(args[key]) ? args[key].toString() : args[key] - const expected = BigNumber.isBigNumber(value) ? value.toString() : value - - expect(args[key]).to.equal(value, `expected event argument '${key}' to have value ${expected} but got ${actual}`) - } else { - const expected = typeof args[key] === 'string' && typeof value === 'object' && value.address ? value.address : value - expect(args[key]).to.be.deep.equal( - expected, - `expected event argument '${key}' to have value ${value} but got ${args[key]}` - ) - } -} - -export type NAry = N | N[] - -export type PermissionAssertion = { - name: string - roles: string[] - account: NAry<{ address: string } | string> -} - -export async function assertPermissions(target: Contract, assertions: PermissionAssertion[]): Promise { - for (const assertion of assertions) { - const accounts = Array.isArray(assertion.account) ? assertion.account : [assertion.account] - for (const account of accounts) { - const address = typeof account === 'string' ? account : account.address - for (const fn in target.interface.functions) { - const fnName = target.interface.functions[fn].name - const role = target.interface.getSighash(fnName) - const should = assertion.roles.includes(fnName) - const message = `expected "${assertion.name}" ${address} ${should ? 'to' : 'not to'} have "${fn}" rights` - expect(await target.isAuthorized(address, role)).to.be.equal(should, message) - } - } - } -} diff --git a/packages/helpers/src/blocks.ts b/packages/helpers/src/blocks.ts deleted file mode 100644 index a25e2a38..00000000 --- a/packages/helpers/src/blocks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BigNumber } from 'ethers' - -import { bn } from './numbers' - -export const incrementBlocks = async (blocks: number): Promise => { - const { ethers } = await import('hardhat') - for (let i = 0; i < blocks; i++) await ethers.provider.send('evm_mine', []) -} - -export const currentBlock = async (): Promise<{ number: number; timestamp: number }> => { - const { network } = await import('hardhat') - return network.provider.send('eth_getBlockByNumber', ['latest', true]) -} - -export const currentBlockNumber = async (): Promise => { - const { number } = await currentBlock() - return bn(number) -} diff --git a/packages/helpers/src/constants.ts b/packages/helpers/src/constants.ts deleted file mode 100644 index e9ab4617..00000000 --- a/packages/helpers/src/constants.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BigNumber } from 'ethers' - -import { bn } from './numbers' - -export const maxUint = (e: number): BigNumber => bn(2).pow(e).sub(1) - -export const MAX_UINT256: BigNumber = maxUint(256) - -export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' -export const ONES_ADDRESS = '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF' -export const NATIVE_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' - -export const ZERO_BYTES32 = '0x0000000000000000000000000000000000000000000000000000000000000000' -export const ONES_BYTES32 = '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' diff --git a/packages/helpers/src/contracts.ts b/packages/helpers/src/contracts.ts deleted file mode 100644 index fa1c3404..00000000 --- a/packages/helpers/src/contracts.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' -import { Contract, ContractFactory } from 'ethers' -import { getContractAddress } from 'ethers/lib/utils' -import { Artifacts } from 'hardhat/internal/artifacts' -import { Artifact, LinkReferences } from 'hardhat/types' -import path from 'path' - -import { getSigner } from './signers' - -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - -export type Libraries = { [key: string]: string } - -export type ArtifactLike = { abi: any; bytecode: string; linkReferences?: LinkReferences } - -const MINIMAL_PROXY_BYTECODE = `0x3d602d80600a3d3981f3363d3d373d3d3d363d73_IMP_5af43d82803e903d91602b57fd5bf3` - -export async function deploy( - nameOrArtifact: string | ArtifactLike, - args: Array = [], - from?: SignerWithAddress, - libraries?: Libraries -): Promise { - if (!args) args = [] - if (!from) from = await getSigner() - const factory = await getFactoryContract(nameOrArtifact, libraries) - const instance = await factory.connect(from).deploy(...args) - return instance.deployed() -} - -export async function deployProxy( - nameOrArtifact: string | ArtifactLike, - args: Array = [], - initArgs: Array = [], - initName = 'initialize', - from?: SignerWithAddress, - libraries?: Libraries -): Promise { - const implementation = await deploy(nameOrArtifact, args, from, libraries) - const proxyBytecode = MINIMAL_PROXY_BYTECODE.replace('_IMP_', implementation.address.slice(2)) - - if (!from) from = await getSigner() - const addressQuery = { from: from.address, nonce: await from.getTransactionCount() } - await from.sendTransaction({ data: proxyBytecode }) - const instance = await instanceAt(nameOrArtifact, await getContractAddress(addressQuery)) - await instance[initName](...initArgs) - return instance -} - -export async function getCreationCode( - nameOrArtifact: string | ArtifactLike, - args: Array = [], - libraries?: Libraries -): Promise { - if (!args) args = [] - const contractFactory = await getFactoryContract(nameOrArtifact, libraries) - const transaction = await contractFactory.getDeployTransaction(...args) - return transaction.data?.toString() || '0x' -} - -async function getFactoryContract( - nameOrArtifact: string | ArtifactLike, - libraries: Libraries | undefined -): Promise { - const artifact = typeof nameOrArtifact === 'string' ? await getArtifact(nameOrArtifact) : nameOrArtifact - if (libraries !== undefined) artifact.bytecode = linkBytecode(artifact, libraries) - return getFactoryContractForBytecode(nameOrArtifact, artifact.bytecode) -} - -async function getFactoryContractForBytecode( - nameOrArtifact: string | ArtifactLike, - bytecode: string -): Promise { - const artifact = typeof nameOrArtifact === 'string' ? await getArtifact(nameOrArtifact) : nameOrArtifact - const { ethers } = await import('hardhat') - return ethers.getContractFactory(artifact.abi, bytecode) -} - -export async function instanceAt(nameOrArtifact: string | any, address: string): Promise { - const { ethers } = await import('hardhat') - const artifact = typeof nameOrArtifact === 'string' ? await getArtifact(nameOrArtifact) : nameOrArtifact - return ethers.getContractAt(artifact.abi, address) -} - -export async function getArtifact(contractName: string): Promise { - const artifactsPath = !contractName.includes('/') - ? path.resolve('./artifacts') - : path.dirname(require.resolve(`${contractName}.json`)) - const artifacts = new Artifacts(artifactsPath) - return artifacts.readArtifact(contractName.split('/').slice(-1)[0]) -} - -export function linkBytecode(artifact: ArtifactLike, libraries: Libraries): string { - let bytecode = artifact.bytecode.replace('0x', '') - for (const [, fileReferences] of Object.entries(artifact.linkReferences || {})) { - for (const [library, fixups] of Object.entries(fileReferences)) { - const address = libraries[library] - if (address === undefined) continue - for (const fixup of fixups) { - const pre = bytecode.substring(0, fixup.start * 2) - const post = bytecode.substring((fixup.start + fixup.length) * 2) - bytecode = pre + address.replace('0x', '') + post - } - } - } - return `0x${bytecode}` -} diff --git a/packages/helpers/src/mocks.ts b/packages/helpers/src/mocks.ts deleted file mode 100644 index f5366cdd..00000000 --- a/packages/helpers/src/mocks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Contract } from 'ethers' - -import { deploy } from './contracts' -import { BigNumberish } from './numbers' - -/* eslint-disable no-secrets/no-secrets */ - -export async function deployWrappedNativeTokenMock(): Promise { - return deploy('@mimic-fi/v3-helpers/artifacts/contracts/mocks/WrappedNativeTokenMock.sol/WrappedNativeTokenMock') -} - -export async function deployTokenMock(symbol: string, decimals = 18): Promise { - return deploy('@mimic-fi/v3-helpers/artifacts/contracts/mocks/TokenMock.sol/TokenMock', [symbol, decimals]) -} - -export async function deployFeedMock(price: BigNumberish, decimals = 18): Promise { - return deploy('@mimic-fi/v3-helpers/artifacts/contracts/mocks/FeedMock.sol/FeedMock', [price, decimals]) -} diff --git a/packages/helpers/src/numbers.ts b/packages/helpers/src/numbers.ts deleted file mode 100644 index d6ea0333..00000000 --- a/packages/helpers/src/numbers.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Decimal } from 'decimal.js' -import { BigNumber } from 'ethers' - -const SCALING_FACTOR = 1e18 - -export type BigNumberish = string | number | BigNumber - -export const decimal = (x: BigNumberish | Decimal): Decimal => new Decimal(x.toString()) - -export const fp = (x: number | string | Decimal): BigNumber => bn(decimal(x).mul(SCALING_FACTOR)) - -export const toWBTC = (x: number | string | Decimal): BigNumber => fp(x).div(1e10) - -export const toUSDC = (x: number | string | Decimal): BigNumber => fp(x).div(1e12) - -export const toUSDT = toUSDC - -export const pct = (x: BigNumber, p: number): BigNumber => x.mul(fp(p)).div(fp(1)) - -export const bn = (x: BigNumberish | Decimal): BigNumber => { - if (BigNumber.isBigNumber(x)) return x - const stringified = parseScientific(x.toString()) - const integer = stringified.split('.')[0] - return BigNumber.from(integer) -} - -function parseScientific(num: string): string { - // If the number is not in scientific notation return it as it is - if (!/\d+\.?\d*e[+-]*\d+/i.test(num)) return num - - // Remove the sign - const numberSign = Math.sign(Number(num)) - num = Math.abs(Number(num)).toString() - - // Parse into coefficient and exponent - const [coefficient, exponent] = num.toLowerCase().split('e') - let zeros = Math.abs(Number(exponent)) - const exponentSign = Math.sign(Number(exponent)) - const [integer, decimals] = (coefficient.indexOf('.') != -1 ? coefficient : `${coefficient}.`).split('.') - - if (exponentSign === -1) { - zeros -= integer.length - num = - zeros < 0 - ? integer.slice(0, zeros) + '.' + integer.slice(zeros) + decimals - : '0.' + '0'.repeat(zeros) + integer + decimals - } else { - if (decimals) zeros -= decimals.length - num = - zeros < 0 - ? integer + decimals.slice(0, zeros) + '.' + decimals.slice(zeros) - : integer + decimals + '0'.repeat(zeros) - } - - return numberSign < 0 ? '-' + num : num -} diff --git a/packages/helpers/src/signers.ts b/packages/helpers/src/signers.ts deleted file mode 100644 index c5ae6988..00000000 --- a/packages/helpers/src/signers.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' -import { BigNumber } from 'ethers' - -import { getForkedNetwork } from './tests' - -const WHALES: { [key: string]: string } = { - mainnet: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503', -} - -export async function getSigner(indexOrAddress: number | string = 0): Promise { - if (typeof indexOrAddress === 'string') { - const { ethers } = await import('hardhat') - const signer = ethers.provider.getSigner(indexOrAddress) - return SignerWithAddress.create(signer) - } else { - const signers = await getSigners() - return signers[indexOrAddress] - } -} - -export async function getSigners(size?: number, offset = 0): Promise { - const { ethers } = await import('hardhat') - const signers = await ethers.getSigners() - return size ? signers.slice(offset, offset + size) : signers -} - -export async function impersonate(address: string, balance?: BigNumber): Promise { - const { network, ethers } = await import('hardhat') - await network.provider.request({ method: 'hardhat_impersonateAccount', params: [address] }) - - if (balance) { - const rawHexBalance = ethers.utils.hexlify(balance) - const hexBalance = rawHexBalance.replace('0x0', '0x') - await network.provider.request({ method: 'hardhat_setBalance', params: [address, hexBalance] }) - } - - return getSigner(address) -} - -export async function impersonateWhale(balance?: BigNumber): Promise { - const hre = await import('hardhat') - const network = getForkedNetwork(hre) - const address = WHALES[network] - if (!address) throw Error(`Could not find whale address for network ${network}`) - return impersonate(address, balance) -} diff --git a/packages/helpers/src/tests.ts b/packages/helpers/src/tests.ts deleted file mode 100644 index c705a241..00000000 --- a/packages/helpers/src/tests.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { TASK_TEST_GET_TEST_FILES, TASK_TEST_RUN_MOCHA_TESTS } from 'hardhat/builtin-tasks/task-names' -import { HardhatNetworkConfig, HardhatRuntimeEnvironment, HttpNetworkConfig, RunSuperFunction } from 'hardhat/types' - -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - -export async function overrideTestTask( - args: any, - hre: HardhatRuntimeEnvironment, - run: RunSuperFunction -): Promise { - const files = await hre.run(TASK_TEST_GET_TEST_FILES, { testFiles: args.testFiles }) - if (hre.network.name === 'hardhat' && args.fork) await runForkTests(args, files, hre, run) - else await runNormalTests(args, files, hre, run) -} - -async function runNormalTests( - args: any, - files: string[], - hre: HardhatRuntimeEnvironment, - run: RunSuperFunction -): Promise { - console.log('Running normal tests...') - if (args.fork) throw Error('Cannot run normal tests with a forked network') - args.testFiles = files.filter((file: string) => file.endsWith('.test.ts')) - if (args.testFiles.length == 0) return hre.run(TASK_TEST_RUN_MOCHA_TESTS, { testFiles: [] }) - - await run(args) -} - -async function runForkTests( - args: any, - files: string[], - hre: HardhatRuntimeEnvironment, - run: RunSuperFunction -): Promise { - console.log(`Running fork tests on ${args.fork}...`) - if (args.fork === 'hardhat') throw Error('Cannot fork local networks') - - args.testFiles = files.filter((file: string) => file.endsWith(`.${args.fork}.ts`) || file.endsWith(`.fork.ts`)) - if (args.testFiles.length == 0) return hre.run(TASK_TEST_RUN_MOCHA_TESTS, { testFiles: [] }) - - const forkingNetworkName = Object.keys(hre.config.networks).find((networkName) => networkName === args.fork) - if (!forkingNetworkName) throw Error(`Could not find a config for network ${args.fork} to be forked`) - - const forkingNetworkConfig = hre.config.networks[forkingNetworkName] as HttpNetworkConfig - if (!forkingNetworkConfig.url) throw Error(`Could not find a RPC url in network config for ${forkingNetworkName}`) - - if (args.chainId) hre.config.networks.hardhat.chainId = args.chainId - - await hre.network.provider.request({ - method: 'hardhat_reset', - params: [{ forking: { jsonRpcUrl: forkingNetworkConfig.url, blockNumber: args.blockNumber } }], - }) - - const config = hre.network.config as HardhatNetworkConfig - config.forking = { enabled: true, blockNumber: args.blockNumber, url: forkingNetworkConfig.url, httpHeaders: {} } - - await run(args) -} - -export function getForkedNetwork(hre: HardhatRuntimeEnvironment): string { - const config = hre.network.config as HardhatNetworkConfig - if (!config.forking || !config.forking.url) throw Error(`No forks found on network ${hre.network.name}`) - - const network = Object.entries(hre.config.networks).find(([, networkConfig]) => { - const httpNetworkConfig = networkConfig as HttpNetworkConfig - return httpNetworkConfig.url && httpNetworkConfig.url === config?.forking?.url - }) - - if (!network) throw Error(`No network found matching fork from ${config.forking.url}`) - return network[0] -} diff --git a/packages/helpers/src/time.ts b/packages/helpers/src/time.ts deleted file mode 100644 index 0b794dd2..00000000 --- a/packages/helpers/src/time.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { BigNumber } from 'ethers' - -import { currentBlock } from './blocks' -import { BigNumberish, bn } from './numbers' - -export const SECOND = 1 -export const MINUTE = SECOND * 60 -export const HOUR = MINUTE * 60 -export const DAY = HOUR * 24 -export const WEEK = DAY * 7 -export const MONTH = DAY * 30 -export const YEAR = MONTH * 12 - -export const currentTimestamp = async (): Promise => { - const { timestamp } = await currentBlock() - return bn(timestamp) -} - -export const advanceTime = async (seconds: BigNumberish): Promise => { - const { ethers } = await import('hardhat') - await ethers.provider.send('evm_increaseTime', [parseInt(seconds.toString())]) - await ethers.provider.send('evm_mine', []) -} - -export const setNextBlockTimestamp = async (timestamp: BigNumberish): Promise => { - const { ethers } = await import('hardhat') - await ethers.provider.send('evm_setNextBlockTimestamp', [parseInt(timestamp.toString())]) -} diff --git a/packages/helpers/test/contracts/math/FixedPoint.test.ts b/packages/helpers/test/contracts/math/FixedPoint.test.ts deleted file mode 100644 index 602bd902..00000000 --- a/packages/helpers/test/contracts/math/FixedPoint.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' - -import { deploy } from '../../../src/contracts' -import { fp } from '../../../src/numbers' - -describe('FixedPoint', () => { - let library: Contract - - beforeEach('deploy lib', async () => { - library = await deploy('FixedPointMock') - }) - - describe('mulUp', () => { - it('computes mul up correctly', async () => { - expect(await library.mulUp(1, 1)).to.be.equal(1) - expect(await library.mulUp(fp(2), 0)).to.be.equal(0) - expect(await library.mulUp(fp(2), fp(2))).to.be.equal(fp(4)) - expect(await library.mulUp(fp(4), fp(2))).to.be.equal(fp(8)) - }) - }) - - describe('mulDown', () => { - it('computes mul down correctly', async () => { - expect(await library.mulDown(1, 1)).to.be.equal(0) - expect(await library.mulDown(fp(2), 0)).to.be.equal(0) - expect(await library.mulDown(fp(2), fp(2))).to.be.equal(fp(4)) - expect(await library.mulDown(fp(4), fp(2))).to.be.equal(fp(8)) - }) - }) - - describe('divUp', () => { - it('computes div up correctly', async () => { - expect(await library.divUp(1, 1)).to.be.equal(fp(1)) - expect(await library.divUp(0, fp(2))).to.be.equal(0) - expect(await library.divUp(fp(2), fp(2))).to.be.equal(fp(1)) - await expect(library.divUp(fp(2), 0)).to.be.revertedWith('FixedPointZeroDivision') - }) - }) - - describe('divDown', () => { - it('computes div down correctly', async () => { - expect(await library.divDown(1, 1)).to.be.equal(fp(1)) - expect(await library.divDown(0, fp(2))).to.be.equal(0) - expect(await library.divDown(fp(2), fp(2))).to.be.equal(fp(1)) - await expect(library.divDown(fp(2), 0)).to.be.revertedWith('FixedPointZeroDivision') - }) - }) -}) diff --git a/packages/helpers/test/contracts/utils/Arrays.test.ts b/packages/helpers/test/contracts/utils/Arrays.test.ts deleted file mode 100644 index 65c501fa..00000000 --- a/packages/helpers/test/contracts/utils/Arrays.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' - -import { deploy } from '../../../' - -describe('Arrays', () => { - let library: Contract - - beforeEach('deploy lib', async () => { - library = await deploy('ArraysMock') - }) - - describe('from (addresses)', () => { - const ADDR_1 = '0x0000000000000000000000000000000000000001' - const ADDR_2 = '0x0000000000000000000000000000000000000002' - const ADDR_3 = '0x0000000000000000000000000000000000000003' - const ADDR_4 = '0x0000000000000000000000000000000000000004' - - it('concatenates two addresses correctly', async () => { - const result = await library.from1(ADDR_1, ADDR_2) - - expect(result.length).to.be.equal(2) - expect(result[0]).to.be.equal(ADDR_1) - expect(result[1]).to.be.equal(ADDR_2) - }) - - it('concatenates two addresses with an array correctly', async () => { - const result = await library.from2(ADDR_1, [ADDR_2, ADDR_3], ADDR_4) - - expect(result.length).to.be.equal(4) - expect(result[0]).to.be.equal(ADDR_1) - expect(result[1]).to.be.equal(ADDR_2) - expect(result[2]).to.be.equal(ADDR_3) - expect(result[3]).to.be.equal(ADDR_4) - }) - }) - - describe('from (integers)', () => { - it('concatenates correctly', async () => { - const result = await library.from3(1, []) - - expect(result.length).to.be.equal(1) - expect(result[0]).to.be.equal(1) - }) - - it('concatenates correctly', async () => { - const result = await library.from3(1, [2]) - - expect(result.length).to.be.equal(2) - expect(result[0]).to.be.equal(1) - expect(result[1]).to.be.equal(2) - }) - - it('concatenates correctly', async () => { - const result = await library.from3(1, [2, 3]) - - expect(result.length).to.be.equal(3) - expect(result[0]).to.be.equal(1) - expect(result[1]).to.be.equal(2) - expect(result[2]).to.be.equal(3) - }) - }) - - describe('from (bytes32)', () => { - const VALUE_1 = '0x0000000000000000000000000000000000000000000000000000000000000001' - const VALUE_2 = '0x0000000000000000000000000000000000000000000000000000000000000002' - const VALUE_3 = '0x0000000000000000000000000000000000000000000000000000000000000003' - - it('concatenates two addresses correctly', async () => { - const result = await library.from4(VALUE_1, [VALUE_2, VALUE_3]) - - expect(result.length).to.be.equal(3) - expect(result[0]).to.be.equal(VALUE_1) - expect(result[1]).to.be.equal(VALUE_2) - expect(result[2]).to.be.equal(VALUE_3) - }) - }) -}) diff --git a/packages/helpers/test/contracts/utils/BytesHelpers.test.ts b/packages/helpers/test/contracts/utils/BytesHelpers.test.ts deleted file mode 100644 index 6dbcf6bf..00000000 --- a/packages/helpers/test/contracts/utils/BytesHelpers.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' -import { hexlify, hexZeroPad } from 'ethers/lib/utils' - -import { deploy } from '../../../' - -describe('BytesHelpers', () => { - let library: Contract - - beforeEach('deploy lib', async () => { - library = await deploy('BytesHelpersMock') - }) - - describe('toUint256', () => { - const bytes = - '0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002' - - it('extracts an uint256 correctly', async () => { - expect(await library.toUint256(bytes, 0)).to.be.equal(1) - expect(await library.toUint256(bytes, 32)).to.be.equal(2) - }) - - it('reverts if out of bounds', async () => { - await expect(library.toUint256(bytes, 64)).to.be.revertedWith('BytesOutOfBounds') - await expect(library.toUint256(bytes, 33)).to.be.revertedWith('BytesOutOfBounds') - }) - }) - - describe('concat', () => { - const array = '0xabcdef' - - it('concatenates an address with a bytes array', async () => { - const address = '0xffffffffffffffffffffffffffffffffffffffff' - const result = await library.concat1(array, address) - - expect(result).to.be.equal(array + address.slice(2)) - }) - - it('concatenates an uint24 with a bytes array', async () => { - const number = 5 - const result = await library.concat2(array, number) - - expect(result).to.be.equal(array + hexZeroPad(hexlify(number), 3).slice(2)) - }) - }) -}) diff --git a/packages/helpers/test/contracts/utils/Denominations.test.ts b/packages/helpers/test/contracts/utils/Denominations.test.ts deleted file mode 100644 index ad06a61f..00000000 --- a/packages/helpers/test/contracts/utils/Denominations.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' - -import { NATIVE_TOKEN_ADDRESS } from '../../../src/constants' -import { deploy } from '../../../src/contracts' - -describe('Denominations', () => { - let library: Contract - - beforeEach('deploy lib', async () => { - library = await deploy('DenominationsMock') - }) - - it('uses the expected native token address', async () => { - expect(await library.NATIVE_TOKEN()).to.be.equal(NATIVE_TOKEN_ADDRESS) - }) -}) diff --git a/packages/helpers/test/contracts/utils/ERC20Helpers.test.ts b/packages/helpers/test/contracts/utils/ERC20Helpers.test.ts deleted file mode 100644 index 3b7d0f59..00000000 --- a/packages/helpers/test/contracts/utils/ERC20Helpers.test.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' -import { ethers } from 'hardhat' - -import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS } from '../../../src/constants' -import { deploy } from '../../../src/contracts' -import { deployTokenMock } from '../../../src/mocks' -import { getSigner } from '../../../src/signers' - -describe('ERC20Helpers', () => { - let library: Contract, someone: string - - beforeEach('deploy lib', async () => { - someone = (await getSigner(1)).address - library = await deploy('ERC20HelpersMock') - }) - - describe('balanceOf', () => { - context('when the token is the native token', () => { - const token = NATIVE_TOKEN_ADDRESS - - it('returns the account balance correctly', async () => { - expect(await library.balanceOf(token, ZERO_ADDRESS)).to.be.eq(0) - expect(await library.balanceOf(token, someone)).to.be.equal(await ethers.provider.getBalance(someone)) - }) - }) - - context('when the token is an ERC20 token', () => { - let token: Contract - - beforeEach('deploy token', async () => { - token = await deployTokenMock('TKN') - await token.mint(someone, 10) - }) - - it('returns the account balance correctly', async () => { - expect(await library.balanceOf(token.address, ZERO_ADDRESS)).to.be.eq(0) - expect(await library.balanceOf(token.address, someone)).to.be.equal(10) - }) - }) - }) - - describe('transfer', () => { - const amount = 10 - - context('when the token is the native token', () => { - const token = NATIVE_TOKEN_ADDRESS - - beforeEach('fund library', async () => { - const signer = await getSigner() - await signer.sendTransaction({ to: library.address, value: amount }) - }) - - it('transfers value correctly', async () => { - const previousLibraryBalance = await library.balanceOf(token, library.address) - const previousRecipientBalance = await library.balanceOf(token, someone) - - await library.transfer(token, someone, amount) - - const currentLibraryBalance = await library.balanceOf(token, library.address) - expect(currentLibraryBalance).to.be.equal(previousLibraryBalance.sub(amount)) - - const currentRecipientBalance = await library.balanceOf(token, someone) - expect(currentRecipientBalance).to.be.equal(previousRecipientBalance.add(amount)) - }) - }) - - context('when the token is an ERC20 token', () => { - let token: Contract - - beforeEach('deploy token', async () => { - token = await deployTokenMock('TKN') - }) - - beforeEach('fund library', async () => { - await token.mint(library.address, amount) - }) - - it('transfers tokens correctly', async () => { - const previousLibraryBalance = await library.balanceOf(token.address, library.address) - const previousRecipientBalance = await library.balanceOf(token.address, someone) - - await library.transfer(token.address, someone, amount) - - const currentLibraryBalance = await library.balanceOf(token.address, library.address) - expect(currentLibraryBalance).to.be.equal(previousLibraryBalance.sub(amount)) - - const currentRecipientBalance = await library.balanceOf(token.address, someone) - expect(currentRecipientBalance).to.be.equal(previousRecipientBalance.add(amount)) - }) - }) - }) - - describe('approve', () => { - context('when the token is the native token', () => { - const token = NATIVE_TOKEN_ADDRESS - - it('reverts', async () => { - await expect(library.approve(token, someone, 10)).to.be.reverted - }) - }) - - context('when the token is an ERC20 token', () => { - let token: Contract - - beforeEach('deploy token', async () => { - token = await deployTokenMock('TKN') - }) - - it('updates allowance correctly', async () => { - await library.approve(token.address, someone, 10) - expect(await token.allowance(library.address, someone)).to.be.equal(10) - - await library.approve(token.address, someone, 20) - expect(await token.allowance(library.address, someone)).to.be.equal(20) - - await library.approve(token.address, someone, 0) - expect(await token.allowance(library.address, someone)).to.be.equal(0) - }) - }) - }) -}) diff --git a/packages/helpers/test/contracts/utils/EnumerableMap.test.ts b/packages/helpers/test/contracts/utils/EnumerableMap.test.ts deleted file mode 100644 index 50b95157..00000000 --- a/packages/helpers/test/contracts/utils/EnumerableMap.test.ts +++ /dev/null @@ -1,321 +0,0 @@ -import { expect } from 'chai' -import { Contract } from 'ethers' - -import { assertEvent, deploy, ZERO_ADDRESS } from '../../..' - -/* eslint-disable no-secrets/no-secrets */ - -describe('EnumerableMap', () => { - let map: Contract - - const keyA = '0x8B40ECf815AC8d53aB4AD2a00248DE77296344Db' - const keyB = '0x638141Eb8905D9A55D81610f45bC2B47120059e7' - const keyC = '0x7571A57e94F046725612f786Aa9bf44ce6b56894' - - describe('AddressToUintMap', () => { - const valueA = '10' - const valueB = '20' - const valueC = '30' - - beforeEach('deploy map', async () => { - map = await deploy('EnumerableMapAddressToUintMock') - }) - - async function expectMembersMatch(keys, values) { - expect(keys.length).to.equal(values.length) - - await Promise.all(keys.map(async (key) => expect(await map.contains(key)).to.equal(true))) - - expect(await map.length()).to.be.equal(keys.length) - - expect( - (await Promise.all(keys.map((key) => map.get(key)))).map((value) => value.toString()) - ).to.have.same.members(values) - - await Promise.all( - keys.map(async (key, index) => { - const value = values[index] - const entry = await map.at(index) - expect(entry.key).to.be.equal(key) - expect(entry.value).to.be.equal(value) - }) - ) - - expect(await map.keys()).to.have.same.members(keys) - - expect((await map.values()).map((value) => value.toString())).to.have.same.members(values) - } - - it('starts empty', async () => { - expect(await map.contains(keyA)).to.equal(false) - - await expectMembersMatch([], []) - }) - - describe('set', () => { - it('adds a key', async () => { - const tx = await map.set(keyA, valueA) - await assertEvent(tx, 'OperationResult', { result: true }) - - await expectMembersMatch([keyA], [valueA]) - }) - - it('adds several keys', async () => { - await map.set(keyA, valueA) - await map.set(keyB, valueB) - - await expectMembersMatch([keyA, keyB], [valueA, valueB]) - expect(await map.contains(keyC)).to.equal(false) - }) - - it('returns false when adding keys already in the set', async () => { - await map.set(keyA, valueA) - - const tx = await map.set(keyA, valueA) - await assertEvent(tx, 'OperationResult', { result: false }) - - await expectMembersMatch([keyA], [valueA]) - }) - - it('updates values for keys already in the set', async () => { - await map.set(keyA, valueA) - - await map.set(keyA, valueB) - - await expectMembersMatch([keyA], [valueB]) - }) - }) - - describe('remove', () => { - it('removes added keys', async () => { - await map.set(keyA, valueA) - - const tx = await map.remove(keyA) - await assertEvent(tx, 'OperationResult', { result: true }) - - expect(await map.contains(keyA)).to.equal(false) - await expectMembersMatch([], []) - }) - - it('returns false when removing keys not in the set', async () => { - const tx = await map.remove(keyA) - await assertEvent(tx, 'OperationResult', { result: false }) - - expect(await map.contains(keyA)).to.equal(false) - }) - - it('adds and removes multiple keys', async () => { - await map.set(keyA, valueA) - await map.set(keyC, valueC) - await expectMembersMatch([keyA, keyC], [valueA, valueC]) // [A, C] - - await map.remove(keyA) - await map.remove(keyB) - await expectMembersMatch([keyC], [valueC]) // [C] - - await map.set(keyB, valueB) - await expectMembersMatch([keyC, keyB], [valueC, valueB]) // [C, B] - - await map.set(keyA, valueA) - await map.remove(keyC) - await expectMembersMatch([keyA, keyB], [valueA, valueB]) // [A, B] - - await map.set(keyA, valueA) - await map.set(keyB, valueB) - await expectMembersMatch([keyA, keyB], [valueA, valueB]) // [A, B] - - await map.set(keyC, valueC) - await map.remove(keyA) - await expectMembersMatch([keyC, keyB], [valueC, valueB]) // [C, B] - - await map.set(keyA, valueA) - await map.remove(keyB) - await expectMembersMatch([keyC, keyA], [valueC, valueA]) // [C, A] - - expect(await map.contains(keyB)).to.equal(false) - }) - }) - - describe('read', () => { - beforeEach(async () => { - await map.set(keyA, valueA) - }) - - describe('get', () => { - it('existing value', async () => { - expect((await map.get(keyA)).toString()).to.be.equal(valueA.toString()) - }) - - it('missing value', async () => { - await expect(map.get(keyB)).to.be.revertedWith('EnumerableMapNonExistentKey') - }) - }) - - describe('tryGet', () => { - it('existing value', async () => { - const { exists, value } = await map.tryGet(keyA) - expect(exists).to.be.equal(true) - expect(value).to.be.equal(valueA) - }) - - it('missing value', async () => { - const { exists, value } = await map.tryGet(keyB) - expect(exists).to.be.equal(false) - expect(value).to.be.equal(ZERO_ADDRESS) - }) - }) - }) - }) - - describe('AddressToAddressMap', () => { - const valueA = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' - const valueB = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' - const valueC = '0xf584F8728B874a6a5c7A8d4d387C9aae9172D621' - - beforeEach('deploy map', async () => { - map = await deploy('EnumerableMapAddressToAddressMock') - }) - - async function expectMembersMatch(keys, values) { - expect(keys.length).to.equal(values.length) - - await Promise.all(keys.map(async (key) => expect(await map.contains(key)).to.equal(true))) - - expect(await map.length()).to.be.equal(keys.length) - - expect(await Promise.all(keys.map((key) => map.get(key)))).to.have.same.members(values) - - await Promise.all( - keys.map(async (key, index) => { - const value = values[index] - const entry = await map.at(index) - expect(entry.key).to.be.equal(key) - expect(entry.value).to.be.equal(value) - }) - ) - - expect(await map.keys()).to.have.same.members(keys) - expect(await map.values()).to.have.same.members(values) - } - - it('starts empty', async () => { - expect(await map.contains(keyA)).to.equal(false) - - await expectMembersMatch([], []) - }) - - describe('set', () => { - it('adds a key', async () => { - const tx = await map.set(keyA, valueA) - await assertEvent(tx, 'OperationResult', { result: true }) - - await expectMembersMatch([keyA], [valueA]) - }) - - it('adds several keys', async () => { - await map.set(keyA, valueA) - await map.set(keyB, valueB) - - await expectMembersMatch([keyA, keyB], [valueA, valueB]) - expect(await map.contains(keyC)).to.equal(false) - }) - - it('returns false when adding keys already in the set', async () => { - await map.set(keyA, valueA) - - const tx = await map.set(keyA, valueA) - await assertEvent(tx, 'OperationResult', { result: false }) - - await expectMembersMatch([keyA], [valueA]) - }) - - it('updates values for keys already in the set', async () => { - await map.set(keyA, valueA) - - await map.set(keyA, valueB) - - await expectMembersMatch([keyA], [valueB]) - }) - }) - - describe('remove', () => { - it('removes added keys', async () => { - await map.set(keyA, valueA) - - const tx = await map.remove(keyA) - await assertEvent(tx, 'OperationResult', { result: true }) - - expect(await map.contains(keyA)).to.equal(false) - await expectMembersMatch([], []) - }) - - it('returns false when removing keys not in the set', async () => { - const tx = await map.remove(keyA) - await assertEvent(tx, 'OperationResult', { result: false }) - - expect(await map.contains(keyA)).to.equal(false) - }) - - it('adds and removes multiple keys', async () => { - await map.set(keyA, valueA) - await map.set(keyC, valueC) - await expectMembersMatch([keyA, keyC], [valueA, valueC]) // [A, C] - - await map.remove(keyA) - await map.remove(keyB) - await expectMembersMatch([keyC], [valueC]) // [C] - - await map.set(keyB, valueB) - await expectMembersMatch([keyC, keyB], [valueC, valueB]) // [C, B] - - await map.set(keyA, valueA) - await map.remove(keyC) - await expectMembersMatch([keyA, keyB], [valueA, valueB]) // [A, B] - - await map.set(keyA, valueA) - await map.set(keyB, valueB) - await expectMembersMatch([keyA, keyB], [valueA, valueB]) // [A, B] - - await map.set(keyC, valueC) - await map.remove(keyA) - await expectMembersMatch([keyC, keyB], [valueC, valueB]) // [C, B] - - await map.set(keyA, valueA) - await map.remove(keyB) - await expectMembersMatch([keyC, keyA], [valueC, valueA]) // [C, A] - - expect(await map.contains(keyB)).to.equal(false) - }) - }) - - describe('read', () => { - beforeEach(async () => { - await map.set(keyA, valueA) - }) - - describe('get', () => { - it('existing value', async () => { - expect((await map.get(keyA)).toString()).to.be.equal(valueA.toString()) - }) - - it('missing value', async () => { - await expect(map.get(keyB)).to.be.revertedWith('EnumerableMapNonExistentKey') - }) - }) - - describe('tryGet', () => { - it('existing value', async () => { - const { exists, value } = await map.tryGet(keyA) - expect(exists).to.be.equal(true) - expect(value).to.be.equal(valueA) - }) - - it('missing value', async () => { - const { exists, value } = await map.tryGet(keyB) - expect(exists).to.be.equal(false) - expect(value).to.be.equal(ZERO_ADDRESS) - }) - }) - }) - }) -}) diff --git a/packages/helpers/tests.ts b/packages/helpers/tests.ts deleted file mode 100644 index c4dfb7bd..00000000 --- a/packages/helpers/tests.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { TASK_TEST } from 'hardhat/builtin-tasks/task-names' -import { task, types } from 'hardhat/config' - -import { overrideTestTask } from './src/tests' - -task(TASK_TEST) - .addOptionalParam('fork', 'Optional network name to be forked in case of running fork tests.') - .addOptionalParam('forkIgnoreUnknownTxType', 'Optional flag to ignore unknown tx types.', false, types.boolean) - .addOptionalParam('chainId', 'Optional chain ID to overwrite hardhat local network ID.', undefined, types.int) - .addOptionalParam('blockNumber', 'Optional block number to fork in case of running fork tests.', undefined, types.int) - .setAction(overrideTestTask) diff --git a/packages/helpers/tsconfig.json b/packages/helpers/tsconfig.json deleted file mode 100644 index 6aa7a321..00000000 --- a/packages/helpers/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es2019", - "module": "commonjs", - "rootDir": ".", - "outDir": "dist", - "esModuleInterop": true, - "strict": true - }, - "files": [ - "index.ts", - "tests.ts", - "hardhat.config.ts" - ] -} diff --git a/packages/price-oracle/contracts/PriceOracle.sol b/packages/price-oracle/contracts/PriceOracle.sol index 42784841..332142a9 100644 --- a/packages/price-oracle/contracts/PriceOracle.sol +++ b/packages/price-oracle/contracts/PriceOracle.sol @@ -22,9 +22,9 @@ import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import './interfaces/IPriceOracle.sol'; diff --git a/packages/helpers/contracts/mocks/FeedMock.sol b/packages/price-oracle/contracts/test/FeedMock.sol similarity index 100% rename from packages/helpers/contracts/mocks/FeedMock.sol rename to packages/price-oracle/contracts/test/FeedMock.sol diff --git a/packages/price-oracle/hardhat.config.ts b/packages/price-oracle/hardhat.config.ts index 9edb506d..9d8d755c 100644 --- a/packages/price-oracle/hardhat.config.ts +++ b/packages/price-oracle/hardhat.config.ts @@ -1,6 +1,6 @@ import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-waffle' -import '@mimic-fi/v3-helpers/dist/tests' +import '@mimic-fi/helpers/dist/tests' import 'hardhat-local-networks-config-plugin' import { homedir } from 'os' diff --git a/packages/price-oracle/package.json b/packages/price-oracle/package.json index e19b8352..f87734b3 100644 --- a/packages/price-oracle/package.json +++ b/packages/price-oracle/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@chainlink/contracts": "^0.2.1", - "@mimic-fi/v3-helpers": "0.1.0", + "@mimic-fi/helpers": "1.0.0", "@openzeppelin/contracts": "4.9.3" }, "devDependencies": { diff --git a/packages/price-oracle/test/PriceOracle.mainnet.ts b/packages/price-oracle/test/PriceOracle.mainnet.ts index 13462524..ef1ebddb 100644 --- a/packages/price-oracle/test/PriceOracle.mainnet.ts +++ b/packages/price-oracle/test/PriceOracle.mainnet.ts @@ -1,4 +1,4 @@ -import { assertAlmostEqual, deployProxy, fp, getSigner } from '@mimic-fi/v3-helpers' +import { assertAlmostEqual, deployProxy, fp, getSigner } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' /* eslint-disable no-secrets/no-secrets */ diff --git a/packages/price-oracle/test/PriceOracle.polygon.ts b/packages/price-oracle/test/PriceOracle.polygon.ts index 92d8d504..dc39d5be 100644 --- a/packages/price-oracle/test/PriceOracle.polygon.ts +++ b/packages/price-oracle/test/PriceOracle.polygon.ts @@ -1,4 +1,4 @@ -import { assertAlmostEqual, deployProxy, fp, getSigner } from '@mimic-fi/v3-helpers' +import { assertAlmostEqual, deployProxy, fp, getSigner } from '@mimic-fi/helpers' import { BigNumber, Contract } from 'ethers' /* eslint-disable no-secrets/no-secrets */ diff --git a/packages/price-oracle/test/PriceOracle.test.ts b/packages/price-oracle/test/PriceOracle.test.ts index 52105270..ace8a206 100644 --- a/packages/price-oracle/test/PriceOracle.test.ts +++ b/packages/price-oracle/test/PriceOracle.test.ts @@ -5,14 +5,14 @@ import { bn, currentTimestamp, DAY, - deployFeedMock, + deploy, deployProxy, deployTokenMock, fp, getSigner, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract, ethers } from 'ethers' @@ -223,7 +223,7 @@ describe('PriceOracle', () => { }) beforeEach('set feed', async () => { - const feed = await deployFeedMock(reportedPrice, feedDecimals) + const feed = await deploy('FeedMock', [reportedPrice, feedDecimals]) await priceOracle.setFeed(base.address, quote.address, feed.address) }) @@ -506,7 +506,7 @@ describe('PriceOracle', () => { }) beforeEach('set inverse feed', async () => { - const feed = await deployFeedMock(reportedInversePrice, feedDecimals) + const feed = await deploy('FeedMock', [reportedInversePrice, feedDecimals]) await priceOracle.setFeed(quote.address, base.address, feed.address) }) @@ -808,10 +808,10 @@ describe('PriceOracle', () => { }) beforeEach('set feed', async () => { - const baseFeed = await deployFeedMock(reportedBasePrice, baseFeedDecimals) + const baseFeed = await deploy('FeedMock', [reportedBasePrice, baseFeedDecimals]) await priceOracle.setFeed(base.address, PIVOT, baseFeed.address) - const quoteFeed = await deployFeedMock(reportedQuotePrice, quoteFeedDecimals) + const quoteFeed = await deploy('FeedMock', [reportedQuotePrice, quoteFeedDecimals]) await priceOracle.setFeed(quote.address, PIVOT, quoteFeed.address) }) @@ -1564,7 +1564,7 @@ describe('PriceOracle', () => { beforeEach('deploy base and quote', async () => { base = await deployTokenMock('BASE', 18) quote = await deployTokenMock('QUOTE', 18) - feed = await deployFeedMock(SMART_VAULT_ORACLE_PRICE, 18) + feed = await deploy('FeedMock', [SMART_VAULT_ORACLE_PRICE, 18]) }) const setUpSmartVaultOracleFeed = () => { diff --git a/packages/registry/package.json b/packages/registry/package.json index 43f8dc89..d3ad0d75 100644 --- a/packages/registry/package.json +++ b/packages/registry/package.json @@ -18,7 +18,7 @@ "prepare": "yarn build" }, "dependencies": { - "@mimic-fi/v3-helpers": "0.1.0", + "@mimic-fi/helpers": "1.0.0", "@openzeppelin/contracts": "4.9.3", "solmate": "^6.7.0" }, diff --git a/packages/registry/test/Registry.test.ts b/packages/registry/test/Registry.test.ts index f1d7b4aa..0bdac0d7 100644 --- a/packages/registry/test/Registry.test.ts +++ b/packages/registry/test/Registry.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, deploy, getCreationCode, getSigners } from '@mimic-fi/v3-helpers' +import { assertEvent, deploy, getCreationCode, getSigners } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/relayer/certora/conf/relayer.conf b/packages/relayer/certora/conf/relayer.conf index ad22e8bf..c5e6ece2 100644 --- a/packages/relayer/certora/conf/relayer.conf +++ b/packages/relayer/certora/conf/relayer.conf @@ -16,7 +16,7 @@ "optimistic_loop": true, "packages": [ "@mimic-fi/v3-authorizer=../../node_modules/@mimic-fi/v3-authorizer", - "@mimic-fi/v3-helpers=../../node_modules/@mimic-fi/v3-helpers", + "@mimic-fi/helpers=../../node_modules/@mimic-fi/helpers", "@mimic-fi/v3-smart-vault=../../node_modules/@mimic-fi/v3-smart-vault", "@mimic-fi/v3-tasks=../../node_modules/@mimic-fi/v3-tasks", "@openzeppelin=../../node_modules/@openzeppelin" diff --git a/packages/relayer/certora/helpers/Helpers.sol b/packages/relayer/certora/helpers/Helpers.sol index 32f29d7d..e665de69 100644 --- a/packages/relayer/certora/helpers/Helpers.sol +++ b/packages/relayer/certora/helpers/Helpers.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '@mimic-fi/v3-smart-vault/contracts/interfaces/ISmartVault.sol'; import '@mimic-fi/v3-tasks/contracts/interfaces/ITask.sol'; diff --git a/packages/relayer/package.json b/packages/relayer/package.json index c25e6576..01ff1c82 100644 --- a/packages/relayer/package.json +++ b/packages/relayer/package.json @@ -20,7 +20,7 @@ "prove:ci": "yarn prove --solc solc8.17" }, "dependencies": { - "@mimic-fi/v3-helpers": "0.1.0", + "@mimic-fi/helpers": "1.0.0", "@mimic-fi/v3-tasks": "0.1.0", "@mimic-fi/v3-smart-vault": "0.1.0", "@openzeppelin/contracts": "4.9.3" diff --git a/packages/relayer/test/Relayer.test.ts b/packages/relayer/test/Relayer.test.ts index 61e9f14b..61e237f7 100644 --- a/packages/relayer/test/Relayer.test.ts +++ b/packages/relayer/test/Relayer.test.ts @@ -11,7 +11,7 @@ import { NATIVE_TOKEN_ADDRESS, pct, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { deployEnvironment } from '@mimic-fi/v3-tasks' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' @@ -940,9 +940,8 @@ describe('Relayer', () => { context('when the relayer does not have enough balance', async () => { it('reverts', async () => { - await expect(relayer.rescueFunds(token.address, recipient.address, amount)).to.be.revertedWith( - 'ERC20: transfer amount exceeds balance' - ) + // TODO: Hardhat does not decode smart vault error properly + await expect(relayer.rescueFunds(token.address, recipient.address, amount)).to.be.reverted }) }) }) diff --git a/packages/smart-vault/certora/conf/smart-vault.conf b/packages/smart-vault/certora/conf/smart-vault.conf index fb0e0f2c..2dc014be 100644 --- a/packages/smart-vault/certora/conf/smart-vault.conf +++ b/packages/smart-vault/certora/conf/smart-vault.conf @@ -1,9 +1,9 @@ { "files": [ "contracts/SmartVault.sol", + "../../node_modules/@mimic-fi/helpers/contracts/mocks/WrappedNativeTokenMock.sol", "../../packages/authorizer/contracts/Authorizer.sol", "../../packages/fee-controller/contracts/FeeController.sol", - "../../packages/helpers/contracts/mocks/WrappedNativeTokenMock.sol", "../../packages/registry/contracts/Registry.sol", "certora/helpers/Helpers.sol" ], @@ -24,9 +24,9 @@ ], "optimistic_loop": true, "packages": [ + "@mimic-fi/helpers=../../node_modules/@mimic-fi/helpers", "@mimic-fi/v3-authorizer=../../node_modules/@mimic-fi/v3-authorizer", "@mimic-fi/v3-fee-controller=../../node_modules/@mimic-fi/v3-fee-controller", - "@mimic-fi/v3-helpers=../../node_modules/@mimic-fi/v3-helpers", "@mimic-fi/v3-price-oracle=../../node_modules/@mimic-fi/v3-price-oracle", "@mimic-fi/v3-registry=../../node_modules/@mimic-fi/v3-registry", "@openzeppelin=../../node_modules/@openzeppelin", diff --git a/packages/smart-vault/certora/helpers/Helpers.sol b/packages/smart-vault/certora/helpers/Helpers.sol index 99e7ec66..a212bda1 100644 --- a/packages/smart-vault/certora/helpers/Helpers.sol +++ b/packages/smart-vault/certora/helpers/Helpers.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.0; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '@mimic-fi/v3-authorizer/contracts/interfaces/IAuthorizer.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; contract Helpers { function NATIVE_TOKEN() external pure returns (address) { diff --git a/packages/smart-vault/contracts/SmartVault.sol b/packages/smart-vault/contracts/SmartVault.sol index 9d2dc790..2fe90702 100644 --- a/packages/smart-vault/contracts/SmartVault.sol +++ b/packages/smart-vault/contracts/SmartVault.sol @@ -19,12 +19,12 @@ import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/IWrappedNativeToken.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-authorizer/contracts/interfaces/IAuthorizer.sol'; import '@mimic-fi/v3-fee-controller/contracts/interfaces/IFeeController.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/IWrappedNativeToken.sol'; import '@mimic-fi/v3-price-oracle/contracts/interfaces/IPriceOracle.sol'; import '@mimic-fi/v3-registry/contracts/interfaces/IRegistry.sol'; diff --git a/packages/smart-vault/package.json b/packages/smart-vault/package.json index 49585a09..0df35997 100644 --- a/packages/smart-vault/package.json +++ b/packages/smart-vault/package.json @@ -20,9 +20,9 @@ "prove:ci": "yarn prove --solc solc8.17" }, "dependencies": { + "@mimic-fi/helpers": "1.0.0", "@mimic-fi/v3-authorizer": "0.1.0", "@mimic-fi/v3-fee-controller": "0.1.0", - "@mimic-fi/v3-helpers": "0.1.0", "@mimic-fi/v3-price-oracle": "0.1.0", "@mimic-fi/v3-registry": "0.1.0", "@openzeppelin/contracts": "4.9.3", diff --git a/packages/tasks/contracts/base/BaseTask.sol b/packages/tasks/contracts/base/BaseTask.sol index fcf18507..ec77535b 100644 --- a/packages/tasks/contracts/base/BaseTask.sol +++ b/packages/tasks/contracts/base/BaseTask.sol @@ -14,9 +14,9 @@ pragma solidity ^0.8.0; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; import '@mimic-fi/v3-price-oracle/contracts/interfaces/IPriceOracle.sol'; import '@mimic-fi/v3-smart-vault/contracts/interfaces/ISmartVault.sol'; diff --git a/packages/tasks/contracts/base/GasLimitedTask.sol b/packages/tasks/contracts/base/GasLimitedTask.sol index 281b487e..279997ec 100644 --- a/packages/tasks/contracts/base/GasLimitedTask.sol +++ b/packages/tasks/contracts/base/GasLimitedTask.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.17; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-smart-vault/contracts/interfaces/ISmartVault.sol'; import '../interfaces/base/IGasLimitedTask.sol'; diff --git a/packages/tasks/contracts/base/PausableTask.sol b/packages/tasks/contracts/base/PausableTask.sol index 539ce981..87460c07 100644 --- a/packages/tasks/contracts/base/PausableTask.sol +++ b/packages/tasks/contracts/base/PausableTask.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.17; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/IPausableTask.sol'; diff --git a/packages/tasks/contracts/base/TokenThresholdTask.sol b/packages/tasks/contracts/base/TokenThresholdTask.sol index 83d3087e..8108108d 100644 --- a/packages/tasks/contracts/base/TokenThresholdTask.sol +++ b/packages/tasks/contracts/base/TokenThresholdTask.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.3; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/ITokenThresholdTask.sol'; diff --git a/packages/tasks/contracts/base/VolumeLimitedTask.sol b/packages/tasks/contracts/base/VolumeLimitedTask.sol index 8d8525ac..be92c438 100644 --- a/packages/tasks/contracts/base/VolumeLimitedTask.sol +++ b/packages/tasks/contracts/base/VolumeLimitedTask.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.17; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/IVolumeLimitedTask.sol'; diff --git a/packages/tasks/contracts/bridge/AxelarBridger.sol b/packages/tasks/contracts/bridge/AxelarBridger.sol index 53605344..4152cabf 100644 --- a/packages/tasks/contracts/bridge/AxelarBridger.sol +++ b/packages/tasks/contracts/bridge/AxelarBridger.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/axelar/IAxelarConnector.sol'; import './BaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/bridge/BaseBridgeTask.sol b/packages/tasks/contracts/bridge/BaseBridgeTask.sol index aec873e2..aece6394 100644 --- a/packages/tasks/contracts/bridge/BaseBridgeTask.sol +++ b/packages/tasks/contracts/bridge/BaseBridgeTask.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '../Task.sol'; import '../interfaces/bridge/IBaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/bridge/ConnextBridger.sol b/packages/tasks/contracts/bridge/ConnextBridger.sol index 1e1794b0..e1f81e62 100644 --- a/packages/tasks/contracts/bridge/ConnextBridger.sol +++ b/packages/tasks/contracts/bridge/ConnextBridger.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/connext/IConnextConnector.sol'; import './BaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/bridge/HopBridger.sol b/packages/tasks/contracts/bridge/HopBridger.sol index a242d9e3..a187b0a1 100644 --- a/packages/tasks/contracts/bridge/HopBridger.sol +++ b/packages/tasks/contracts/bridge/HopBridger.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopBridgeConnector.sol'; import './BaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/bridge/SymbiosisBridger.sol b/packages/tasks/contracts/bridge/SymbiosisBridger.sol index 5b6bc36b..cdbcb42a 100644 --- a/packages/tasks/contracts/bridge/SymbiosisBridger.sol +++ b/packages/tasks/contracts/bridge/SymbiosisBridger.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/symbiosis/ISymbiosisConnector.sol'; import './BaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/bridge/WormholeBridger.sol b/packages/tasks/contracts/bridge/WormholeBridger.sol index 13eb1643..53786d22 100644 --- a/packages/tasks/contracts/bridge/WormholeBridger.sol +++ b/packages/tasks/contracts/bridge/WormholeBridger.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/wormhole/IWormholeConnector.sol'; import './BaseBridgeTask.sol'; diff --git a/packages/tasks/contracts/liquidity/balancer/BalancerV2PoolExiter.sol b/packages/tasks/contracts/liquidity/balancer/BalancerV2PoolExiter.sol index fc44dd9a..0a88ac49 100644 --- a/packages/tasks/contracts/liquidity/balancer/BalancerV2PoolExiter.sol +++ b/packages/tasks/contracts/liquidity/balancer/BalancerV2PoolExiter.sol @@ -16,7 +16,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2Vault.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2PoolConnector.sol'; diff --git a/packages/tasks/contracts/liquidity/convex/ConvexExiter.sol b/packages/tasks/contracts/liquidity/convex/ConvexExiter.sol index 752ed547..aae39ee5 100644 --- a/packages/tasks/contracts/liquidity/convex/ConvexExiter.sol +++ b/packages/tasks/contracts/liquidity/convex/ConvexExiter.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/convex/IConvexConnector.sol'; import './BaseConvexTask.sol'; diff --git a/packages/tasks/contracts/liquidity/convex/ConvexJoiner.sol b/packages/tasks/contracts/liquidity/convex/ConvexJoiner.sol index fe32718d..4397e9af 100644 --- a/packages/tasks/contracts/liquidity/convex/ConvexJoiner.sol +++ b/packages/tasks/contracts/liquidity/convex/ConvexJoiner.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/convex/IConvexConnector.sol'; import './BaseConvexTask.sol'; diff --git a/packages/tasks/contracts/liquidity/curve/BaseCurveTask.sol b/packages/tasks/contracts/liquidity/curve/BaseCurveTask.sol index d8fed6f3..fe9f5fc7 100644 --- a/packages/tasks/contracts/liquidity/curve/BaseCurveTask.sol +++ b/packages/tasks/contracts/liquidity/curve/BaseCurveTask.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '../../Task.sol'; import '../../interfaces/liquidity/curve/IBaseCurveTask.sol'; diff --git a/packages/tasks/contracts/liquidity/curve/Curve2CrvExiter.sol b/packages/tasks/contracts/liquidity/curve/Curve2CrvExiter.sol index f9a6605d..6e217079 100644 --- a/packages/tasks/contracts/liquidity/curve/Curve2CrvExiter.sol +++ b/packages/tasks/contracts/liquidity/curve/Curve2CrvExiter.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/curve/ICurve2CrvConnector.sol'; import './BaseCurveTask.sol'; diff --git a/packages/tasks/contracts/liquidity/curve/Curve2CrvJoiner.sol b/packages/tasks/contracts/liquidity/curve/Curve2CrvJoiner.sol index 36389e45..f9175521 100644 --- a/packages/tasks/contracts/liquidity/curve/Curve2CrvJoiner.sol +++ b/packages/tasks/contracts/liquidity/curve/Curve2CrvJoiner.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/curve/ICurve2CrvConnector.sol'; import './BaseCurveTask.sol'; diff --git a/packages/tasks/contracts/primitives/Collector.sol b/packages/tasks/contracts/primitives/Collector.sol index 632583f6..5bc33097 100644 --- a/packages/tasks/contracts/primitives/Collector.sol +++ b/packages/tasks/contracts/primitives/Collector.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../Task.sol'; import '../interfaces/primitives/ICollector.sol'; diff --git a/packages/tasks/contracts/primitives/Depositor.sol b/packages/tasks/contracts/primitives/Depositor.sol index f9f97148..0678d2bd 100644 --- a/packages/tasks/contracts/primitives/Depositor.sol +++ b/packages/tasks/contracts/primitives/Depositor.sol @@ -16,8 +16,8 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Address.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/primitives/IDepositor.sol'; diff --git a/packages/tasks/contracts/primitives/HandleOver.sol b/packages/tasks/contracts/primitives/HandleOver.sol index 951fde3b..33d867e7 100644 --- a/packages/tasks/contracts/primitives/HandleOver.sol +++ b/packages/tasks/contracts/primitives/HandleOver.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; +import '@mimic-fi/helpers/contracts/utils/ERC20Helpers.sol'; import '../Task.sol'; import '../interfaces/primitives/IHandleOver.sol'; diff --git a/packages/tasks/contracts/primitives/Wrapper.sol b/packages/tasks/contracts/primitives/Wrapper.sol index bc6e69f6..bdce0996 100644 --- a/packages/tasks/contracts/primitives/Wrapper.sol +++ b/packages/tasks/contracts/primitives/Wrapper.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/primitives/IWrapper.sol'; diff --git a/packages/tasks/contracts/relayer/BaseRelayerFundTask.sol b/packages/tasks/contracts/relayer/BaseRelayerFundTask.sol index 56eabc3c..ed208278 100644 --- a/packages/tasks/contracts/relayer/BaseRelayerFundTask.sol +++ b/packages/tasks/contracts/relayer/BaseRelayerFundTask.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-relayer/contracts/interfaces/IRelayer.sol'; import '../Task.sol'; diff --git a/packages/tasks/contracts/relayer/RelayerDepositor.sol b/packages/tasks/contracts/relayer/RelayerDepositor.sol index 62826dbd..6e7dbafb 100644 --- a/packages/tasks/contracts/relayer/RelayerDepositor.sol +++ b/packages/tasks/contracts/relayer/RelayerDepositor.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-relayer/contracts/interfaces/IRelayer.sol'; import '../Task.sol'; diff --git a/packages/tasks/contracts/swap/BalancerV2BoostedSwapper.sol b/packages/tasks/contracts/swap/BalancerV2BoostedSwapper.sol index cdbcb42e..ca80806e 100644 --- a/packages/tasks/contracts/swap/BalancerV2BoostedSwapper.sol +++ b/packages/tasks/contracts/swap/BalancerV2BoostedSwapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2Vault.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; diff --git a/packages/tasks/contracts/swap/BalancerV2BptSwapper.sol b/packages/tasks/contracts/swap/BalancerV2BptSwapper.sol index 0f3d9855..15b3b516 100644 --- a/packages/tasks/contracts/swap/BalancerV2BptSwapper.sol +++ b/packages/tasks/contracts/swap/BalancerV2BptSwapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/BalancerV2LinearSwapper.sol b/packages/tasks/contracts/swap/BalancerV2LinearSwapper.sol index 991004a8..303eda00 100644 --- a/packages/tasks/contracts/swap/BalancerV2LinearSwapper.sol +++ b/packages/tasks/contracts/swap/BalancerV2LinearSwapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BalancerV2BptSwapper.sol'; diff --git a/packages/tasks/contracts/swap/BalancerV2Swapper.sol b/packages/tasks/contracts/swap/BalancerV2Swapper.sol index 38f0850c..d2080a18 100644 --- a/packages/tasks/contracts/swap/BalancerV2Swapper.sol +++ b/packages/tasks/contracts/swap/BalancerV2Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/BaseSwapTask.sol b/packages/tasks/contracts/swap/BaseSwapTask.sol index e52e5f7d..3016a49a 100644 --- a/packages/tasks/contracts/swap/BaseSwapTask.sol +++ b/packages/tasks/contracts/swap/BaseSwapTask.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/swap/IBaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/BebopSwapper.sol b/packages/tasks/contracts/swap/BebopSwapper.sol index 0e5f8ae9..7d7b1f1c 100644 --- a/packages/tasks/contracts/swap/BebopSwapper.sol +++ b/packages/tasks/contracts/swap/BebopSwapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/bebop/IBebopConnector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/HopL2Swapper.sol b/packages/tasks/contracts/swap/HopL2Swapper.sol index 4b50eaad..4cb36baf 100644 --- a/packages/tasks/contracts/swap/HopL2Swapper.sol +++ b/packages/tasks/contracts/swap/HopL2Swapper.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopL2Amm.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopSwapConnector.sol'; diff --git a/packages/tasks/contracts/swap/KyberSwapV2Swapper.sol b/packages/tasks/contracts/swap/KyberSwapV2Swapper.sol index a99a58aa..d03d54a3 100644 --- a/packages/tasks/contracts/swap/KyberSwapV2Swapper.sol +++ b/packages/tasks/contracts/swap/KyberSwapV2Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/kyberswap/IKyberSwapV2Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/OdosV2Swapper.sol b/packages/tasks/contracts/swap/OdosV2Swapper.sol index 45bcba4e..922f2e24 100644 --- a/packages/tasks/contracts/swap/OdosV2Swapper.sol +++ b/packages/tasks/contracts/swap/OdosV2Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/odos/IOdosV2Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/OneInchV5Swapper.sol b/packages/tasks/contracts/swap/OneInchV5Swapper.sol index 756c1e78..b62c2645 100644 --- a/packages/tasks/contracts/swap/OneInchV5Swapper.sol +++ b/packages/tasks/contracts/swap/OneInchV5Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/1inch/IOneInchV5Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/ParaswapV5Swapper.sol b/packages/tasks/contracts/swap/ParaswapV5Swapper.sol index 4f389c7b..633f5171 100644 --- a/packages/tasks/contracts/swap/ParaswapV5Swapper.sol +++ b/packages/tasks/contracts/swap/ParaswapV5Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/paraswap/IParaswapV5Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/UniswapV2Swapper.sol b/packages/tasks/contracts/swap/UniswapV2Swapper.sol index 75203d36..1cefb5e3 100644 --- a/packages/tasks/contracts/swap/UniswapV2Swapper.sol +++ b/packages/tasks/contracts/swap/UniswapV2Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/uniswap/IUniswapV2Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/swap/UniswapV3Swapper.sol b/packages/tasks/contracts/swap/UniswapV3Swapper.sol index b232a6c5..df8f5173 100644 --- a/packages/tasks/contracts/swap/UniswapV3Swapper.sol +++ b/packages/tasks/contracts/swap/UniswapV3Swapper.sol @@ -14,8 +14,8 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; -import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; +import '@mimic-fi/helpers/contracts/math/FixedPoint.sol'; +import '@mimic-fi/helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/uniswap/IUniswapV3Connector.sol'; import './BaseSwapTask.sol'; diff --git a/packages/tasks/contracts/test/liquidity/ConvexConnectorMock.sol b/packages/tasks/contracts/test/liquidity/ConvexConnectorMock.sol index 375661bf..88d6ece9 100644 --- a/packages/tasks/contracts/test/liquidity/ConvexConnectorMock.sol +++ b/packages/tasks/contracts/test/liquidity/ConvexConnectorMock.sol @@ -14,7 +14,7 @@ pragma solidity ^0.8.0; -import '@mimic-fi/v3-helpers/contracts/mocks/TokenMock.sol'; +import '@mimic-fi/helpers/contracts/mocks/TokenMock.sol'; contract ConvexConnectorMock { IERC20 public immutable rewardToken; diff --git a/packages/tasks/contracts/test/mocks/FeedMock.sol b/packages/tasks/contracts/test/mocks/FeedMock.sol new file mode 100644 index 00000000..827d1bd4 --- /dev/null +++ b/packages/tasks/contracts/test/mocks/FeedMock.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +contract FeedMock { + uint8 public decimals; + int256 public price; + + constructor(int256 _price, uint8 _decimals) { + price = _price; + decimals = _decimals; + } + + function latestRoundData() external view returns (uint80, int256 answer, uint256, uint256, uint80) { + return (0, price, 0, 0, 0); + } +} diff --git a/packages/tasks/hardhat.config.ts b/packages/tasks/hardhat.config.ts index 9a009c6c..26d1b039 100644 --- a/packages/tasks/hardhat.config.ts +++ b/packages/tasks/hardhat.config.ts @@ -1,6 +1,6 @@ import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-waffle' -import '@mimic-fi/v3-helpers/dist/tests' +import '@mimic-fi/helpers/dist/tests' import 'hardhat-local-networks-config-plugin' import 'hardhat-gas-reporter' diff --git a/packages/tasks/package.json b/packages/tasks/package.json index b51a7030..54b8df9e 100644 --- a/packages/tasks/package.json +++ b/packages/tasks/package.json @@ -22,9 +22,9 @@ "prepare": "yarn build" }, "dependencies": { + "@mimic-fi/helpers": "1.0.0", "@mimic-fi/v3-authorizer": "0.1.1", "@mimic-fi/v3-connectors": "0.2.4", - "@mimic-fi/v3-helpers": "0.1.9", "@mimic-fi/v3-price-oracle": "0.1.0", "@mimic-fi/v3-smart-vault": "0.1.0", "@openzeppelin/contracts": "4.9.3", diff --git a/packages/tasks/src/setup.ts b/packages/tasks/src/setup.ts index c76955f3..e68814de 100644 --- a/packages/tasks/src/setup.ts +++ b/packages/tasks/src/setup.ts @@ -7,7 +7,7 @@ import { getSigner, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/BaseTask.test.ts b/packages/tasks/test/base/BaseTask.test.ts index f53d9d41..de8de35f 100644 --- a/packages/tasks/test/base/BaseTask.test.ts +++ b/packages/tasks/test/base/BaseTask.test.ts @@ -9,7 +9,7 @@ import { NATIVE_TOKEN_ADDRESS, ONES_BYTES32, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/GasLimitedTask.test.ts b/packages/tasks/test/base/GasLimitedTask.test.ts index 3d038940..0ec31949 100644 --- a/packages/tasks/test/base/GasLimitedTask.test.ts +++ b/packages/tasks/test/base/GasLimitedTask.test.ts @@ -7,7 +7,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/PausableTask.test.ts b/packages/tasks/test/base/PausableTask.test.ts index 815bd540..9af9f55b 100644 --- a/packages/tasks/test/base/PausableTask.test.ts +++ b/packages/tasks/test/base/PausableTask.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployProxy, fp, getSigners, NATIVE_TOKEN_ADDRESS, ZERO_BYTES32 } from '@mimic-fi/v3-helpers' +import { assertEvent, deployProxy, fp, getSigners, NATIVE_TOKEN_ADDRESS, ZERO_BYTES32 } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/TimeLockedTask.test.ts b/packages/tasks/test/base/TimeLockedTask.test.ts index c3f28530..ddda81c4 100644 --- a/packages/tasks/test/base/TimeLockedTask.test.ts +++ b/packages/tasks/test/base/TimeLockedTask.test.ts @@ -9,7 +9,7 @@ import { HOUR, MINUTE, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/TokenIndexedTask.test.ts b/packages/tasks/test/base/TokenIndexedTask.test.ts index 358f7aed..50b54319 100644 --- a/packages/tasks/test/base/TokenIndexedTask.test.ts +++ b/packages/tasks/test/base/TokenIndexedTask.test.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployProxy, getSigners, ZERO_ADDRESS, ZERO_BYTES32 } from '@mimic-fi/v3-helpers' +import { assertEvent, deployProxy, getSigners, ZERO_ADDRESS, ZERO_BYTES32 } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/base/TokenThresholdTask.test.ts b/packages/tasks/test/base/TokenThresholdTask.test.ts index 65b94a8c..b1c3d4b4 100644 --- a/packages/tasks/test/base/TokenThresholdTask.test.ts +++ b/packages/tasks/test/base/TokenThresholdTask.test.ts @@ -1,14 +1,14 @@ import { assertEvent, BigNumberish, - deployFeedMock, + deploy, deployProxy, deployTokenMock, fp, getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { Contract } from 'ethers' @@ -271,7 +271,7 @@ describe('TokenThresholdTask', () => { context('when there is a custom threshold set', () => { beforeEach('mock price feed', async () => { - const feed = await deployFeedMock(fp(1600), 18) + const feed = await deploy('FeedMock', [fp(1600), 18]) const setFeedRole = await priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(WETH, USDT, feed.address) @@ -306,7 +306,7 @@ describe('TokenThresholdTask', () => { context('when there is a default threshold set', () => { beforeEach('mock price feed', async () => { - const feed = await deployFeedMock(fp(1600), 18) + const feed = await deploy('FeedMock', [fp(1600), 18]) const setFeedRole = await priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(WETH, USDC, feed.address) @@ -342,7 +342,7 @@ describe('TokenThresholdTask', () => { context('when there is a custom threshold set', () => { beforeEach('mock price feed', async () => { - const feed = await deployFeedMock(fp(1650), 18) + const feed = await deploy('FeedMock', [fp(1650), 18]) const setFeedRole = await priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(WETH, USDT, feed.address) diff --git a/packages/tasks/test/base/VolumeLimitedTask.test.ts b/packages/tasks/test/base/VolumeLimitedTask.test.ts index ce9d8d6c..018ebeaf 100644 --- a/packages/tasks/test/base/VolumeLimitedTask.test.ts +++ b/packages/tasks/test/base/VolumeLimitedTask.test.ts @@ -3,7 +3,7 @@ import { assertEvent, BigNumberish, currentTimestamp, - deployFeedMock, + deploy, deployProxy, deployTokenMock, fp, @@ -12,7 +12,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { expect } from 'chai' import { Contract } from 'ethers' @@ -210,7 +210,7 @@ describe('VolumeLimitedTask', () => { beforeEach('deploy new token', async () => { newToken = await deployTokenMock('TKN') - const feed = await deployFeedMock(fp(rate), 18) + const feed = await deploy('FeedMock', [fp(rate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(token.address, newToken.address, feed.address) @@ -252,7 +252,7 @@ describe('VolumeLimitedTask', () => { beforeEach('deploy new token', async () => { newToken = await deployTokenMock('TKN') - const feed = await deployFeedMock(fp(rate), 18) + const feed = await deploy('FeedMock', [fp(rate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(token.address, newToken.address, feed.address) @@ -478,7 +478,7 @@ describe('VolumeLimitedTask', () => { beforeEach('deploy new token', async () => { newLimitToken = await deployTokenMock('TKN') - const feed = await deployFeedMock(fp(rate), 18) + const feed = await deploy('FeedMock', [fp(rate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(limitToken.address, newLimitToken.address, feed.address) @@ -510,7 +510,7 @@ describe('VolumeLimitedTask', () => { context('when there was some volume accrued', () => { beforeEach('accrue volume', async () => { - const feed = await deployFeedMock(fp(1), 18) + const feed = await deploy('FeedMock', [fp(1), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(token.address, limitToken.address, feed.address) @@ -525,7 +525,7 @@ describe('VolumeLimitedTask', () => { beforeEach('deploy new token', async () => { newLimitToken = await deployTokenMock('TKN') - const feed = await deployFeedMock(fp(rate), 18) + const feed = await deploy('FeedMock', [fp(rate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(limitToken.address, newLimitToken.address, feed.address) @@ -685,7 +685,7 @@ describe('VolumeLimitedTask', () => { beforeEach('deploy new token', async () => { limitToken = await deployTokenMock('TKN') - const feed = await deployFeedMock(fp(limitRate), 18) + const feed = await deploy('FeedMock', [fp(limitRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(token.address, limitToken.address, feed.address) diff --git a/packages/tasks/test/bridge/AxelarBridger.test.ts b/packages/tasks/test/bridge/AxelarBridger.test.ts index 1e8a2f02..be32403c 100644 --- a/packages/tasks/test/bridge/AxelarBridger.test.ts +++ b/packages/tasks/test/bridge/AxelarBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/bridge/BaseBridgeTask.behavior.ts b/packages/tasks/test/bridge/BaseBridgeTask.behavior.ts index b5458c2b..aa98d5ed 100644 --- a/packages/tasks/test/bridge/BaseBridgeTask.behavior.ts +++ b/packages/tasks/test/bridge/BaseBridgeTask.behavior.ts @@ -6,7 +6,7 @@ import { ONES_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' diff --git a/packages/tasks/test/bridge/ConnextBridger.test.ts b/packages/tasks/test/bridge/ConnextBridger.test.ts index d0a9cdec..3ea61b67 100644 --- a/packages/tasks/test/bridge/ConnextBridger.test.ts +++ b/packages/tasks/test/bridge/ConnextBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/bridge/HopBridger.test.ts b/packages/tasks/test/bridge/HopBridger.test.ts index 63ce5aaf..95a204f3 100644 --- a/packages/tasks/test/bridge/HopBridger.test.ts +++ b/packages/tasks/test/bridge/HopBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -13,7 +12,8 @@ import { MAX_UINT256, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/bridge/SocketBridger.test.ts b/packages/tasks/test/bridge/SocketBridger.test.ts index 6ef736b8..a6e37168 100644 --- a/packages/tasks/test/bridge/SocketBridger.test.ts +++ b/packages/tasks/test/bridge/SocketBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/bridge/SymbiosisBridger.test.ts b/packages/tasks/test/bridge/SymbiosisBridger.test.ts index 325f0086..a398ef6b 100644 --- a/packages/tasks/test/bridge/SymbiosisBridger.test.ts +++ b/packages/tasks/test/bridge/SymbiosisBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -12,7 +11,8 @@ import { ONES_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/bridge/WormholeBridger.test.ts b/packages/tasks/test/bridge/WormholeBridger.test.ts index f2948af2..56063d6d 100644 --- a/packages/tasks/test/bridge/WormholeBridger.test.ts +++ b/packages/tasks/test/bridge/WormholeBridger.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/balancer/BalancerV2PoolExiter.mainnet.ts b/packages/tasks/test/liquidity/balancer/BalancerV2PoolExiter.mainnet.ts index 078324e6..ae33826c 100644 --- a/packages/tasks/test/liquidity/balancer/BalancerV2PoolExiter.mainnet.ts +++ b/packages/tasks/test/liquidity/balancer/BalancerV2PoolExiter.mainnet.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { instanceAt, ONES_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ethers } from 'ethers' diff --git a/packages/tasks/test/liquidity/convex/BaseConvexTask.behavior.ts b/packages/tasks/test/liquidity/convex/BaseConvexTask.behavior.ts index 22269002..f6b88f6a 100644 --- a/packages/tasks/test/liquidity/convex/BaseConvexTask.behavior.ts +++ b/packages/tasks/test/liquidity/convex/BaseConvexTask.behavior.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployTokenMock, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deployTokenMock, ZERO_ADDRESS } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' diff --git a/packages/tasks/test/liquidity/convex/ConvexClaimer.test.ts b/packages/tasks/test/liquidity/convex/ConvexClaimer.test.ts index 189584bb..03c12d16 100644 --- a/packages/tasks/test/liquidity/convex/ConvexClaimer.test.ts +++ b/packages/tasks/test/liquidity/convex/ConvexClaimer.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -9,7 +8,8 @@ import { getSigners, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/convex/ConvexExiter.test.ts b/packages/tasks/test/liquidity/convex/ConvexExiter.test.ts index 2c5a9706..6a440241 100644 --- a/packages/tasks/test/liquidity/convex/ConvexExiter.test.ts +++ b/packages/tasks/test/liquidity/convex/ConvexExiter.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -10,7 +9,8 @@ import { fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/convex/ConvexJoiner.test.ts b/packages/tasks/test/liquidity/convex/ConvexJoiner.test.ts index 019d8872..541badbd 100644 --- a/packages/tasks/test/liquidity/convex/ConvexJoiner.test.ts +++ b/packages/tasks/test/liquidity/convex/ConvexJoiner.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -10,7 +9,8 @@ import { fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/curve/BaseCurveTask.behavior.ts b/packages/tasks/test/liquidity/curve/BaseCurveTask.behavior.ts index e54ff5f6..b4ab40c7 100644 --- a/packages/tasks/test/liquidity/curve/BaseCurveTask.behavior.ts +++ b/packages/tasks/test/liquidity/curve/BaseCurveTask.behavior.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' diff --git a/packages/tasks/test/liquidity/curve/Curve2CrvExiter.test.ts b/packages/tasks/test/liquidity/curve/Curve2CrvExiter.test.ts index a94c095a..6aa96a57 100644 --- a/packages/tasks/test/liquidity/curve/Curve2CrvExiter.test.ts +++ b/packages/tasks/test/liquidity/curve/Curve2CrvExiter.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -10,7 +9,8 @@ import { fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/curve/Curve2CrvJoiner.test.ts b/packages/tasks/test/liquidity/curve/Curve2CrvJoiner.test.ts index 2d96d92f..9fa553ea 100644 --- a/packages/tasks/test/liquidity/curve/Curve2CrvJoiner.test.ts +++ b/packages/tasks/test/liquidity/curve/Curve2CrvJoiner.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -10,7 +9,8 @@ import { fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/erc4626/BaseERC4626Task.behavior.ts b/packages/tasks/test/liquidity/erc4626/BaseERC4626Task.behavior.ts index c0c77e74..682751d2 100644 --- a/packages/tasks/test/liquidity/erc4626/BaseERC4626Task.behavior.ts +++ b/packages/tasks/test/liquidity/erc4626/BaseERC4626Task.behavior.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployTokenMock, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deployTokenMock, ZERO_ADDRESS } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' diff --git a/packages/tasks/test/liquidity/erc4626/ERC4626Exiter.test.ts b/packages/tasks/test/liquidity/erc4626/ERC4626Exiter.test.ts index d4b202fc..4a689071 100644 --- a/packages/tasks/test/liquidity/erc4626/ERC4626Exiter.test.ts +++ b/packages/tasks/test/liquidity/erc4626/ERC4626Exiter.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ONES_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/liquidity/erc4626/ERC4626Joiner.test.ts b/packages/tasks/test/liquidity/erc4626/ERC4626Joiner.test.ts index 1e34e0ed..ea05e08c 100644 --- a/packages/tasks/test/liquidity/erc4626/ERC4626Joiner.test.ts +++ b/packages/tasks/test/liquidity/erc4626/ERC4626Joiner.test.ts @@ -1,4 +1,3 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, @@ -11,7 +10,8 @@ import { getSigners, ONES_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/Collector.test.ts b/packages/tasks/test/primitives/Collector.test.ts index b85a5a91..c0a5577b 100644 --- a/packages/tasks/test/primitives/Collector.test.ts +++ b/packages/tasks/test/primitives/Collector.test.ts @@ -10,7 +10,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/Depositor.test.ts b/packages/tasks/test/primitives/Depositor.test.ts index 5322587f..0a9387b3 100644 --- a/packages/tasks/test/primitives/Depositor.test.ts +++ b/packages/tasks/test/primitives/Depositor.test.ts @@ -11,7 +11,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/HandleOver.test.ts b/packages/tasks/test/primitives/HandleOver.test.ts index 1ec85e54..672ee261 100644 --- a/packages/tasks/test/primitives/HandleOver.test.ts +++ b/packages/tasks/test/primitives/HandleOver.test.ts @@ -6,7 +6,7 @@ import { fp, getSigners, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { BigNumber, Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/Unwrapper.test.ts b/packages/tasks/test/primitives/Unwrapper.test.ts index 02d5b8cf..c6cc5a6e 100644 --- a/packages/tasks/test/primitives/Unwrapper.test.ts +++ b/packages/tasks/test/primitives/Unwrapper.test.ts @@ -8,7 +8,7 @@ import { getSigners, NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/Withdrawer.test.ts b/packages/tasks/test/primitives/Withdrawer.test.ts index cb3e1e30..b2f39e7e 100644 --- a/packages/tasks/test/primitives/Withdrawer.test.ts +++ b/packages/tasks/test/primitives/Withdrawer.test.ts @@ -10,7 +10,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/primitives/Wrapper.test.ts b/packages/tasks/test/primitives/Wrapper.test.ts index 17fb178b..3e5be8dc 100644 --- a/packages/tasks/test/primitives/Wrapper.test.ts +++ b/packages/tasks/test/primitives/Wrapper.test.ts @@ -8,7 +8,7 @@ import { getSigners, NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/relayer/BaseRelayerFundTask.behavior.ts b/packages/tasks/test/relayer/BaseRelayerFundTask.behavior.ts index 1e03c2eb..20143e8b 100644 --- a/packages/tasks/test/relayer/BaseRelayerFundTask.behavior.ts +++ b/packages/tasks/test/relayer/BaseRelayerFundTask.behavior.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployFeedMock, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deploy, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' @@ -71,7 +71,7 @@ export function itBehavesLikeBaseRelayerFundTask(executionType: string): void { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(thresholdNativeRate), 18) + const feed = await deploy('FeedMock', [fp(thresholdNativeRate), 18]) const setFeedRole = this.priceOracle.interface.getSighash('setFeed') await this.authorizer .connect(this.owner) @@ -133,7 +133,7 @@ export function itBehavesLikeBaseRelayerFundTask(executionType: string): void { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(fundingThresholdRate), 18) + const feed = await deploy('FeedMock', [fp(fundingThresholdRate), 18]) const setFeedRole = this.priceOracle.interface.getSighash('setFeed') await this.authorizer .connect(this.owner) diff --git a/packages/tasks/test/relayer/CollectorRelayerFunder.test.ts b/packages/tasks/test/relayer/CollectorRelayerFunder.test.ts index 1bc9f5af..84b1c13f 100644 --- a/packages/tasks/test/relayer/CollectorRelayerFunder.test.ts +++ b/packages/tasks/test/relayer/CollectorRelayerFunder.test.ts @@ -2,14 +2,13 @@ import { assertEvent, assertIndirectEvent, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -96,7 +95,7 @@ describe('CollectorRelayerFunder', () => { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(tokenRate)) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(mimic.wrappedNativeToken.address, token.address, feed.address) diff --git a/packages/tasks/test/relayer/OneInchV5RelayerFunder.test.ts b/packages/tasks/test/relayer/OneInchV5RelayerFunder.test.ts index b76bad0b..440e5b78 100644 --- a/packages/tasks/test/relayer/OneInchV5RelayerFunder.test.ts +++ b/packages/tasks/test/relayer/OneInchV5RelayerFunder.test.ts @@ -1,15 +1,14 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -116,7 +115,7 @@ describe('OneInchV5RelayerFunder', () => { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1).div(rateTokenInNative)) + const feed = await deploy('FeedMock', [fp(1).div(rateTokenInNative), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, mimic.wrappedNativeToken.address, feed.address) @@ -148,7 +147,7 @@ describe('OneInchV5RelayerFunder', () => { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1).div(rateTokenOutNative)) + const feed = await deploy('FeedMock', [fp(1).div(rateTokenOutNative), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenOut.address, mimic.wrappedNativeToken.address, feed.address) @@ -355,7 +354,7 @@ describe('OneInchV5RelayerFunder', () => { context('when there is no token out set', () => { beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1)) + const feed = await deploy('FeedMock', [fp(1), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle diff --git a/packages/tasks/test/relayer/ParaswapV5RelayerFunder.test.ts b/packages/tasks/test/relayer/ParaswapV5RelayerFunder.test.ts index e4a99d87..17520067 100644 --- a/packages/tasks/test/relayer/ParaswapV5RelayerFunder.test.ts +++ b/packages/tasks/test/relayer/ParaswapV5RelayerFunder.test.ts @@ -1,15 +1,14 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -116,7 +115,7 @@ describe('ParaswapV5RelayerFunder', () => { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1).div(rateTokenInNative)) + const feed = await deploy('FeedMock', [fp(1).div(rateTokenInNative), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, mimic.wrappedNativeToken.address, feed.address) @@ -148,7 +147,7 @@ describe('ParaswapV5RelayerFunder', () => { }) beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1).div(rateTokenOutNative)) + const feed = await deploy('FeedMock', [fp(1).div(rateTokenOutNative), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenOut.address, mimic.wrappedNativeToken.address, feed.address) @@ -355,7 +354,7 @@ describe('ParaswapV5RelayerFunder', () => { context('when there is no token out set', () => { beforeEach('set price feed', async function () { - const feed = await deployFeedMock(fp(1)) + const feed = await deploy('FeedMock', [fp(1), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle diff --git a/packages/tasks/test/relayer/RelayerDepositor.test.ts b/packages/tasks/test/relayer/RelayerDepositor.test.ts index 9a473862..2a18be4c 100644 --- a/packages/tasks/test/relayer/RelayerDepositor.test.ts +++ b/packages/tasks/test/relayer/RelayerDepositor.test.ts @@ -10,7 +10,7 @@ import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS, ZERO_BYTES32, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/relayer/UnwrapperRelayerFunder.test.ts b/packages/tasks/test/relayer/UnwrapperRelayerFunder.test.ts index e915b429..d7c281db 100644 --- a/packages/tasks/test/relayer/UnwrapperRelayerFunder.test.ts +++ b/packages/tasks/test/relayer/UnwrapperRelayerFunder.test.ts @@ -2,13 +2,12 @@ import { assertEvent, assertIndirectEvent, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -197,7 +196,7 @@ describe('UnwrapperRelayerFunder', () => { }) beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(1), 18) + const feed = await deploy('FeedMock', [fp(1), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(mimic.wrappedNativeToken.address, token.address, feed.address) diff --git a/packages/tasks/test/swap/BalancerV2BoostedSwapper.mainnet.ts b/packages/tasks/test/swap/BalancerV2BoostedSwapper.mainnet.ts index cb6c91dd..dd34cb9e 100644 --- a/packages/tasks/test/swap/BalancerV2BoostedSwapper.mainnet.ts +++ b/packages/tasks/test/swap/BalancerV2BoostedSwapper.mainnet.ts @@ -1,14 +1,5 @@ +import { deploy, deployProxy, fp, getSigners, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/helpers' import { OP } from '@mimic-fi/v3-authorizer' -import { - deploy, - deployFeedMock, - deployProxy, - fp, - getSigners, - impersonate, - instanceAt, - ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -122,7 +113,7 @@ describe('BalancerV2BoostedSwapper', function () { const rate = fp(1) beforeEach('set price feed', async () => { - const feed = await deployFeedMock(rate, 18) + const feed = await deploy('FeedMock', [rate, 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(pool.address, underlyingToken.address, feed.address) diff --git a/packages/tasks/test/swap/BalancerV2BptSwapper.test.ts b/packages/tasks/test/swap/BalancerV2BptSwapper.test.ts index ae02a16e..b32c3747 100644 --- a/packages/tasks/test/swap/BalancerV2BptSwapper.test.ts +++ b/packages/tasks/test/swap/BalancerV2BptSwapper.test.ts @@ -1,4 +1,4 @@ -import { deploy, deployProxy, getSigners, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { deploy, deployProxy, getSigners, ZERO_ADDRESS } from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { Contract } from 'ethers' diff --git a/packages/tasks/test/swap/BalancerV2LinearSwapper.mainnet.ts b/packages/tasks/test/swap/BalancerV2LinearSwapper.mainnet.ts index f897f879..27f61abf 100644 --- a/packages/tasks/test/swap/BalancerV2LinearSwapper.mainnet.ts +++ b/packages/tasks/test/swap/BalancerV2LinearSwapper.mainnet.ts @@ -1,14 +1,5 @@ +import { deploy, deployProxy, fp, getSigners, impersonate, instanceAt, ZERO_ADDRESS } from '@mimic-fi/helpers' import { OP } from '@mimic-fi/v3-authorizer' -import { - deploy, - deployFeedMock, - deployProxy, - fp, - getSigners, - impersonate, - instanceAt, - ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -113,7 +104,7 @@ describe('BalancerV2LinearSwapper', function () { const rate = fp(1) beforeEach('set price feed', async () => { - const feed = await deployFeedMock(rate, 18) + const feed = await deploy('FeedMock', [rate, 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(pool.address, mainToken.address, feed.address) diff --git a/packages/tasks/test/swap/BalancerV2Swapper.test.ts b/packages/tasks/test/swap/BalancerV2Swapper.test.ts index 638e1793..2301785a 100644 --- a/packages/tasks/test/swap/BalancerV2Swapper.test.ts +++ b/packages/tasks/test/swap/BalancerV2Swapper.test.ts @@ -8,7 +8,7 @@ import { ONES_ADDRESS, ONES_BYTES32, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' diff --git a/packages/tasks/test/swap/BaseSwapTask.behavior.ts b/packages/tasks/test/swap/BaseSwapTask.behavior.ts index 62428a85..3a48d308 100644 --- a/packages/tasks/test/swap/BaseSwapTask.behavior.ts +++ b/packages/tasks/test/swap/BaseSwapTask.behavior.ts @@ -1,4 +1,4 @@ -import { assertEvent, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/v3-helpers' +import { assertEvent, deployTokenMock, fp, ZERO_ADDRESS } from '@mimic-fi/helpers' import { expect } from 'chai' import { Contract } from 'ethers' import { ethers } from 'hardhat' diff --git a/packages/tasks/test/swap/BebopSwapper.test.ts b/packages/tasks/test/swap/BebopSwapper.test.ts index b498f40d..66dfd327 100644 --- a/packages/tasks/test/swap/BebopSwapper.test.ts +++ b/packages/tasks/test/swap/BebopSwapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -292,7 +291,7 @@ describe('BebopSwapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/HopL2Swapper.test.ts b/packages/tasks/test/swap/HopL2Swapper.test.ts index a3f3aa92..a7de7fd9 100644 --- a/packages/tasks/test/swap/HopL2Swapper.test.ts +++ b/packages/tasks/test/swap/HopL2Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertEvent, assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract } from 'ethers' @@ -200,7 +199,7 @@ describe('HopL2Swapper', () => { }) beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(1), 18) + const feed = await deploy('FeedMock', [fp(1), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/KyberSwapV2Swapper.test.ts b/packages/tasks/test/swap/KyberSwapV2Swapper.test.ts index eae4bfba..39f7777d 100644 --- a/packages/tasks/test/swap/KyberSwapV2Swapper.test.ts +++ b/packages/tasks/test/swap/KyberSwapV2Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -293,7 +292,7 @@ describe('KyberSwapV2Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/OdosV2Swapper.test.ts b/packages/tasks/test/swap/OdosV2Swapper.test.ts index 7a673410..470b2157 100644 --- a/packages/tasks/test/swap/OdosV2Swapper.test.ts +++ b/packages/tasks/test/swap/OdosV2Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -293,7 +292,7 @@ describe('OdosV2Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/OneInchV5Swapper.test.ts b/packages/tasks/test/swap/OneInchV5Swapper.test.ts index 6f5f4d45..56f11548 100644 --- a/packages/tasks/test/swap/OneInchV5Swapper.test.ts +++ b/packages/tasks/test/swap/OneInchV5Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -292,7 +291,7 @@ describe('OneInchV5Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/ParaswapV5Swapper.test.ts b/packages/tasks/test/swap/ParaswapV5Swapper.test.ts index 0190b688..d1578827 100644 --- a/packages/tasks/test/swap/ParaswapV5Swapper.test.ts +++ b/packages/tasks/test/swap/ParaswapV5Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -293,7 +292,7 @@ describe('ParaswapV5Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/UniswapV2Swapper.test.ts b/packages/tasks/test/swap/UniswapV2Swapper.test.ts index ba38d76e..ac2700e8 100644 --- a/packages/tasks/test/swap/UniswapV2Swapper.test.ts +++ b/packages/tasks/test/swap/UniswapV2Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -300,7 +299,7 @@ describe('UniswapV2Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/packages/tasks/test/swap/UniswapV3Swapper.test.ts b/packages/tasks/test/swap/UniswapV3Swapper.test.ts index 81fb1f6b..dd09604f 100644 --- a/packages/tasks/test/swap/UniswapV3Swapper.test.ts +++ b/packages/tasks/test/swap/UniswapV3Swapper.test.ts @@ -1,17 +1,16 @@ -import { OP } from '@mimic-fi/v3-authorizer' import { assertIndirectEvent, assertNoEvent, BigNumberish, deploy, - deployFeedMock, deployProxy, deployTokenMock, fp, getSigners, MAX_UINT256, ZERO_ADDRESS, -} from '@mimic-fi/v3-helpers' +} from '@mimic-fi/helpers' +import { OP } from '@mimic-fi/v3-authorizer' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address' import { expect } from 'chai' import { Contract, ContractTransaction } from 'ethers' @@ -317,7 +316,7 @@ describe('UniswapV3Swapper', () => { context('when no off-chain oracle is given', () => { context('when an on-chain oracle is given', () => { beforeEach('set price feed', async () => { - const feed = await deployFeedMock(fp(tokenRate), 18) + const feed = await deploy('FeedMock', [fp(tokenRate), 18]) const setFeedRole = priceOracle.interface.getSighash('setFeed') await authorizer.connect(owner).authorize(owner.address, priceOracle.address, setFeedRole, []) await priceOracle.connect(owner).setFeed(tokenIn.address, tokenOut.address, feed.address) diff --git a/yarn.lock b/yarn.lock index 7ffc6012..aeaa5097 100644 --- a/yarn.lock +++ b/yarn.lock @@ -937,6 +937,18 @@ "@mimic-fi/v3-helpers" "0.1.0" "@openzeppelin/contracts" "4.9.3" +"@mimic-fi/helpers@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@mimic-fi/helpers/-/helpers-1.0.0.tgz#6d28cb20e20d3a9f72d7014b80dfd5a3627918a9" + integrity sha512-t7+MAmXHlsXr13x6L32tjLE0yseh5c8emB3QgP5hnmhwOXy6tKkLPV89UGSATPm9lN61lsZC+HrQKbTXcsb7SA== + dependencies: + "@nomiclabs/hardhat-ethers" "^2.2.3" + "@nomiclabs/hardhat-waffle" "2.0.3" + "@openzeppelin/contracts" "5.0.2" + decimal.js "~10.4.3" + ethers "~5.6.0" + hardhat "^2.14.1" + "@mimic-fi/v3-authorizer@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimic-fi/v3-authorizer/-/v3-authorizer-0.1.0.tgz#10fa3b9c5ac7c3ab95d6c77764376a6707703d09" @@ -969,22 +981,6 @@ hardhat "^2.14.1" mocha "^6.2.3" -"@mimic-fi/v3-helpers@0.1.9": - version "0.1.9" - resolved "https://registry.yarnpkg.com/@mimic-fi/v3-helpers/-/v3-helpers-0.1.9.tgz#9de0de2e60c77580b0662780e952f05424a1bdb0" - integrity sha512-xJoVAlpQs+iVaL0fh/FZy2iOHRrLNtuE+8yHSCEmPJyokLTe5KbpuxnlyZV0pcZmYyquAWplnKU467QNqk5Z4A== - dependencies: - "@nomiclabs/hardhat-ethers" "^2.2.3" - "@nomiclabs/hardhat-waffle" "2.0.3" - "@types/chai" "^4.3.5" - "@types/mocha" "^10.0.1" - "@types/sinon-chai" "^3.2.3" - chai "^4.3.7" - decimal.js "~10.4.3" - ethers "~5.6.0" - hardhat "^2.14.1" - mocha "^6.2.3" - "@mimic-fi/v3-tasks@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimic-fi/v3-tasks/-/v3-tasks-0.1.0.tgz#ecd3dd570ec4423758f24e3c34e96d6a452473a9" @@ -1261,6 +1257,11 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== +"@openzeppelin/contracts@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" + integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== + "@quant-finance/solidity-datetime@2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@quant-finance/solidity-datetime/-/solidity-datetime-2.2.0.tgz#50f2d00a571d8cc2d962257b40b70fc44450dcaa"