Skip to content

Commit b83d01c

Browse files
refactor(UBA): sideload HRE environment variable (#289)
* refactor(UBA): sideload HRE environment variable This change essentially side-loads the HRE variables to prevent the need to directly interface with the Hardhat Runtime Environment. Signed-off-by: james-a-morris <[email protected]> * fix: resolve additional import issues Signed-off-by: james-a-morris <[email protected]> --------- Signed-off-by: james-a-morris <[email protected]>
1 parent 7a56413 commit b83d01c

31 files changed

+176
-80
lines changed

deploy/003_deploy_optimism_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deployNewProxy } from "../utils";
1+
import { deployNewProxy } from "../utils/utils.hre";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { HardhatRuntimeEnvironment } from "hardhat/types";
44

deploy/005_deploy_arbitrum_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { L2_ADDRESS_MAP } from "./consts";
3-
import { deployNewProxy } from "../utils";
3+
import { deployNewProxy } from "../utils/utils.hre";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
55

66
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

deploy/007_deploy_ethereum_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DeployFunction } from "hardhat-deploy/types";
2-
import { deployNewProxy } from "../utils";
2+
import { deployNewProxy } from "../utils/utils.hre";
33
import { L1_ADDRESS_MAP } from "./consts";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
55

deploy/011_deploy_polygon_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { L2_ADDRESS_MAP } from "./consts";
3-
import { deployNewProxy } from "../utils";
3+
import { deployNewProxy } from "../utils/utils.hre";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
55

66
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

deploy/013_deploy_boba_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DeployFunction } from "hardhat-deploy/types";
2-
import { deployNewProxy } from "../utils";
2+
import { deployNewProxy } from "../utils/utils.hre";
33
import { HardhatRuntimeEnvironment } from "hardhat/types";
44

55
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

deploy/016_deploy_zksync_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { L2_ADDRESS_MAP } from "./consts";
3-
import { deployNewProxy } from "../utils";
3+
import { deployNewProxy } from "../utils/utils.hre";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
55

66
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

scripts/mintERC1155.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { getContractFactory, ethers, hre } from "../utils/utils";
1+
import { getContractFactory, ethers } from "../utils/utils";
22
import { readFileSync } from "fs";
33
import path from "path";
44
import { getNodeUrl } from "@uma/common";
5+
import { hre } from "../utils/utils.hre";
56

67
const RECIPIENTS_CHUNK_SIZE = 100; // TODO: Still need to figure out which size is optimal
78

scripts/setERC1155Metadata.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getContractFactory, ethers, hre } from "../utils/utils";
1+
import { getContractFactory, ethers } from "../utils/utils";
2+
import { hre } from "../utils/utils.hre";
23
import { readFileSync } from "fs";
34
import path from "path";
45
import { CID } from "multiformats/cid";

test/HubPool.Admin.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
import { getContractFactory, SignerWithAddress, seedWallet, expect } from "../utils/utils";
2-
import { Contract, ethers, randomAddress, utf8ToHex } from "../utils/utils";
3-
import { originChainId, destinationChainId, bondAmount, zeroAddress, mockTreeRoot } from "./constants";
4-
import { mockSlowRelayRoot, finalFeeUsdc, finalFee, totalBond } from "./constants";
1+
import {
2+
getContractFactory,
3+
SignerWithAddress,
4+
seedWallet,
5+
expect,
6+
Contract,
7+
ethers,
8+
randomAddress,
9+
utf8ToHex,
10+
} from "../utils/utils";
11+
import {
12+
originChainId,
13+
destinationChainId,
14+
bondAmount,
15+
zeroAddress,
16+
mockTreeRoot,
17+
mockSlowRelayRoot,
18+
finalFeeUsdc,
19+
finalFee,
20+
totalBond,
21+
} from "./constants";
522
import { hubPoolFixture } from "./fixtures/HubPool.Fixture";
623

724
let hubPool: Contract, weth: Contract, usdc: Contract;

test/MerkleLib.Proofs.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { PoolRebalanceLeaf, RelayerRefundLeaf } from "./MerkleLib.utils";
22
import { merkleLibFixture } from "./fixtures/MerkleLib.Fixture";
33
import { MerkleTree, EMPTY_MERKLE_ROOT } from "../utils/MerkleTree";
4-
import { expect, randomBigNumber, randomAddress, getParamType, defaultAbiCoder } from "../utils/utils";
5-
import { keccak256, Contract, BigNumber } from "../utils/utils";
4+
import {
5+
expect,
6+
randomBigNumber,
7+
randomAddress,
8+
getParamType,
9+
defaultAbiCoder,
10+
keccak256,
11+
Contract,
12+
BigNumber,
13+
} from "../utils/utils";
614

715
let merkleLibTest: Contract;
816

0 commit comments

Comments
 (0)