Skip to content

Commit

Permalink
Fix lint:ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Oct 31, 2023
1 parent ef70135 commit 10b7701
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 30 deletions.
16 changes: 15 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,27 @@ module.exports = {
"import/order": [
"error",
{
groups: [["builtin", "external"]],
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
alphabetize: {
order: "asc",
},
"newlines-between": "always",
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ ignoreRestSiblings: true },
],
},
};
3 changes: 2 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import "@nomicfoundation/hardhat-toolbox";

import dotenv from "dotenv";
import type { HttpNetworkUserConfig } from "hardhat/types";
import yargs from "yargs";

import type { HttpNetworkUserConfig } from "hardhat/types";
import "hardhat-change-network";

const { network } = yargs
Expand Down
3 changes: 0 additions & 3 deletions sdk/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import RealityEthAbi from "./abi/RealityEth.json";
import RolesAbi from "./abi/Roles.json";
import ScopeGuardAbi from "./abi/ScopeGuard.json";
import TellorAbi from "./abi/Tellor.json";

import { KnownContracts } from "./factory/types";

import * as BridgeInitData from "./initData/Bridge";
import * as CirculatingSupplyErc20InitData from "./initData/CirculatingSupplyErc20";
import * as CirculatingSupplyErc721InitData from "./initData/CirculatingSupplyErc721";
Expand All @@ -38,7 +36,6 @@ import * as RealityErc20InitData from "./initData/RealityErc20";
import * as RealityEthInitData from "./initData/RealityEth";
import * as RolesInitData from "./initData/Roles";
import * as ScopeGuardInitData from "./initData/ScopeGuard";

import { factories } from "./types";

export enum SupportedNetworks {
Expand Down
3 changes: 1 addition & 2 deletions sdk/factory/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getModuleInstance,
getModuleFactoryAndMasterCopy,
} from "../moduleDeployer";

import { KnownContracts } from "../types";

const AddressOne = "0x0000000000000000000000000000000000000001";
Expand All @@ -31,7 +30,7 @@ describe("Factory JS functions ", () => {
}

it("should execute transaction and retrieve expected address ", async () => {
const { mock, chainId } = await loadFixture(setup);
const { chainId } = await loadFixture(setup);

const [signer] = await hre.ethers.getSigners();

Expand Down
10 changes: 8 additions & 2 deletions sdk/factory/deployModuleFactory.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import assert from "assert";

import { constants as ethersConstants, ethers } from "ethers";

import { MasterCopyInitData } from "../contracts";

import { getSingletonFactory } from "./singletonFactory";
import { KnownContracts } from "./types";
import { MasterCopyInitData } from "../contracts";

const { AddressZero } = ethersConstants;

const FactoryInitData = MasterCopyInitData[KnownContracts.FACTORY]!;
const FactoryInitData = MasterCopyInitData[KnownContracts.FACTORY];

assert(FactoryInitData);

/**
* Deploy the Module Proxy Factory via the singleton factory.
Expand Down
1 change: 1 addition & 0 deletions sdk/factory/mastercopyDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ethers,
} from "ethers";
import { keccak256, getCreate2Address, getAddress } from "ethers/lib/utils";

import { getSingletonFactory } from "./singletonFactory";

const { AddressZero } = ethersConstants;
Expand Down
4 changes: 3 additions & 1 deletion sdk/factory/moduleDeployer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Provider } from "@ethersproject/providers";
import { ethers, Contract, Signer, BigNumber } from "ethers";
import { KnownContracts } from "./types";

import {
ContractAddresses,
ContractAbis,
Expand All @@ -9,6 +9,8 @@ import {
} from "../contracts";
import { ModuleProxyFactory__factory } from "../types";

import { KnownContracts } from "./types";

type ABI = any[] | readonly any[];

type TxAndExpectedAddress = {
Expand Down
1 change: 1 addition & 0 deletions tasks/deploy-replay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import {
KnownContracts,
MasterCopyInitData,
Expand Down
1 change: 1 addition & 0 deletions tasks/singleton-deployment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { KnownContracts, MasterCopyInitData } from "../sdk/factory";
import { deployModuleFactory } from "../sdk/factory/deployModuleFactory";

Expand Down
2 changes: 1 addition & 1 deletion test/01_IAvatar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AddressZero } from "@ethersproject/constants";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";

import { expect } from "chai";
import hre from "hardhat";

import { TestAvatar__factory } from "../typechain-types";

describe("IAvatar", async () => {
Expand Down
12 changes: 6 additions & 6 deletions test/03_Modifier.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import hre from "hardhat";
import { expect } from "chai";
import { PopulatedTransaction } from "ethers";

import { AddressZero } from "@ethersproject/constants";
import { AddressOne } from "@gnosis.pm/safe-contracts";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { expect } from "chai";
import { PopulatedTransaction } from "ethers";
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
import hre from "hardhat";

import typedDataForTransaction from "./typedDataForTransaction";
import { TestAvatar__factory, TestModifier__factory } from "../typechain-types";
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";

import typedDataForTransaction from "./typedDataForTransaction";

describe("Modifier", async () => {
const SENTINEL_MODULES = "0x0000000000000000000000000000000000000001";
Expand Down
4 changes: 2 additions & 2 deletions test/04_Guard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AddressZero } from "@ethersproject/constants";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import hre from "hardhat";

import { AddressZero } from "@ethersproject/constants";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { TestGuard__factory, TestModule__factory } from "../typechain-types";

async function setupTests() {
Expand Down
1 change: 1 addition & 0 deletions test/05_ModuleProxyFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AddressOne } from "@gnosis.pm/safe-contracts";
import { expect } from "chai";
import { Contract } from "ethers";
import { ethers } from "hardhat";

import { calculateProxyAddress } from "../sdk/factory";

describe("ModuleProxyFactory", async () => {
Expand Down
13 changes: 7 additions & 6 deletions test/06_SignatureChecker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import hre from "hardhat";
import { TestSignature__factory } from "../typechain-types";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { PopulatedTransaction } from "ethers";
import { expect } from "chai";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";

import typedDataForTransaction from "./typedDataForTransaction";
import { expect } from "chai";
import { PopulatedTransaction } from "ethers";
import {
defaultAbiCoder,
keccak256,
solidityPack,
toUtf8Bytes,
} from "ethers/lib/utils";
import hre from "hardhat";

import { TestSignature__factory } from "../typechain-types";

import typedDataForTransaction from "./typedDataForTransaction";

describe("SignatureChecker", async () => {
async function setup() {
Expand Down
11 changes: 6 additions & 5 deletions test/07_GuardableModifier.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import hre from "hardhat";
import { expect } from "chai";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { expect } from "chai";
import { PopulatedTransaction } from "ethers";
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
import hre from "hardhat";

import {
TestAvatar__factory,
TestGuard__factory,
TestGuardableModifier__factory,
} from "../typechain-types";

import typedDataForTransaction from "./typedDataForTransaction";
import { PopulatedTransaction } from "ethers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";

describe("GuardableModifier", async () => {
async function setupTests() {
Expand Down

0 comments on commit 10b7701

Please sign in to comment.