Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Sep 4, 2023
2 parents 03cdcf1 + 87a704c commit 3d8c98d
Show file tree
Hide file tree
Showing 79 changed files with 1,345 additions and 670 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
// Disable warnings for { a, b, ...rest } variables, since this is typically used to remove variables.
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
"chai-expect/missing-assertion": 2,
"no-duplicate-imports": "error",
},
settings: {
node: {
Expand Down
14 changes: 12 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import minimist from "minimist";
import { CommonConfig } from "./src/common";
import { AnyObject, config, delay, getSigner, help, Logger, processCrash, usage, winston } from "./src/utils";
import {
AnyObject,
config,
delay,
retrieveSignerFromCLIArgs,
help,
Logger,
processCrash,
usage,
winston,
} from "./src/utils";
import { runRelayer } from "./src/relayer";
import { runDataworker } from "./src/dataworker";
import { runMonitor } from "./src/monitor";
Expand Down Expand Up @@ -37,7 +47,7 @@ export async function run(args: { [k: string]: boolean | string }): Promise<void
// todo: Update usage() to provide a hint that wallet is missing/malformed.
usage(""); // no return
} else {
const signer = await getSigner();
const signer = await retrieveSignerFromCLIArgs();
do {
try {
// One global signer for use with a specific per-chain provider.
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@across-protocol/contracts-v2": "2.4.3",
"@across-protocol/sdk-v2": "0.15.18",
"@across-protocol/sdk-v2": "0.15.20",
"@arbitrum/sdk": "^3.1.3",
"@defi-wonderland/smock": "^2.3.5",
"@eth-optimism/sdk": "^3.1.0",
Expand All @@ -26,7 +26,7 @@
"@uma/common": "2.33.0",
"@uma/contracts-node": "^0.4.16",
"@uma/financial-templates-lib": "^2.32.11",
"@uma/sdk": "^0.34.0",
"@uma/sdk": "^0.34.2",
"async": "^3.2.4",
"axios": "^1.4.0",
"dotenv": "^16.3.1",
Expand Down Expand Up @@ -57,7 +57,8 @@
"clean": "dir=\"./node_modules\"; mv \"${dir}\" \"${dir}_\" 2>/dev/null && rm -r \"${dir}_\" &",
"reinstall": "yarn clean && yarn install && yarn build",
"update": "git pull && yarn reinstall && yarn version --non-interactive && git show --quiet",
"relay": "HARDHAT_CONFIG=./dist/hardhat.config.js node ./dist/index.js --relayer"
"relay": "HARDHAT_CONFIG=./dist/hardhat.config.js node ./dist/index.js --relayer",
"deposit": "yarn ts-node ./scripts/spokepool.ts deposit"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.3",
Expand Down
4 changes: 2 additions & 2 deletions scripts/constructEmergencyRoot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PoolRebalanceLeaf } from "../src/interfaces";
import {
ethers,
getSigner,
retrieveSignerFromCLIArgs,
RelayerRefundLeaf,
MerkleTree,
buildRelayerRefundTree,
Expand Down Expand Up @@ -33,7 +33,7 @@ function prettyPoolRebalanceLeaf(leaves: PoolRebalanceLeaf[]) {
}
// This script can be used to generate a manual merkle root and is filled with example data.
export async function run(): Promise<void> {
const baseSigner = await getSigner();
const baseSigner = await retrieveSignerFromCLIArgs();

// 1. Construct relayer refund leaves
const relayerRefundLeaves: RelayerRefundLeaf[] = [
Expand Down
4 changes: 2 additions & 2 deletions scripts/disableDepositRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-process-exit */
import { getSigner, winston, Logger, assert } from "../src/utils";
import { retrieveSignerFromCLIArgs, winston, Logger, assert } from "../src/utils";
import { CommonConfig, constructClients, constructSpokePoolClientsWithStartBlocks, updateClients } from "../src/common";

import minimist from "minimist";
Expand All @@ -19,7 +19,7 @@ export async function run(logger: winston.Logger): Promise<void> {
message: "Constructing data to disable all deposits to or from the following chains",
chainsToDisable,
});
const baseSigner = await getSigner();
const baseSigner = await retrieveSignerFromCLIArgs();
const config = new CommonConfig(process.env);

// Get all deposit routes involving chainId and token
Expand Down
4 changes: 2 additions & 2 deletions scripts/sendTokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ethers, getSigner, getProvider, ERC20, ZERO_ADDRESS, toBN, getGasPrice } from "../src/utils";
import { ethers, retrieveSignerFromCLIArgs, getProvider, ERC20, ZERO_ADDRESS, toBN, getGasPrice } from "../src/utils";
import { askYesNoQuestion } from "./utils";
import minimist from "minimist";
const args = minimist(process.argv.slice(2), {
Expand Down Expand Up @@ -27,7 +27,7 @@ export async function run(): Promise<void> {
if (!Object.keys(args).includes("chainId")) {
throw new Error("Define `chainId` as the chain you want to connect on");
}
const baseSigner = await getSigner();
const baseSigner = await retrieveSignerFromCLIArgs();
const connectedSigner = baseSigner.connect(await getProvider(Number(args.chainId)));
console.log("Connected to account", connectedSigner.address);
const recipient = args.to;
Expand Down
Loading

0 comments on commit 3d8c98d

Please sign in to comment.