diff --git a/packages/abi/src.ts/abi-coder.ts b/packages/abi/src.ts/abi-coder.ts index 47cf03190..9056ae91c 100644 --- a/packages/abi/src.ts/abi-coder.ts +++ b/packages/abi/src.ts/abi-coder.ts @@ -33,7 +33,6 @@ export class AbiCoder { readonly coerceFunc: CoerceFunc; constructor(coerceFunc?: CoerceFunc) { - logger.checkNew(new.target, AbiCoder); defineReadOnly(this, "coerceFunc", coerceFunc || null); } diff --git a/packages/abi/src.ts/interface.ts b/packages/abi/src.ts/interface.ts index 4a2fb0b90..af80974ae 100644 --- a/packages/abi/src.ts/interface.ts +++ b/packages/abi/src.ts/interface.ts @@ -90,8 +90,6 @@ export class Interface { readonly _isInterface: boolean; constructor(fragments: string | ReadonlyArray) { - logger.checkNew(new.target, Interface); - let abi: ReadonlyArray = [ ]; if (typeof(fragments) === "string") { abi = JSON.parse(fragments); diff --git a/packages/abstract-signer/src.ts/index.ts b/packages/abstract-signer/src.ts/index.ts index f0e5d875e..65979e8ac 100644 --- a/packages/abstract-signer/src.ts/index.ts +++ b/packages/abstract-signer/src.ts/index.ts @@ -341,7 +341,6 @@ export class VoidSigner extends Signer implements TypedDataSigner { readonly address: string; constructor(address: string, provider?: Provider) { - logger.checkNew(new.target, VoidSigner); super(); defineReadOnly(this, "address", address); defineReadOnly(this, "provider", provider || null); diff --git a/packages/bignumber/src.ts/bignumber.ts b/packages/bignumber/src.ts/bignumber.ts index 872661823..31d4c448c 100644 --- a/packages/bignumber/src.ts/bignumber.ts +++ b/packages/bignumber/src.ts/bignumber.ts @@ -43,8 +43,6 @@ export class BigNumber implements Hexable { readonly _isBigNumber: boolean; constructor(constructorGuard: any, hex: string) { - logger.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { logger.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { operation: "new (BigNumber)" diff --git a/packages/bignumber/src.ts/fixednumber.ts b/packages/bignumber/src.ts/fixednumber.ts index 4b615c25f..de25fd065 100644 --- a/packages/bignumber/src.ts/fixednumber.ts +++ b/packages/bignumber/src.ts/fixednumber.ts @@ -202,8 +202,6 @@ export class FixedNumber { readonly _isFixedNumber: boolean; constructor(constructorGuard: any, hex: string, value: string, format?: FixedFormat) { - logger.checkNew(new.target, FixedNumber); - if (constructorGuard !== _constructorGuard) { logger.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" diff --git a/packages/contracts/src.ts/index.ts b/packages/contracts/src.ts/index.ts index 40afbf84d..1877cc187 100644 --- a/packages/contracts/src.ts/index.ts +++ b/packages/contracts/src.ts/index.ts @@ -657,8 +657,6 @@ export class BaseContract { _wrappedEmits: { [ eventTag: string ]: (...args: Array) => void }; constructor(addressOrName: string, contractInterface: ContractInterface, signerOrProvider?: Signer | Provider) { - logger.checkNew(new.target, Contract); - // @TODO: Maybe still check the addressOrName looks like a valid address or name? //address = getAddress(address); defineReadOnly(this, "interface", getStatic(new.target, "getInterface")(contractInterface)); diff --git a/packages/experimental/src.ts/nonce-manager.ts b/packages/experimental/src.ts/nonce-manager.ts index c7e00b420..9cf16c5bf 100644 --- a/packages/experimental/src.ts/nonce-manager.ts +++ b/packages/experimental/src.ts/nonce-manager.ts @@ -2,10 +2,6 @@ import { ethers } from "ethers"; -import { version } from "./_version"; - -const logger = new ethers.utils.Logger(version); - // @TODO: Keep a per-NonceManager pool of sent but unmined transactions for // rebroadcasting, in case we overrun the transaction pool @@ -16,7 +12,6 @@ export class NonceManager extends ethers.Signer { _deltaCount: number; constructor(signer: ethers.Signer) { - logger.checkNew(new.target, NonceManager); super(); this._deltaCount = 0; ethers.utils.defineReadOnly(this, "signer", signer); diff --git a/packages/hdnode/src.ts/index.ts b/packages/hdnode/src.ts/index.ts index 2fb609d0c..194a70f65 100644 --- a/packages/hdnode/src.ts/index.ts +++ b/packages/hdnode/src.ts/index.ts @@ -97,8 +97,6 @@ export class HDNode implements ExternallyOwnedAccount { * - fromSeed */ constructor(constructorGuard: any, privateKey: string, publicKey: string, parentFingerprint: string, chainCode: string, index: number, depth: number, mnemonicOrPath: Mnemonic | string) { - logger.checkNew(new.target, HDNode); - /* istanbul ignore if */ if (constructorGuard !== _constructorGuard) { throw new Error("HDNode constructor cannot be called directly"); diff --git a/packages/providers/src.ts/base-provider.ts b/packages/providers/src.ts/base-provider.ts index ca1b2c32b..685bd251e 100644 --- a/packages/providers/src.ts/base-provider.ts +++ b/packages/providers/src.ts/base-provider.ts @@ -738,8 +738,6 @@ export class BaseProvider extends Provider implements EnsProvider { */ constructor(network: Networkish | Promise) { - logger.checkNew(new.target, Provider); - super(); // Events being listened to diff --git a/packages/providers/src.ts/etherscan-provider.ts b/packages/providers/src.ts/etherscan-provider.ts index 4e8db11b8..a51002038 100644 --- a/packages/providers/src.ts/etherscan-provider.ts +++ b/packages/providers/src.ts/etherscan-provider.ts @@ -163,8 +163,6 @@ export class EtherscanProvider extends BaseProvider{ readonly apiKey: string; constructor(network?: Networkish, apiKey?: string) { - logger.checkNew(new.target, EtherscanProvider); - super(network); defineReadOnly(this, "baseUrl", this.getBaseUrl()); diff --git a/packages/providers/src.ts/fallback-provider.ts b/packages/providers/src.ts/fallback-provider.ts index 0931a6fa3..3ae4e8b53 100644 --- a/packages/providers/src.ts/fallback-provider.ts +++ b/packages/providers/src.ts/fallback-provider.ts @@ -410,8 +410,6 @@ export class FallbackProvider extends BaseProvider { _highestBlockNumber: number; constructor(providers: Array, quorum?: number) { - logger.checkNew(new.target, FallbackProvider); - if (providers.length === 0) { logger.throwArgumentError("missing providers", "providers", providers); } diff --git a/packages/providers/src.ts/formatter.ts b/packages/providers/src.ts/formatter.ts index fd7eddc87..b8003da65 100644 --- a/packages/providers/src.ts/formatter.ts +++ b/packages/providers/src.ts/formatter.ts @@ -31,7 +31,6 @@ export class Formatter { readonly formats: Formats; constructor() { - logger.checkNew(new.target, Formatter); this.formats = this.getDefaultFormats(); } diff --git a/packages/providers/src.ts/ipc-provider.ts b/packages/providers/src.ts/ipc-provider.ts index c011ee8c5..6f0e58ce4 100644 --- a/packages/providers/src.ts/ipc-provider.ts +++ b/packages/providers/src.ts/ipc-provider.ts @@ -16,8 +16,6 @@ export class IpcProvider extends JsonRpcProvider { readonly path: string; constructor(path: string, network?: Networkish) { - logger.checkNew(new.target, IpcProvider); - if (path == null) { logger.throwError("missing path", Logger.errors.MISSING_ARGUMENT, { arg: "path" }); } diff --git a/packages/providers/src.ts/json-rpc-provider.ts b/packages/providers/src.ts/json-rpc-provider.ts index 417a2b9bc..2ec14d06b 100644 --- a/packages/providers/src.ts/json-rpc-provider.ts +++ b/packages/providers/src.ts/json-rpc-provider.ts @@ -144,8 +144,6 @@ export class JsonRpcSigner extends Signer implements TypedDataSigner { _address: string; constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number) { - logger.checkNew(new.target, JsonRpcSigner); - super(); if (constructorGuard !== _constructorGuard) { @@ -354,8 +352,6 @@ export class JsonRpcProvider extends BaseProvider { } constructor(url?: ConnectionInfo | string, network?: Networkish) { - logger.checkNew(new.target, JsonRpcProvider); - let networkOrReady: Networkish | Promise = network; // The network is unknown, query the JSON-RPC for it diff --git a/packages/providers/src.ts/web3-provider.ts b/packages/providers/src.ts/web3-provider.ts index 9c337af98..352a67bb7 100644 --- a/packages/providers/src.ts/web3-provider.ts +++ b/packages/providers/src.ts/web3-provider.ts @@ -123,8 +123,6 @@ export class Web3Provider extends JsonRpcProvider { readonly jsonRpcFetchFunc: JsonRpcFetchFunc; constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish) { - logger.checkNew(new.target, Web3Provider); - if (provider == null) { logger.throwArgumentError("missing provider", "provider", provider); } diff --git a/packages/wallet/src.ts/index.ts b/packages/wallet/src.ts/index.ts index b95512f33..eccf45866 100644 --- a/packages/wallet/src.ts/index.ts +++ b/packages/wallet/src.ts/index.ts @@ -38,8 +38,6 @@ export class Wallet extends Signer implements ExternallyOwnedAccount, TypedDataS readonly _mnemonic: () => Mnemonic; constructor(privateKey: BytesLike | ExternallyOwnedAccount | SigningKey, provider?: Provider) { - logger.checkNew(new.target, Wallet); - super(); if (isAccount(privateKey)) {