diff --git a/packages/payment-detection/src/erc20/fee-proxy-contract.ts b/packages/payment-detection/src/erc20/fee-proxy-contract.ts index 27498135da..4fcdc6f832 100644 --- a/packages/payment-detection/src/erc20/fee-proxy-contract.ts +++ b/packages/payment-detection/src/erc20/fee-proxy-contract.ts @@ -212,7 +212,10 @@ export default class PaymentNetworkERC20FeeProxyContract< throw new NetworkNotSupported(`Payment network not supported by ERC20 payment detection`); } - const deploymentInformation = this.getDeploymentInformation(network, paymentNetwork.version); + const deploymentInformation = erc20FeeProxyArtifact.getDeploymentInformation( + network, + paymentNetwork.version, + ); if (!deploymentInformation) { throw new VersionNotSupported( @@ -307,7 +310,4 @@ export default class PaymentNetworkERC20FeeProxyContract< get paymentNetworkId(): ExtensionTypes.ID { return this._paymentNetworkId; } - - protected getDeploymentInformation: DeploymentInformationGetter = - erc20FeeProxyArtifact.getDeploymentInformation; } diff --git a/packages/smart-contracts/src/lib/ContractArtifact.ts b/packages/smart-contracts/src/lib/ContractArtifact.ts index 3ececc047a..2d3821a8a1 100644 --- a/packages/smart-contracts/src/lib/ContractArtifact.ts +++ b/packages/smart-contracts/src/lib/ContractArtifact.ts @@ -28,7 +28,14 @@ export type ArtifactInfo< * and utilities to connect to it **/ export class ContractArtifact { - constructor(private info: ArtifactInfo, private lastVersion: string) {} + constructor(private info: ArtifactInfo, private lastVersion: string) { + this.connect = this.connect.bind(this); + this.getInterface = this.getInterface.bind(this); + this.getContractAbi = this.getContractAbi.bind(this); + this.getAddress = this.getAddress.bind(this); + this.getCreationBlockNumber = this.getCreationBlockNumber.bind(this); + this.getDeploymentInformation = this.getDeploymentInformation.bind(this); + } /** * Returns an ethers contract instance for the given `networkName`