diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-24 22:25:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-24 22:25:29 +0800 |
commit | 877bdce4c85a3a643559ed1e6f94998c97449bf7 (patch) | |
tree | f9bee7cca87cf3b5623d8138680d312b61d4241a | |
parent | 8a858501f2b633f47cec9576b25e6f99911bbc09 (diff) | |
parent | 6e1fbd2d9789eede9a43263a753c385f9cff3e4d (diff) | |
download | dexon-0x-contracts-877bdce4c85a3a643559ed1e6f94998c97449bf7.tar.gz dexon-0x-contracts-877bdce4c85a3a643559ed1e6f94998c97449bf7.tar.zst dexon-0x-contracts-877bdce4c85a3a643559ed1e6f94998c97449bf7.zip |
Merge pull request #341 from 0xProject/fix/zrx-address
Fix the bug making it impossible to specify the custom ZRX address
-rw-r--r-- | packages/0x.js/CHANGELOG.md | 1 | ||||
-rw-r--r-- | packages/0x.js/src/0x.ts | 1 | ||||
-rw-r--r-- | packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/src/types.ts | 2 |
4 files changed, 6 insertions, 0 deletions
diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index 1a09eaf28..7fc1d9bba 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -3,6 +3,7 @@ ## v0.30.1 - _January 18, 2018_ * Fix a bug allowing negative fill values (#212) + * Fix a bug that made it impossible to pass a custom ZRX address (#341) ## v0.30.0 - _January 17, 2018_ diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index e1b0ef08e..503a937c4 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -191,6 +191,7 @@ export class ZeroEx { this._abiDecoder, this.token, config.exchangeContractAddress, + config.zrxContractAddress, ); this.tokenRegistry = new TokenRegistryWrapper( this._web3Wrapper, diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index be88cdb20..2b6117729 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -87,11 +87,13 @@ export class ExchangeWrapper extends ContractWrapper { abiDecoder: AbiDecoder, tokenWrapper: TokenWrapper, contractAddressIfExists?: string, + zrxContractAddressIfExists?: string, ) { super(web3Wrapper, networkId, abiDecoder); this._tokenWrapper = tokenWrapper; this._orderValidationUtils = new OrderValidationUtils(this); this._contractAddressIfExists = contractAddressIfExists; + this._zrxContractAddressIfExists = zrxContractAddressIfExists; } /** * Returns the unavailable takerAmount of an order. Unavailable amount is defined as the total diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 2decd92ba..3c93910e9 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -290,6 +290,7 @@ export interface OrderStateWatcherConfig { * networkId: The id of the underlying ethereum network your provider is connected to. (1-mainnet, 42-kovan, 50-testrpc) * gasPrice: Gas price to use with every transaction * exchangeContractAddress: The address of an exchange contract to use + * zrxContractAddress: The address of the ZRX contract to use * tokenRegistryContractAddress: The address of a token registry contract to use * tokenTransferProxyContractAddress: The address of the token transfer proxy contract to use * orderWatcherConfig: All the configs related to the orderWatcher @@ -298,6 +299,7 @@ export interface ZeroExConfig { networkId: number; gasPrice?: BigNumber; exchangeContractAddress?: string; + zrxContractAddress?: string; tokenRegistryContractAddress?: string; tokenTransferProxyContractAddress?: string; orderWatcherConfig?: OrderStateWatcherConfig; |