diff --git a/deploy/001_deploy_hubpool.ts b/deploy/001_deploy_hubpool.ts index 6fed96b4b..6e9aac8c5 100644 --- a/deploy/001_deploy_hubpool.ts +++ b/deploy/001_deploy_hubpool.ts @@ -1,9 +1,9 @@ import { L1_ADDRESS_MAP } from "./consts"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/002_deploy_optimism_adapter.ts b/deploy/002_deploy_optimism_adapter.ts index 038bf45be..a9a2d5624 100644 --- a/deploy/002_deploy_optimism_adapter.ts +++ b/deploy/002_deploy_optimism_adapter.ts @@ -1,9 +1,8 @@ import { L1_ADDRESS_MAP } from "./consts"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/003_deploy_optimism_spokepool.ts b/deploy/003_deploy_optimism_spokepool.ts index 07f70d4ff..c10d26ae3 100644 --- a/deploy/003_deploy_optimism_spokepool.ts +++ b/deploy/003_deploy_optimism_spokepool.ts @@ -1,8 +1,8 @@ -import "hardhat-deploy"; -import hre from "hardhat"; import { deployNewProxy } from "../utils"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/004_deploy_arbitrum_adapter.ts b/deploy/004_deploy_arbitrum_adapter.ts index c903aee16..f78541aea 100644 --- a/deploy/004_deploy_arbitrum_adapter.ts +++ b/deploy/004_deploy_arbitrum_adapter.ts @@ -1,9 +1,8 @@ import { L1_ADDRESS_MAP } from "./consts"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/005_deploy_arbitrum_spokepool.ts b/deploy/005_deploy_arbitrum_spokepool.ts index f9e6cef25..944606a7f 100644 --- a/deploy/005_deploy_arbitrum_spokepool.ts +++ b/deploy/005_deploy_arbitrum_spokepool.ts @@ -1,9 +1,9 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { L2_ADDRESS_MAP } from "./consts"; import { deployNewProxy } from "../utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/006_deploy_ethereum_adapter.ts b/deploy/006_deploy_ethereum_adapter.ts index a2f740f2f..6815cd6a3 100644 --- a/deploy/006_deploy_ethereum_adapter.ts +++ b/deploy/006_deploy_ethereum_adapter.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deploy } = deployments; diff --git a/deploy/007_deploy_ethereum_spokepool.ts b/deploy/007_deploy_ethereum_spokepool.ts index f645731b4..00e28e70b 100644 --- a/deploy/007_deploy_ethereum_spokepool.ts +++ b/deploy/007_deploy_ethereum_spokepool.ts @@ -1,11 +1,9 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { deployNewProxy } from "../utils"; import { L1_ADDRESS_MAP } from "./consts"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -export async function printProxyVerificationInstructions() {} - -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/008_deploy_polygon_token_bridger_mainnet.ts b/deploy/008_deploy_polygon_token_bridger_mainnet.ts index 45327bc32..46b337f93 100644 --- a/deploy/008_deploy_polygon_token_bridger_mainnet.ts +++ b/deploy/008_deploy_polygon_token_bridger_mainnet.ts @@ -1,9 +1,8 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - +import { DeployFunction } from "hardhat-deploy/types"; import { L1_ADDRESS_MAP, POLYGON_CHAIN_IDS } from "./consts"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/009_deploy_polygon_adapter.ts b/deploy/009_deploy_polygon_adapter.ts index 7c5902299..f45d8e8cb 100644 --- a/deploy/009_deploy_polygon_adapter.ts +++ b/deploy/009_deploy_polygon_adapter.ts @@ -1,9 +1,8 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - +import { DeployFunction } from "hardhat-deploy/types"; import { L1_ADDRESS_MAP } from "./consts"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/010_deploy_polygon_token_bridger_polygon.ts b/deploy/010_deploy_polygon_token_bridger_polygon.ts index 1b8cee2cc..9ebd8003d 100644 --- a/deploy/010_deploy_polygon_token_bridger_polygon.ts +++ b/deploy/010_deploy_polygon_token_bridger_polygon.ts @@ -1,9 +1,8 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - +import { DeployFunction } from "hardhat-deploy/types"; import { L1_ADDRESS_MAP } from "./consts"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/011_deploy_polygon_spokepool.ts b/deploy/011_deploy_polygon_spokepool.ts index 02eeebb59..d68e407b4 100644 --- a/deploy/011_deploy_polygon_spokepool.ts +++ b/deploy/011_deploy_polygon_spokepool.ts @@ -1,9 +1,9 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { L2_ADDRESS_MAP } from "./consts"; import { deployNewProxy } from "../utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/012_deploy_boba_adapter.ts b/deploy/012_deploy_boba_adapter.ts index c1ab12744..89154d530 100644 --- a/deploy/012_deploy_boba_adapter.ts +++ b/deploy/012_deploy_boba_adapter.ts @@ -1,9 +1,8 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; import { L1_ADDRESS_MAP } from "./consts"; +import { DeployFunction } from "hardhat-deploy/types"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/013_deploy_boba_spokepool.ts b/deploy/013_deploy_boba_spokepool.ts index 22335cc0b..8b7114506 100644 --- a/deploy/013_deploy_boba_spokepool.ts +++ b/deploy/013_deploy_boba_spokepool.ts @@ -1,8 +1,8 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { deployNewProxy } from "../utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/014_deploy_config_store.ts b/deploy/014_deploy_config_store.ts index 8ae023e14..64ad8ad44 100644 --- a/deploy/014_deploy_config_store.ts +++ b/deploy/014_deploy_config_store.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deploy } = deployments; diff --git a/deploy/015_deploy_zksync_adapter.ts b/deploy/015_deploy_zksync_adapter.ts index a78b14db8..a5703e177 100644 --- a/deploy/015_deploy_zksync_adapter.ts +++ b/deploy/015_deploy_zksync_adapter.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deploy } = deployments; diff --git a/deploy/016_deploy_zksync_spokepool.ts b/deploy/016_deploy_zksync_spokepool.ts index a7a631db8..4eb10a00f 100644 --- a/deploy/016_deploy_zksync_spokepool.ts +++ b/deploy/016_deploy_zksync_spokepool.ts @@ -1,9 +1,9 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { L2_ADDRESS_MAP } from "./consts"; import { deployNewProxy } from "../utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const hubPool = await hre.companionNetworks.l1.deployments.get("HubPool"); const chainId = await hre.getChainId(); console.log(`Using L1 (chainId ${chainId}) hub pool @ ${hubPool.address}`); diff --git a/deploy/017_deploy_ethereum_merkle_distributor.ts b/deploy/017_deploy_ethereum_merkle_distributor.ts index b126c6d01..3ae0a60f2 100644 --- a/deploy/017_deploy_ethereum_merkle_distributor.ts +++ b/deploy/017_deploy_ethereum_merkle_distributor.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deploy } = deployments; diff --git a/deploy/018_deploy_arbitrum_rescueadapter.ts b/deploy/018_deploy_arbitrum_rescueadapter.ts index a7f1ab21e..a7454dc73 100644 --- a/deploy/018_deploy_arbitrum_rescueadapter.ts +++ b/deploy/018_deploy_arbitrum_rescueadapter.ts @@ -1,9 +1,8 @@ import { L1_ADDRESS_MAP } from "./consts"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/019_deploy_bond_token.ts b/deploy/019_deploy_bond_token.ts index c3b92f9a8..5e5c7717c 100644 --- a/deploy/019_deploy_bond_token.ts +++ b/deploy/019_deploy_bond_token.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deployer } = await getNamedAccounts(); diff --git a/deploy/020_deploy_arbitrum_sendtoken_adapter.ts b/deploy/020_deploy_arbitrum_sendtoken_adapter.ts index be3eac53b..9ae219825 100644 --- a/deploy/020_deploy_arbitrum_sendtoken_adapter.ts +++ b/deploy/020_deploy_arbitrum_sendtoken_adapter.ts @@ -1,9 +1,8 @@ import { L1_ADDRESS_MAP } from "./consts"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; - -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, getChainId } = hre; const { deploy } = deployments; diff --git a/deploy/021_deploy_erc1155.ts b/deploy/021_deploy_erc1155.ts index d6e5b03b5..039c9005a 100644 --- a/deploy/021_deploy_erc1155.ts +++ b/deploy/021_deploy_erc1155.ts @@ -1,7 +1,7 @@ -import "hardhat-deploy"; -import { HardhatRuntimeEnvironment } from "hardhat/types/runtime"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function (hre: HardhatRuntimeEnvironment) { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts } = hre; const { deploy } = deployments; diff --git a/deploy/022_upgrade_spokepool.ts b/deploy/022_upgrade_spokepool.ts index 63c1d9ed6..f409fcadd 100644 --- a/deploy/022_upgrade_spokepool.ts +++ b/deploy/022_upgrade_spokepool.ts @@ -1,9 +1,9 @@ -import "hardhat-deploy"; -import hre from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; import { getContractFactory } from "../utils"; import * as deployments from "../deployments/deployments.json"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; -const func = async function () { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { upgrades, run, getChainId, getNamedAccounts } = hre; const { deployer } = await getNamedAccounts(); diff --git a/package.json b/package.json index 7aea2851f..1a8a83d80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts-v2", - "version": "2.2.0", + "version": "2.2.1", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { diff --git a/test/fixtures/MerkleLib.Fixture.ts b/test/fixtures/MerkleLib.Fixture.ts index 6ebd2056a..a975a2cc0 100644 --- a/test/fixtures/MerkleLib.Fixture.ts +++ b/test/fixtures/MerkleLib.Fixture.ts @@ -1,10 +1,7 @@ -import { Contract, getContractFactory } from "../../utils/utils"; -import hre from "hardhat"; +import { Contract, getContractFactory, hre } from "../../utils/utils"; -export const merkleLibFixture: () => Promise<{ merkleLibTest: Contract }> = hre.deployments.createFixture( - async ({ deployments }) => { - const [signer] = await hre.ethers.getSigners(); - const merkleLibTest = await (await getContractFactory("MerkleLibTest", { signer })).deploy(); - return { merkleLibTest }; - } -); +export const merkleLibFixture: () => Promise<{ merkleLibTest: Contract }> = hre.deployments.createFixture(async () => { + const [signer] = await hre.ethers.getSigners(); + const merkleLibTest = await (await getContractFactory("MerkleLibTest", { signer })).deploy(); + return { merkleLibTest }; +}); diff --git a/utils/utils.ts b/utils/utils.ts index f89be8c4a..ac60f1769 100644 --- a/utils/utils.ts +++ b/utils/utils.ts @@ -5,14 +5,14 @@ import * as chai from "chai"; import { getBytecode, getAbi } from "@uma/contracts-node"; import * as optimismContracts from "@eth-optimism/contracts"; import { smock, FakeContract } from "@defi-wonderland/smock"; -chai.use(smock.matchers); +import { FactoryOptions } from "hardhat/types"; import hre from "hardhat"; import { ethers } from "hardhat"; import { BigNumber, Signer, Contract, ContractFactory } from "ethers"; -import { FactoryOptions } from "hardhat/types"; - export { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +chai.use(smock.matchers); + function isFactoryOptions(signerOrFactoryOptions: Signer | FactoryOptions): signerOrFactoryOptions is FactoryOptions { return "signer" in signerOrFactoryOptions || "libraries" in signerOrFactoryOptions; }