Skip to content

Commit

Permalink
Reflect symbols in the Contract Proxy to target (ethers-io#4048).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent 8b46181 commit 85a9d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
// Return a Proxy that will respond to functions
return new Proxy(this, {
get: (target, _prop, receiver) => {
if (_prop in target || passProperties.indexOf(<string>_prop) >= 0) {
if (_prop in target || passProperties.indexOf(<string>_prop) >= 0 || typeof(_prop) === "symbol") {
return Reflect.get(target, _prop, receiver);
}

Expand All @@ -767,7 +767,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
throw new Error(`unknown contract method: ${ prop }`);
},
has: (target, prop) => {
if (prop in target || passProperties.indexOf(<string>prop) >= 0) {
if (prop in target || passProperties.indexOf(<string>prop) >= 0 || typeof(prop) === "symbol") {
return Reflect.has(target, prop);
}

Expand Down

0 comments on commit 85a9d77

Please sign in to comment.