Skip to content

Commit

Permalink
Sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Sep 18, 2023
1 parent 88ef07f commit 22240bf
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 43 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = {
"never"
],

"sort-imports": "warn",
"sort-keys": "warn"
}
};
3 changes: 2 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {HardhatUserConfig} from "hardhat/config";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-ethers";
import "@openzeppelin/hardhat-upgrades";
import {HardhatUserConfig} from "hardhat/config";


const coreArtifacts =
"node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json";
Expand Down
8 changes: 4 additions & 4 deletions src/contractFactory.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {artifacts, ethers} from "hardhat";
import {promises as fs} from "fs";
import {hashBytecode} from "@openzeppelin/upgrades-core";
import {LinkReferences} from "hardhat/types";
import {SkaleManifestData} from "./types/SkaleManifestData";
import {
deployLibraries,
getLinkedContractFactory,
getManifestFile
} from "./deploy";
import {LinkReferences} from "hardhat/types";
import {SkaleManifestData} from "./types/SkaleManifestData";
import {promises as fs} from "fs";
import {hashBytecode} from "@openzeppelin/upgrades-core";


const getSkaleManifest = async () => {
Expand Down
7 changes: 4 additions & 3 deletions src/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core";
import {artifacts, ethers} from "hardhat";
import {promises as fs} from "fs";
import {SkaleManifestData} from "./types/SkaleManifestData";
import {hexConcat, hexDataSlice} from "ethers/lib/utils";
import {Artifact} from "hardhat/types";
import {hexDataSlice, hexConcat} from "ethers/lib/utils";
import {SkaleManifestData} from "./types/SkaleManifestData";
import {promises as fs} from "fs";
import {getLibrariesNames} from "./contractFactory";


interface LibraryArtifacts {
[key: string]: unknown
}
Expand Down
10 changes: 5 additions & 5 deletions src/gnosis-safe.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import chalk from "chalk";
import {ethers} from "hardhat";
import {UnsignedTransaction} from "ethers";
import SafeApiKit from "@safe-global/api-kit";
import Safe, {EthersAdapter} from "@safe-global/protocol-kit";
import {
MetaTransactionData,
OperationType,
SafeTransaction,
SafeTransactionDataPartial
} from "@safe-global/safe-core-sdk-types";
import Safe, {EthersAdapter} from "@safe-global/protocol-kit";
import SafeApiKit from "@safe-global/api-kit";
import {UnsignedTransaction} from "ethers";
import chalk from "chalk";
import {ethers} from "hardhat";
import {getNetwork} from "@ethersproject/networks";


Expand Down
3 changes: 2 additions & 1 deletion src/multiSend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {OperationType} from "@safe-global/safe-core-sdk-types";
import {BigNumberish, BytesLike} from "ethers";
import {
hexConcat,
Expand All @@ -7,6 +6,8 @@ import {
hexZeroPad,
hexlify
} from "ethers/lib/utils";
import {OperationType} from "@safe-global/safe-core-sdk-types";


interface Transaction {

Expand Down
17 changes: 9 additions & 8 deletions src/submitters/auto-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin";
import {Transaction} from "ethers";
import {ProxyAdmin} from "../../typechain-types";
import {Submitter} from "./submitter";
import hre, {ethers} from "hardhat";
import {EXIT_CODES} from "../exitCodes";
import {EoaSubmitter} from "./eoa-submitter";
import {SafeSubmitter} from "./safe-submitter";
import chalk from "chalk";
import {MARIONETTE_ADDRESS} from "./types/marionette";
import {ProxyAdmin} from "../../typechain-types";
import {
SafeImaLegacyMarionetteSubmitter
} from "./safe-ima-legacy-marionette-submitter";
import {MARIONETTE_ADDRESS} from "./types/marionette";
import {SafeSubmitter} from "./safe-submitter";
import {Submitter} from "./submitter";
import {Transaction} from "ethers";
import chalk from "chalk";
import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin";
import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5";
import {EXIT_CODES} from "../exitCodes";


export class AutoSubmitter extends Submitter {
name = "Auto Submitter";
Expand Down
5 changes: 3 additions & 2 deletions src/submitters/eoa-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ethers} from "hardhat";
import {UnsignedTransaction} from "ethers";
import {Submitter} from "./submitter";
import {UnsignedTransaction} from "ethers";
import {ethers} from "hardhat";


export class EoaSubmitter extends Submitter {
name = "EOA Submitter";
Expand Down
5 changes: 3 additions & 2 deletions src/submitters/safe-ima-legacy-marionette-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {BytesLike, UnsignedTransaction} from "ethers";
import {ethers} from "hardhat";
import {SafeToImaSubmitter} from "./safe-to-ima-submitter";
import {MARIONETTE_ADDRESS} from "./types/marionette";
import {SafeToImaSubmitter} from "./safe-to-ima-submitter";
import {ethers} from "hardhat";


export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter {
marionette = new ethers.Contract(
Expand Down
5 changes: 3 additions & 2 deletions src/submitters/safe-ima-marionette-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette";
import {SafeToImaSubmitter} from "./safe-to-ima-submitter";
import {UnsignedTransaction} from "ethers";
import {ethers} from "hardhat";
import {SafeToImaSubmitter} from "./safe-to-ima-submitter";
import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette";


export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter {
marionette = new ethers.Contract(
Expand Down
5 changes: 3 additions & 2 deletions src/submitters/safe-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Submitter} from "./submitter";
import {UnsignedTransaction} from "ethers";
import {ethers} from "hardhat";
import {createMultiSendTransaction} from "../gnosis-safe";
import {Submitter} from "./submitter";
import {ethers} from "hardhat";


export class SafeSubmitter extends Submitter {
safeAddress: string;
Expand Down
3 changes: 2 additions & 1 deletion src/submitters/safe-to-ima-submitter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {BytesLike, Contract, UnsignedTransaction} from "ethers";
import {SafeSubmitter} from "./safe-submitter";
import {Instance} from "@skalenetwork/skale-contracts-ethers-v5";
import {SafeSubmitter} from "./safe-submitter";


interface Network {
targetSchainHash: BytesLike,
Expand Down
3 changes: 2 additions & 1 deletion src/submitters/submitter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {EXIT_CODES} from "../exitCodes";
import {UnsignedTransaction} from "ethers";
import chalk from "chalk";
import {EXIT_CODES} from "../exitCodes";


export abstract class Submitter {
abstract submit(transactions: UnsignedTransaction[]): Promise<void>;
Expand Down
18 changes: 9 additions & 9 deletions src/upgrader.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import hre, {network, upgrades} from "hardhat";
import chalk from "chalk";
import {AutoSubmitter} from "./submitters/auto-submitter";
import {EXIT_CODES} from "./exitCodes";
import {Instance} from "@skalenetwork/skale-contracts-ethers-v5";
import {ProxyAdmin} from "../typechain-types";
import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin";
import {getVersion} from "./version";
import {promises as fs} from "fs";
import {Submitter} from "./submitters/submitter";
import {UnsignedTransaction} from "ethers";
import chalk from "chalk";
import {promises as fs} from "fs";
import {getContractFactoryAndUpdateManifest} from "./contractFactory";
import {getImplementationAddress} from "@openzeppelin/upgrades-core";
import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin";
import {getVersion} from "./version";
import {verify} from "./verification";
import {Submitter} from "./submitters/submitter";
import {AutoSubmitter} from "./submitters/auto-submitter";
import {Instance} from "@skalenetwork/skale-contracts-ethers-v5";
import {getContractFactoryAndUpdateManifest} from "./contractFactory";
import {EXIT_CODES} from "./exitCodes";


interface ContractToUpgrade {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {exec as asyncExec} from "child_process";
import {existsSync, promises as fs} from "fs";
import {exec as asyncExec} from "child_process";
import util from "util";


Expand Down

0 comments on commit 22240bf

Please sign in to comment.