diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 18:15:37 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 18:15:37 +0800 |
commit | de234280690571dc3441c1a06bb49049df3289dc (patch) | |
tree | d6792c9172245ee836e31a2588f3ae91dd53a012 /packages/order-utils/src/signature_utils.ts | |
parent | 4d75681357b04ae77637ee62645b662796a3b15b (diff) | |
parent | 2a344e26cc51fa41a9df3535b625b8609dfc167e (diff) | |
download | dexon-0x-contracts-de234280690571dc3441c1a06bb49049df3289dc.tar.gz dexon-0x-contracts-de234280690571dc3441c1a06bb49049df3289dc.tar.zst dexon-0x-contracts-de234280690571dc3441c1a06bb49049df3289dc.zip |
Merge development
Diffstat (limited to 'packages/order-utils/src/signature_utils.ts')
-rw-r--r-- | packages/order-utils/src/signature_utils.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index 131144d48..efcc146bf 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -1,4 +1,5 @@ import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers'; +import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses'; import * as artifacts from '@0x/contract-artifacts'; import { schemas } from '@0x/json-schemas'; import { ECSignature, Order, SignatureType, SignedOrder, ValidatorSignature } from '@0x/types'; @@ -92,7 +93,14 @@ export const signatureUtils = { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isETHAddressHex('signerAddress', signerAddress); - const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); + const web3Wrapper = new Web3Wrapper(provider); + const networkId = await web3Wrapper.getNetworkIdAsync(); + const addresses = getContractAddressesForNetworkOrThrow(networkId); + const exchangeContract = new ExchangeContract( + artifacts.Exchange.compilerOutput.abi, + addresses.exchange, + provider, + ); const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress); return isValid; }, |