diff options
Diffstat (limited to 'packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts')
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts index 963d5b40f..b1b026a3a 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts @@ -19,13 +19,14 @@ export class ERC721ProxyWrapper extends ContractWrapper { /** * Instantiate ERC721ProxyWrapper * @param web3Wrapper Web3Wrapper instance to use - * @param address The address of the ERC721Proxy contract + * @param networkId Desired networkId + * @param address (Optional) The address of the ERC721Proxy contract. If + * undefined, will default to the known address corresponding to the + * networkId. */ - // TODO(albrow): Make address optional and default to looking up the address - // based in a hard-coded mapping based on web3Wrapper network id. - constructor(web3Wrapper: Web3Wrapper, address: string) { - super(web3Wrapper); - this.address = address; + constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) { + super(web3Wrapper, networkId); + this.address = _.isUndefined(address) ? this._getDefaultContractAddresses().erc721Proxy : address; } /** * Get the 4 bytes ID of this asset proxy |