Skip to content

Commit

Permalink
Fix contracts when name resolution fails without any checks (#2737).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 24, 2022
1 parent 6807a76 commit c2a6a01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ export class BaseContract {
}
}

// Swallow bad ENS names to prevent Unhandled Exceptions
this.resolvedAddress.catch((e) => { });

const uniqueNames: { [ name: string ]: Array<string> } = { };
const uniqueSignatures: { [ signature: string ]: boolean } = { };
Object.keys(this.interface.functions).forEach((signature) => {
Expand Down Expand Up @@ -879,6 +882,7 @@ export class BaseContract {
if (this.deployTransaction) {
defineReadOnly(contract, "deployTransaction", this.deployTransaction);
}

return contract;
}

Expand Down

0 comments on commit c2a6a01

Please sign in to comment.