Skip to content

Commit

Permalink
refactor: Update utils imports and exports
Browse files Browse the repository at this point in the history
Basic import plumbing to pull in depdencies from sdk-v2.
  • Loading branch information
pxrl committed Sep 29, 2023
1 parent c210556 commit f4c986f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
57 changes: 38 additions & 19 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
// Utils from other packages.
import { constants as sdkConstants } from "@across-protocol/sdk-v2";
import { constants as ethersConstants } from "ethers";

import winston from "winston";
import assert from "assert";

export { winston, assert };
export { Logger } from "@uma/financial-templates-lib";

export { BigNumber, Signer, Contract, ContractFactory, Transaction, BigNumberish } from "ethers";
export { utils, EventFilter, BaseContract, Event, Wallet } from "ethers";
export { ethers, providers } from "ethers";
export const { MAX_SAFE_ALLOWANCE } = sdkConstants;
export const { AddressZero: ZERO_ADDRESS, MaxUint256: MAX_UINT_VAL } = ethersConstants;

export {
ethers,
providers,
utils,
BaseContract,
BigNumber,
BigNumberish,
Contract,
ContractFactory,
Event,
EventFilter,
Signer,
Transaction,
Wallet,
} from "ethers";
export type { Block, TransactionResponse, TransactionReceipt, Provider } from "@ethersproject/abstract-provider";

export { config } from "dotenv";

export { replaceAddressCase } from "@uma/common";
export { Logger } from "@uma/financial-templates-lib";

// TypeChain exports used in the bot.
export {
getContractInfoFromAddress,
getDeployedAddress,
getDeployedBlockNumber,
ExpandedERC20__factory as ERC20,
HubPool__factory as HubPool,
SpokePool__factory as SpokePool,
AcrossConfigStore__factory as AcrossConfigStore,
PolygonTokenBridger__factory as PolygonTokenBridger,
WETH9__factory as WETH9,
} from "@across-protocol/contracts-v2";

// Utils specifically for this bot.
export * from "./SDKUtils";
export * from "./chains";
Expand Down Expand Up @@ -39,17 +72,3 @@ export * from "./RedisUtils";
export * from "./UmaUtils";
export * from "./TokenUtils";
export * from "./CLIUtils";

export { ZERO_ADDRESS, MAX_SAFE_ALLOWANCE, MAX_UINT_VAL, replaceAddressCase } from "@uma/common";

// TypeChain exports used in the bot.
export {
ExpandedERC20__factory as ERC20,
HubPool__factory as HubPool,
SpokePool__factory as SpokePool,
AcrossConfigStore__factory as AcrossConfigStore,
PolygonTokenBridger__factory as PolygonTokenBridger,
WETH9__factory as WETH9,
} from "@across-protocol/contracts-v2";

export { getDeployedAddress, getDeployedBlockNumber, getContractInfoFromAddress } from "@across-protocol/contracts-v2";
2 changes: 1 addition & 1 deletion test/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
zeroAddress,
} from "../constants";
import { BigNumber, Contract, SignerWithAddress, deposit } from "./index";
export { MAX_SAFE_ALLOWANCE, MAX_UINT_VAL } from "@uma/common";
export { sinon, winston };
export { MAX_SAFE_ALLOWANCE, MAX_UINT_VAL } from "../../src/utils";

import { AcrossConfigStore, MerkleTree } from "@across-protocol/contracts-v2";
import { constants } from "@across-protocol/sdk-v2";
Expand Down

0 comments on commit f4c986f

Please sign in to comment.