diff --git a/packages/contracts/src.ts/index.ts b/packages/contracts/src.ts/index.ts index 96a3ca369..cbce2af49 100644 --- a/packages/contracts/src.ts/index.ts +++ b/packages/contracts/src.ts/index.ts @@ -658,6 +658,10 @@ export class Contract { defineReadOnly(this, "_runningEvents", { }); defineReadOnly(this, "_wrappedEmits", { }); + if (addressOrName == null) { + logger.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName); + } + defineReadOnly(this, "address", addressOrName); if (this.provider) { defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));