From 1e9ea09f087c7b3120e758d931a88812b655da08 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 9 Oct 2018 23:10:33 -0700 Subject: Introduce new contract-addresses package and use it everywhere --- packages/testnet-faucets/package.json | 1 + packages/testnet-faucets/src/ts/handler.ts | 13 ++----------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'packages/testnet-faucets') diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index a113889cc..cd56c1395 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -19,6 +19,7 @@ "license": "Apache-2.0", "dependencies": { "0x.js": "^1.0.8", + "@0xproject/contract-addresses": "^1.0.0", "@0xproject/subproviders": "^2.0.7", "@0xproject/typescript-typings": "^3.0.2", "@0xproject/utils": "^2.0.2", diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index b2d2226f4..262f6d889 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -11,6 +11,7 @@ import { SignedOrder, Web3ProviderEngine, } from '0x.js'; +import { getContractAddressesForNetwork } from '@0xproject/contract-addresses'; import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders'; import { logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -67,17 +68,7 @@ export class Handler { const networkId = parseInt(networkIdString, 10); const contractWrappersConfig = { networkId, - // TODO(albrow): Load in real contract addresses here. - contractAddresses: { - erc20Proxy: '', - erc721Proxy: '', - zrxToken: '', - etherToken: '', - exchange: '', - assetProxyOwner: '', - forwarder: '', - orderValidator: '', - }, + contractAddresses: getContractAddressesForNetwork(networkId), }; const contractWrappers = new ContractWrappers(providerObj, contractWrappersConfig); const dispatchQueue = new DispatchQueue(); -- cgit v1.2.3