diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-10 14:10:33 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 04:38:33 +0800 |
commit | 1e9ea09f087c7b3120e758d931a88812b655da08 (patch) | |
tree | b0da3efc0733d566356ed2a938d18eb08192f674 /packages/contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts | |
parent | fa346d94613a43034e1cdaf6b7a3d2de270c58fc (diff) | |
download | dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.gz dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.zst dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.zip |
Introduce new contract-addresses package and use it everywhere
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 |