aboutsummaryrefslogtreecommitdiffstats
path: root/contracts/exchange
diff options
context:
space:
mode:
Diffstat (limited to 'contracts/exchange')
-rw-r--r--contracts/exchange/compiler.json49
-rw-r--r--contracts/exchange/package.json7
-rw-r--r--contracts/exchange/src/artifacts.ts61
-rw-r--r--contracts/exchange/src/artifacts/index.ts41
-rw-r--r--contracts/exchange/src/wrappers.ts31
-rw-r--r--contracts/exchange/src/wrappers/index.ts18
-rw-r--r--contracts/exchange/test/core.ts31
-rw-r--r--contracts/exchange/test/dispatcher.ts14
-rw-r--r--contracts/exchange/test/match_orders.ts19
-rw-r--r--contracts/exchange/test/signature_validator.ts3
-rw-r--r--contracts/exchange/test/utils/exchange_wrapper.ts4
-rw-r--r--contracts/exchange/test/utils/fill_order_combinatorial_utils.ts9
-rw-r--r--contracts/exchange/test/wrapper.ts17
-rw-r--r--contracts/exchange/tsconfig.json50
14 files changed, 198 insertions, 156 deletions
diff --git a/contracts/exchange/compiler.json b/contracts/exchange/compiler.json
index 6a5f666d1..b7a94cd13 100644
--- a/contracts/exchange/compiler.json
+++ b/contracts/exchange/compiler.json
@@ -3,10 +3,7 @@
"contractsDir": "./contracts",
"useDockerisedSolc": true,
"compilerSettings": {
- "optimizer": {
- "enabled": true,
- "runs": 1000000
- },
+ "optimizer": { "enabled": true, "runs": 1000000 },
"outputSelection": {
"*": {
"*": [
@@ -20,23 +17,31 @@
}
},
"contracts": [
- "Exchange",
- "IAssetProxyDispatcher",
- "IExchange",
- "IExchangeCore",
- "IMatchOrders",
- "ISignatureValidator",
- "ITransactions",
- "IValidator",
- "IWallet",
- "IWrapperFunctions",
- "TestAssetProxyDispatcher",
- "TestExchangeInternals",
- "TestSignatureValidator",
- "TestStaticCallReceiver",
- "ExchangeWrapper",
- "Validator",
- "Wallet",
- "Whitelist"
+ "@0x/contracts-asset-proxy/contracts/src/ERC20Proxy.sol",
+ "@0x/contracts-asset-proxy/contracts/src/ERC721Proxy.sol",
+ "@0x/contracts-asset-proxy/contracts/src/MultiAssetProxy.sol",
+ "@0x/contracts-erc20/contracts/test/DummyERC20Token.sol",
+ "@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol",
+ "@0x/contracts-erc20/contracts/test/ReentrantERC20Token.sol",
+ "@0x/contracts-erc721/contracts/test/DummyERC721Token.sol",
+ "@0x/contracts-exchange-libs/contracts/test/TestLibs.sol",
+ "examples/ExchangeWrapper.sol",
+ "examples/Validator.sol",
+ "examples/Wallet.sol",
+ "examples/Whitelist.sol",
+ "src/Exchange.sol",
+ "src/interfaces/IAssetProxyDispatcher.sol",
+ "src/interfaces/IExchange.sol",
+ "src/interfaces/IExchangeCore.sol",
+ "src/interfaces/IMatchOrders.sol",
+ "src/interfaces/ISignatureValidator.sol",
+ "src/interfaces/ITransactions.sol",
+ "src/interfaces/IValidator.sol",
+ "src/interfaces/IWallet.sol",
+ "src/interfaces/IWrapperFunctions.sol",
+ "test/TestAssetProxyDispatcher.sol",
+ "test/TestExchangeInternals.sol",
+ "test/TestSignatureValidator.sol",
+ "test/TestStaticCallReceiver.sol"
]
}
diff --git a/contracts/exchange/package.json b/contracts/exchange/package.json
index ca4b1fd00..6c3781b54 100644
--- a/contracts/exchange/package.json
+++ b/contracts/exchange/package.json
@@ -29,10 +29,12 @@
"profiler:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test",
+ "contracts:gen": "contracts-gen",
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
- "abis": "generated-artifacts/@(ERC20Proxy|ERC721Proxy|Exchange|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IWrapperFunctions|IValidator|IWallet|MixinAuthorizable|MultiAssetProxy|TestSignatureValidator|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver|ExchangeWrapper|Validator|Wallet|Whitelist).json"
+ "abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|Exchange|ExchangeWrapper|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions|MultiAssetProxy|ReentrantERC20Token|TestAssetProxyDispatcher|TestExchangeInternals|TestLibs|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist).json",
+ "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
"type": "git",
@@ -44,6 +46,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
"devDependencies": {
+ "@0x/contracts-gen": "^1.0.0",
"@0x/abi-gen": "^2.0.1",
"@0x/dev-utils": "^2.0.1",
"@0x/sol-compiler": "^3.0.1",
@@ -77,7 +80,7 @@
"@0x/web3-wrapper": "^4.0.1",
"ethereum-types": "^2.0.0",
"ethereumjs-util": "^5.1.1",
- "lodash": "^4.17.5"
+ "lodash": "^4.17.11"
},
"publishConfig": {
"access": "public"
diff --git a/contracts/exchange/src/artifacts.ts b/contracts/exchange/src/artifacts.ts
new file mode 100644
index 000000000..efdacd376
--- /dev/null
+++ b/contracts/exchange/src/artifacts.ts
@@ -0,0 +1,61 @@
+/*
+ * -----------------------------------------------------------------------------
+ * Warning: This file is auto-generated by contracts-gen. Don't edit manually.
+ * -----------------------------------------------------------------------------
+ */
+import { ContractArtifact } from 'ethereum-types';
+
+import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json';
+import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json';
+import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json';
+import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json';
+import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
+import * as Exchange from '../generated-artifacts/Exchange.json';
+import * as ExchangeWrapper from '../generated-artifacts/ExchangeWrapper.json';
+import * as IAssetProxyDispatcher from '../generated-artifacts/IAssetProxyDispatcher.json';
+import * as IExchange from '../generated-artifacts/IExchange.json';
+import * as IExchangeCore from '../generated-artifacts/IExchangeCore.json';
+import * as IMatchOrders from '../generated-artifacts/IMatchOrders.json';
+import * as ISignatureValidator from '../generated-artifacts/ISignatureValidator.json';
+import * as ITransactions from '../generated-artifacts/ITransactions.json';
+import * as IValidator from '../generated-artifacts/IValidator.json';
+import * as IWallet from '../generated-artifacts/IWallet.json';
+import * as IWrapperFunctions from '../generated-artifacts/IWrapperFunctions.json';
+import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
+import * as ReentrantERC20Token from '../generated-artifacts/ReentrantERC20Token.json';
+import * as TestAssetProxyDispatcher from '../generated-artifacts/TestAssetProxyDispatcher.json';
+import * as TestExchangeInternals from '../generated-artifacts/TestExchangeInternals.json';
+import * as TestLibs from '../generated-artifacts/TestLibs.json';
+import * as TestSignatureValidator from '../generated-artifacts/TestSignatureValidator.json';
+import * as TestStaticCallReceiver from '../generated-artifacts/TestStaticCallReceiver.json';
+import * as Validator from '../generated-artifacts/Validator.json';
+import * as Wallet from '../generated-artifacts/Wallet.json';
+import * as Whitelist from '../generated-artifacts/Whitelist.json';
+export const artifacts = {
+ ERC20Proxy: ERC20Proxy as ContractArtifact,
+ ERC721Proxy: ERC721Proxy as ContractArtifact,
+ MultiAssetProxy: MultiAssetProxy as ContractArtifact,
+ DummyERC20Token: DummyERC20Token as ContractArtifact,
+ DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
+ ReentrantERC20Token: ReentrantERC20Token as ContractArtifact,
+ DummyERC721Token: DummyERC721Token as ContractArtifact,
+ TestLibs: TestLibs as ContractArtifact,
+ ExchangeWrapper: ExchangeWrapper as ContractArtifact,
+ Validator: Validator as ContractArtifact,
+ Wallet: Wallet as ContractArtifact,
+ Whitelist: Whitelist as ContractArtifact,
+ Exchange: Exchange as ContractArtifact,
+ IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact,
+ IExchange: IExchange as ContractArtifact,
+ IExchangeCore: IExchangeCore as ContractArtifact,
+ IMatchOrders: IMatchOrders as ContractArtifact,
+ ISignatureValidator: ISignatureValidator as ContractArtifact,
+ ITransactions: ITransactions as ContractArtifact,
+ IValidator: IValidator as ContractArtifact,
+ IWallet: IWallet as ContractArtifact,
+ IWrapperFunctions: IWrapperFunctions as ContractArtifact,
+ TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact,
+ TestExchangeInternals: TestExchangeInternals as ContractArtifact,
+ TestSignatureValidator: TestSignatureValidator as ContractArtifact,
+ TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact,
+};
diff --git a/contracts/exchange/src/artifacts/index.ts b/contracts/exchange/src/artifacts/index.ts
deleted file mode 100644
index 798ff17ab..000000000
--- a/contracts/exchange/src/artifacts/index.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { ContractArtifact } from 'ethereum-types';
-
-import * as Exchange from '../../generated-artifacts/Exchange.json';
-import * as ExchangeWrapper from '../../generated-artifacts/ExchangeWrapper.json';
-import * as IAssetProxyDispatcher from '../../generated-artifacts/IAssetProxyDispatcher.json';
-import * as IExchange from '../../generated-artifacts/IExchange.json';
-import * as IExchangeCore from '../../generated-artifacts/IExchangeCore.json';
-import * as IMatchOrders from '../../generated-artifacts/IMatchOrders.json';
-import * as ISignatureValidator from '../../generated-artifacts/ISignatureValidator.json';
-import * as ITransactions from '../../generated-artifacts/ITransactions.json';
-import * as IValidator from '../../generated-artifacts/IValidator.json';
-import * as IWallet from '../../generated-artifacts/IWallet.json';
-import * as IWrapperFunctions from '../../generated-artifacts/IWrapperFunctions.json';
-import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json';
-import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json';
-import * as TestSignatureValidator from '../../generated-artifacts/TestSignatureValidator.json';
-import * as TestStaticCallReceiver from '../../generated-artifacts/TestStaticCallReceiver.json';
-import * as Validator from '../../generated-artifacts/Validator.json';
-import * as Wallet from '../../generated-artifacts/Wallet.json';
-import * as Whitelist from '../../generated-artifacts/Whitelist.json';
-
-export const artifacts = {
- Exchange: Exchange as ContractArtifact,
- TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact,
- TestExchangeInternals: TestExchangeInternals as ContractArtifact,
- TestSignatureValidator: TestSignatureValidator as ContractArtifact,
- TestStaticCallReceiver: TestStaticCallReceiver as ContractArtifact,
- IExchange: IExchange as ContractArtifact,
- IExchangeCore: IExchangeCore as ContractArtifact,
- IMatchOrders: IMatchOrders as ContractArtifact,
- ISignatureValidator: ISignatureValidator as ContractArtifact,
- ITransactions: ITransactions as ContractArtifact,
- IWrapperFunctions: IWrapperFunctions as ContractArtifact,
- IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact,
- IValidator: IValidator as ContractArtifact,
- IWallet: IWallet as ContractArtifact,
- ExchangeWrapper: ExchangeWrapper as ContractArtifact,
- Validator: Validator as ContractArtifact,
- Wallet: Wallet as ContractArtifact,
- Whitelist: Whitelist as ContractArtifact,
-};
diff --git a/contracts/exchange/src/wrappers.ts b/contracts/exchange/src/wrappers.ts
new file mode 100644
index 000000000..1c1d7fdb4
--- /dev/null
+++ b/contracts/exchange/src/wrappers.ts
@@ -0,0 +1,31 @@
+/*
+ * -----------------------------------------------------------------------------
+ * Warning: This file is auto-generated by contracts-gen. Don't edit manually.
+ * -----------------------------------------------------------------------------
+ */
+export * from '../generated-wrappers/dummy_erc20_token';
+export * from '../generated-wrappers/dummy_erc721_token';
+export * from '../generated-wrappers/dummy_no_return_erc20_token';
+export * from '../generated-wrappers/erc20_proxy';
+export * from '../generated-wrappers/erc721_proxy';
+export * from '../generated-wrappers/exchange';
+export * from '../generated-wrappers/exchange_wrapper';
+export * from '../generated-wrappers/i_asset_proxy_dispatcher';
+export * from '../generated-wrappers/i_exchange';
+export * from '../generated-wrappers/i_exchange_core';
+export * from '../generated-wrappers/i_match_orders';
+export * from '../generated-wrappers/i_signature_validator';
+export * from '../generated-wrappers/i_transactions';
+export * from '../generated-wrappers/i_validator';
+export * from '../generated-wrappers/i_wallet';
+export * from '../generated-wrappers/i_wrapper_functions';
+export * from '../generated-wrappers/multi_asset_proxy';
+export * from '../generated-wrappers/reentrant_erc20_token';
+export * from '../generated-wrappers/test_asset_proxy_dispatcher';
+export * from '../generated-wrappers/test_exchange_internals';
+export * from '../generated-wrappers/test_libs';
+export * from '../generated-wrappers/test_signature_validator';
+export * from '../generated-wrappers/test_static_call_receiver';
+export * from '../generated-wrappers/validator';
+export * from '../generated-wrappers/wallet';
+export * from '../generated-wrappers/whitelist';
diff --git a/contracts/exchange/src/wrappers/index.ts b/contracts/exchange/src/wrappers/index.ts
deleted file mode 100644
index 86e939b56..000000000
--- a/contracts/exchange/src/wrappers/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export * from '../../generated-wrappers/exchange';
-export * from '../../generated-wrappers/test_asset_proxy_dispatcher';
-export * from '../../generated-wrappers/test_exchange_internals';
-export * from '../../generated-wrappers/test_signature_validator';
-export * from '../../generated-wrappers/test_static_call_receiver';
-export * from '../../generated-wrappers/i_asset_proxy_dispatcher';
-export * from '../../generated-wrappers/i_exchange';
-export * from '../../generated-wrappers/i_exchange_core';
-export * from '../../generated-wrappers/i_match_orders';
-export * from '../../generated-wrappers/i_signature_validator';
-export * from '../../generated-wrappers/i_transactions';
-export * from '../../generated-wrappers/i_wrapper_functions';
-export * from '../../generated-wrappers/i_validator';
-export * from '../../generated-wrappers/i_wallet';
-export * from '../../generated-wrappers/exchange_wrapper';
-export * from '../../generated-wrappers/validator';
-export * from '../../generated-wrappers/wallet';
-export * from '../../generated-wrappers/whitelist';
diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts
index 74161cc73..7e61ef7ac 100644
--- a/contracts/exchange/test/core.ts
+++ b/contracts/exchange/test/core.ts
@@ -1,19 +1,4 @@
-import {
- artifacts as proxyArtifacts,
- ERC20ProxyContract,
- ERC20Wrapper,
- ERC721ProxyContract,
- ERC721Wrapper,
- MultiAssetProxyContract,
-} from '@0x/contracts-asset-proxy';
-import {
- artifacts as erc20Artifacts,
- DummyERC20TokenContract,
- DummyERC20TokenTransferEventArgs,
- DummyNoReturnERC20TokenContract,
- ReentrantERC20TokenContract,
-} from '@0x/contracts-erc20';
-import { DummyERC721TokenContract } from '@0x/contracts-erc721';
+import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import {
chaiSetup,
constants,
@@ -39,9 +24,17 @@ import * as _ from 'lodash';
import {
artifacts,
+ DummyERC20TokenContract,
+ DummyERC20TokenTransferEventArgs,
+ DummyERC721TokenContract,
+ DummyNoReturnERC20TokenContract,
+ ERC20ProxyContract,
+ ERC721ProxyContract,
ExchangeCancelEventArgs,
ExchangeContract,
ExchangeWrapper,
+ MultiAssetProxyContract,
+ ReentrantERC20TokenContract,
TestStaticCallReceiverContract,
} from '../src';
@@ -98,7 +91,7 @@ describe('Exchange core', () => {
erc20Proxy = await erc20Wrapper.deployProxyAsync();
erc721Proxy = await erc721Wrapper.deployProxyAsync();
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
- proxyArtifacts.MultiAssetProxy,
+ artifacts.MultiAssetProxy,
provider,
txDefaults,
);
@@ -120,7 +113,7 @@ describe('Exchange core', () => {
txDefaults,
);
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.ReentrantERC20Token,
+ artifacts.ReentrantERC20Token,
provider,
txDefaults,
exchange.address,
@@ -345,7 +338,7 @@ describe('Exchange core', () => {
describe('Testing exchange of ERC20 tokens with no return values', () => {
before(async () => {
noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.DummyNoReturnERC20Token,
+ artifacts.DummyNoReturnERC20Token,
provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts
index a25755936..8263b0402 100644
--- a/contracts/exchange/test/dispatcher.ts
+++ b/contracts/exchange/test/dispatcher.ts
@@ -1,11 +1,4 @@
-import {
- artifacts as proxyArtifacts,
- ERC20ProxyContract,
- ERC20Wrapper,
- ERC721ProxyContract,
- ERC721Wrapper,
-} from '@0x/contracts-asset-proxy';
-import { DummyERC20TokenContract } from '@0x/contracts-erc20';
+import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import {
chaiSetup,
constants,
@@ -25,6 +18,9 @@ import * as _ from 'lodash';
import {
artifacts,
+ DummyERC20TokenContract,
+ ERC20ProxyContract,
+ ERC721ProxyContract,
TestAssetProxyDispatcherAssetProxyRegisteredEventArgs,
TestAssetProxyDispatcherContract,
} from '../src';
@@ -131,7 +127,7 @@ describe('AssetProxyDispatcher', () => {
expect(proxyAddress).to.be.equal(erc20Proxy.address);
// Deploy a new version of the ERC20 Transfer Proxy contract
const newErc20TransferProxy = await ERC20ProxyContract.deployFrom0xArtifactAsync(
- proxyArtifacts.ERC20Proxy,
+ artifacts.ERC20Proxy,
provider,
txDefaults,
);
diff --git a/contracts/exchange/test/match_orders.ts b/contracts/exchange/test/match_orders.ts
index d17025ddd..98fea67ea 100644
--- a/contracts/exchange/test/match_orders.ts
+++ b/contracts/exchange/test/match_orders.ts
@@ -1,6 +1,4 @@
-import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy';
-import { artifacts as erc20Artifacts, DummyERC20TokenContract, ReentrantERC20TokenContract } from '@0x/contracts-erc20';
-import { DummyERC721TokenContract } from '@0x/contracts-erc721';
+import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import {
chaiSetup,
constants,
@@ -20,7 +18,18 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { artifacts, ExchangeContract, ExchangeWrapper, MatchOrderTester, TestExchangeInternalsContract } from '../src';
+import {
+ artifacts,
+ DummyERC20TokenContract,
+ DummyERC721TokenContract,
+ ERC20ProxyContract,
+ ERC721ProxyContract,
+ ExchangeContract,
+ ExchangeWrapper,
+ MatchOrderTester,
+ ReentrantERC20TokenContract,
+ TestExchangeInternalsContract,
+} from '../src';
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
chaiSetup.configure();
@@ -131,7 +140,7 @@ describe('matchOrders', () => {
);
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.ReentrantERC20Token,
+ artifacts.ReentrantERC20Token,
provider,
txDefaults,
exchange.address,
diff --git a/contracts/exchange/test/signature_validator.ts b/contracts/exchange/test/signature_validator.ts
index 89eac4ddb..33510e50c 100644
--- a/contracts/exchange/test/signature_validator.ts
+++ b/contracts/exchange/test/signature_validator.ts
@@ -1,4 +1,3 @@
-import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
import {
addressUtils,
chaiSetup,
@@ -78,7 +77,7 @@ describe('MixinSignatureValidator', () => {
provider,
txDefaults,
);
- signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts });
+ signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
await web3Wrapper.awaitTransactionSuccessAsync(
await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, {
from: signerAddress,
diff --git a/contracts/exchange/test/utils/exchange_wrapper.ts b/contracts/exchange/test/utils/exchange_wrapper.ts
index 03c37c4a9..535e3bcf2 100644
--- a/contracts/exchange/test/utils/exchange_wrapper.ts
+++ b/contracts/exchange/test/utils/exchange_wrapper.ts
@@ -1,5 +1,3 @@
-import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
-import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
import { FillResults, formatters, LogDecoder, OrderInfo, orderUtils } from '@0x/contracts-test-utils';
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
import { AbiEncoder, BigNumber } from '@0x/utils';
@@ -18,7 +16,7 @@ export class ExchangeWrapper {
constructor(exchangeContract: ExchangeContract, provider: Provider) {
this._exchange = exchangeContract;
this._web3Wrapper = new Web3Wrapper(provider);
- this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...erc20Artifacts, ...erc721Artifacts });
+ this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts);
}
public async fillOrderAsync(
signedOrder: SignedOrder,
diff --git a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts
index 26b168909..00ca8a9fc 100644
--- a/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts
+++ b/contracts/exchange/test/utils/fill_order_combinatorial_utils.ts
@@ -1,5 +1,4 @@
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
-import { artifacts as libsArtifacts, TestLibsContract } from '@0x/contracts-exchange-libs';
import {
AllowanceAmountScenario,
AssetDataScenario,
@@ -33,7 +32,7 @@ import { LogWithDecodedArgs, Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
-import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
+import { artifacts, ExchangeContract, ExchangeFillEventArgs, TestLibsContract } from '../../src';
import { AssetWrapper } from './asset_wrapper';
import { ExchangeWrapper } from './exchange_wrapper';
@@ -129,11 +128,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
exchangeContract.address,
);
- const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync(
- libsArtifacts.TestLibs,
- provider,
- txDefaults,
- );
+ const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults);
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
orderFactory,
diff --git a/contracts/exchange/test/wrapper.ts b/contracts/exchange/test/wrapper.ts
index 62a0d426f..5476ac99d 100644
--- a/contracts/exchange/test/wrapper.ts
+++ b/contracts/exchange/test/wrapper.ts
@@ -1,6 +1,4 @@
-import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy';
-import { artifacts as erc20Artifacts, DummyERC20TokenContract, ReentrantERC20TokenContract } from '@0x/contracts-erc20';
-import { DummyERC721TokenContract } from '@0x/contracts-erc721';
+import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import {
chaiSetup,
constants,
@@ -22,7 +20,16 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { artifacts, ExchangeContract, ExchangeWrapper } from '../src';
+import {
+ artifacts,
+ DummyERC20TokenContract,
+ DummyERC721TokenContract,
+ ERC20ProxyContract,
+ ERC721ProxyContract,
+ ExchangeContract,
+ ExchangeWrapper,
+ ReentrantERC20TokenContract,
+} from '../src';
chaiSetup.configure();
const expect = chai.expect;
@@ -107,7 +114,7 @@ describe('Exchange wrappers', () => {
);
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
- erc20Artifacts.ReentrantERC20Token,
+ artifacts.ReentrantERC20Token,
provider,
txDefaults,
exchange.address,
diff --git a/contracts/exchange/tsconfig.json b/contracts/exchange/tsconfig.json
index b0fcd1771..35ca3d933 100644
--- a/contracts/exchange/tsconfig.json
+++ b/contracts/exchange/tsconfig.json
@@ -1,30 +1,34 @@
{
"extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "lib",
- "rootDir": ".",
- "resolveJsonModule": true
- },
+ "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
- "./generated-artifacts/IAssetProxyDispatcher.json",
- "./generated-artifacts/IExchange.json",
- "./generated-artifacts/IExchangeCore.json",
- "./generated-artifacts/IMatchOrders.json",
- "./generated-artifacts/ISignatureValidator.json",
- "./generated-artifacts/ITransactions.json",
- "./generated-artifacts/IValidator.json",
- "./generated-artifacts/IWallet.json",
- "./generated-artifacts/IWrapperFunctions.json",
- "./generated-artifacts/Exchange.json",
- "./generated-artifacts/TestAssetProxyDispatcher.json",
- "./generated-artifacts/TestExchangeInternals.json",
- "./generated-artifacts/TestSignatureValidator.json",
- "./generated-artifacts/TestStaticCallReceiver.json",
- "./generated-artifacts/ExchangeWrapper.json",
- "./generated-artifacts/Validator.json",
- "./generated-artifacts/Wallet.json",
- "./generated-artifacts/Whitelist.json"
+ "generated-artifacts/DummyERC20Token.json",
+ "generated-artifacts/DummyERC721Token.json",
+ "generated-artifacts/DummyNoReturnERC20Token.json",
+ "generated-artifacts/ERC20Proxy.json",
+ "generated-artifacts/ERC721Proxy.json",
+ "generated-artifacts/Exchange.json",
+ "generated-artifacts/ExchangeWrapper.json",
+ "generated-artifacts/IAssetProxyDispatcher.json",
+ "generated-artifacts/IExchange.json",
+ "generated-artifacts/IExchangeCore.json",
+ "generated-artifacts/IMatchOrders.json",
+ "generated-artifacts/ISignatureValidator.json",
+ "generated-artifacts/ITransactions.json",
+ "generated-artifacts/IValidator.json",
+ "generated-artifacts/IWallet.json",
+ "generated-artifacts/IWrapperFunctions.json",
+ "generated-artifacts/MultiAssetProxy.json",
+ "generated-artifacts/ReentrantERC20Token.json",
+ "generated-artifacts/TestAssetProxyDispatcher.json",
+ "generated-artifacts/TestExchangeInternals.json",
+ "generated-artifacts/TestLibs.json",
+ "generated-artifacts/TestSignatureValidator.json",
+ "generated-artifacts/TestStaticCallReceiver.json",
+ "generated-artifacts/Validator.json",
+ "generated-artifacts/Wallet.json",
+ "generated-artifacts/Whitelist.json"
],
"exclude": ["./deploy/solc/solc_bin"]
}