aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-12-05 18:19:10 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-12-05 20:13:35 +0800
commit48021a227f7034c2238c64146b2eb05eb8bfb687 (patch)
treec9fbfd03a6018ee7d36cf0db2766513ad17835d2
parentb411e2250aed82b87d1cbebf5cf805d794ddbdb7 (diff)
downloaddexon-0x-contracts-48021a227f7034c2238c64146b2eb05eb8bfb687.tar.gz
dexon-0x-contracts-48021a227f7034c2238c64146b2eb05eb8bfb687.tar.zst
dexon-0x-contracts-48021a227f7034c2238c64146b2eb05eb8bfb687.zip
Refactor our protocol interfaces into @0x/contracts-interfaces
-rw-r--r--.gitignore2
-rw-r--r--.prettierignore2
-rw-r--r--contracts/core/compiler.json4
-rw-r--r--contracts/core/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol2
-rw-r--r--contracts/core/contracts/examples/Validator/Validator.sol2
-rw-r--r--contracts/core/contracts/examples/Wallet/Wallet.sol2
-rw-r--r--contracts/core/contracts/examples/Whitelist/Whitelist.sol2
-rw-r--r--contracts/core/contracts/extensions/DutchAuction/DutchAuction.sol2
-rw-r--r--contracts/core/contracts/extensions/Forwarder/libs/LibConstants.sol2
-rw-r--r--contracts/core/contracts/extensions/OrderValidator/OrderValidator.sol2
-rw-r--r--contracts/core/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/MixinSignatureValidator.sol4
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MExchangeCore.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MMatchOrders.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MSignatureValidator.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MTransactions.sol2
-rw-r--r--contracts/core/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol2
-rw-r--r--contracts/core/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol2
-rw-r--r--contracts/core/package.json3
-rw-r--r--contracts/core/src/artifacts/index.ts8
-rw-r--r--contracts/core/src/wrappers/index.ts2
-rw-r--r--contracts/core/test/asset_proxy/proxies.ts7
-rw-r--r--contracts/core/test/exchange/core.ts4
-rw-r--r--contracts/core/tsconfig.json6
-rw-r--r--contracts/interfaces/.solhint.json20
-rw-r--r--contracts/interfaces/README.md72
-rw-r--r--contracts/interfaces/compiler.json35
-rw-r--r--contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol (renamed from contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetData.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol (renamed from contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol (renamed from contracts/core/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IExchange.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IExchange.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IExchangeCore.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IMatchOrders.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/ITransactions.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IValidator.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IValidator.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IWallet.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IWallet.sol)0
-rw-r--r--contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol (renamed from contracts/core/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol)0
-rw-r--r--contracts/interfaces/package.json57
-rw-r--r--contracts/interfaces/src/artifacts/index.ts29
-rw-r--r--contracts/interfaces/src/index.ts2
-rw-r--r--contracts/interfaces/src/wrappers/index.ts12
-rw-r--r--contracts/interfaces/tsconfig.json24
-rw-r--r--contracts/interfaces/tslint.json6
47 files changed, 287 insertions, 44 deletions
diff --git a/.gitignore b/.gitignore
index fab8f389e..22db8cf31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,6 +83,7 @@ contracts/core/generated-artifacts/
contracts/multisig/generated-artifacts/
contracts/utils/generated-artifacts/
contracts/libs/generated-artifacts/
+contracts/interfaces/generated-artifacts/
packages/sol-cov/test/fixtures/artifacts/
packages/metacoin/artifacts/
@@ -92,6 +93,7 @@ contracts/core/generated-wrappers/
contracts/multisig/generated-wrappers/
contracts/utils/generated-wrappers/
contracts/libs/generated-wrappers/
+contracts/interfaces/generated-wrappers/
packages/metacoin/src/contract_wrappers
# solc-bin in sol-compiler
diff --git a/.prettierignore b/.prettierignore
index 43c8015fd..0be17624b 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -8,6 +8,8 @@ lib
/contracts/utils/generated-artifacts
/contracts/libs/generated-wrappers
/contracts/libs/generated-artifacts
+/contracts/interfaces/generated-wrappers
+/contracts/interfaces/generated-artifacts
/packages/abi-gen-wrappers/src/generated-wrappers
/packages/contract-artifacts/artifacts
/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
diff --git a/contracts/core/compiler.json b/contracts/core/compiler.json
index 7e527130a..239c25919 100644
--- a/contracts/core/compiler.json
+++ b/contracts/core/compiler.json
@@ -33,11 +33,7 @@
"Exchange",
"ExchangeWrapper",
"Forwarder",
- "IAssetData",
- "IAssetProxy",
"InvalidERC721Receiver",
- "IValidator",
- "IWallet",
"MixinAuthorizable",
"MultiAssetProxy",
"OrderValidator",
diff --git a/contracts/core/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol b/contracts/core/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol
index ca5a64a26..d98136922 100644
--- a/contracts/core/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol
+++ b/contracts/core/contracts/examples/ExchangeWrapper/ExchangeWrapper.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
-import "../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
diff --git a/contracts/core/contracts/examples/Validator/Validator.sol b/contracts/core/contracts/examples/Validator/Validator.sol
index 72ed528ba..e488a9ca7 100644
--- a/contracts/core/contracts/examples/Validator/Validator.sol
+++ b/contracts/core/contracts/examples/Validator/Validator.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../../protocol/Exchange/interfaces/IValidator.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IValidator.sol";
contract Validator is
diff --git a/contracts/core/contracts/examples/Wallet/Wallet.sol b/contracts/core/contracts/examples/Wallet/Wallet.sol
index 3738be841..8edc74eb3 100644
--- a/contracts/core/contracts/examples/Wallet/Wallet.sol
+++ b/contracts/core/contracts/examples/Wallet/Wallet.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../../protocol/Exchange/interfaces/IWallet.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IWallet.sol";
import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
diff --git a/contracts/core/contracts/examples/Whitelist/Whitelist.sol b/contracts/core/contracts/examples/Whitelist/Whitelist.sol
index cfcddddd3..2a3d33738 100644
--- a/contracts/core/contracts/examples/Whitelist/Whitelist.sol
+++ b/contracts/core/contracts/examples/Whitelist/Whitelist.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
-import "../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "@0x/contracts-utils/contracts/utils/Ownable/Ownable.sol";
diff --git a/contracts/core/contracts/extensions/DutchAuction/DutchAuction.sol b/contracts/core/contracts/extensions/DutchAuction/DutchAuction.sol
index a40991ae7..90b6f4648 100644
--- a/contracts/core/contracts/extensions/DutchAuction/DutchAuction.sol
+++ b/contracts/core/contracts/extensions/DutchAuction/DutchAuction.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
-import "../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "../../tokens/ERC20Token/IERC20Token.sol";
import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
diff --git a/contracts/core/contracts/extensions/Forwarder/libs/LibConstants.sol b/contracts/core/contracts/extensions/Forwarder/libs/LibConstants.sol
index 0f98ae595..00be0f1bd 100644
--- a/contracts/core/contracts/extensions/Forwarder/libs/LibConstants.sol
+++ b/contracts/core/contracts/extensions/Forwarder/libs/LibConstants.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
-import "../../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "../../../tokens/EtherToken/IEtherToken.sol";
import "../../../tokens/ERC20Token/IERC20Token.sol";
diff --git a/contracts/core/contracts/extensions/OrderValidator/OrderValidator.sol b/contracts/core/contracts/extensions/OrderValidator/OrderValidator.sol
index 9e9e63e9b..78c31c8fc 100644
--- a/contracts/core/contracts/extensions/OrderValidator/OrderValidator.sol
+++ b/contracts/core/contracts/extensions/OrderValidator/OrderValidator.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
-import "../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "../../tokens/ERC20Token/IERC20Token.sol";
import "../../tokens/ERC721Token/IERC721Token.sol";
diff --git a/contracts/core/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol b/contracts/core/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol
index d63fb7f6d..fe77048ce 100644
--- a/contracts/core/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol
+++ b/contracts/core/contracts/protocol/AssetProxy/mixins/MAuthorizable.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../interfaces/IAuthorizable.sol";
+import "@0x/contracts-interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol";
contract MAuthorizable is
diff --git a/contracts/core/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol b/contracts/core/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol
index 02aeb4a13..36ab39b45 100644
--- a/contracts/core/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol
+++ b/contracts/core/contracts/protocol/Exchange/MixinAssetProxyDispatcher.sol
@@ -20,7 +20,7 @@ pragma solidity 0.4.24;
import "@0x/contracts-utils/contracts/utils/Ownable/Ownable.sol";
import "./mixins/MAssetProxyDispatcher.sol";
-import "../AssetProxy/interfaces/IAssetProxy.sol";
+import "@0x/contracts-interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol";
contract MixinAssetProxyDispatcher is
diff --git a/contracts/core/contracts/protocol/Exchange/MixinSignatureValidator.sol b/contracts/core/contracts/protocol/Exchange/MixinSignatureValidator.sol
index 711535aa8..80b4c0755 100644
--- a/contracts/core/contracts/protocol/Exchange/MixinSignatureValidator.sol
+++ b/contracts/core/contracts/protocol/Exchange/MixinSignatureValidator.sol
@@ -22,8 +22,8 @@ import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
import "@0x/contracts-utils/contracts/utils/ReentrancyGuard/ReentrancyGuard.sol";
import "./mixins/MSignatureValidator.sol";
import "./mixins/MTransactions.sol";
-import "./interfaces/IWallet.sol";
-import "./interfaces/IValidator.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IWallet.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IValidator.sol";
contract MixinSignatureValidator is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol b/contracts/core/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
index 0ddfca270..fe3d03326 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MAssetProxyDispatcher.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../interfaces/IAssetProxyDispatcher.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol";
contract MAssetProxyDispatcher is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MExchangeCore.sol b/contracts/core/contracts/protocol/Exchange/mixins/MExchangeCore.sol
index 099bdcc33..215284900 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MExchangeCore.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MExchangeCore.sol
@@ -21,7 +21,7 @@ pragma experimental ABIEncoderV2;
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "@0x/contracts-libs/contracts/libs/LibFillResults.sol";
-import "../interfaces/IExchangeCore.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchangeCore.sol";
contract MExchangeCore is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MMatchOrders.sol b/contracts/core/contracts/protocol/Exchange/mixins/MMatchOrders.sol
index bb285de03..1eb4be329 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MMatchOrders.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MMatchOrders.sol
@@ -20,7 +20,7 @@ pragma experimental ABIEncoderV2;
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "@0x/contracts-libs/contracts/libs/LibFillResults.sol";
-import "../interfaces/IMatchOrders.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IMatchOrders.sol";
contract MMatchOrders is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MSignatureValidator.sol b/contracts/core/contracts/protocol/Exchange/mixins/MSignatureValidator.sol
index 1fe88b908..a933976d1 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MSignatureValidator.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MSignatureValidator.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../interfaces/ISignatureValidator.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/ISignatureValidator.sol";
contract MSignatureValidator is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MTransactions.sol b/contracts/core/contracts/protocol/Exchange/mixins/MTransactions.sol
index 4f61a4945..a6b0fdc85 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MTransactions.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MTransactions.sol
@@ -17,7 +17,7 @@
*/
pragma solidity 0.4.24;
-import "../interfaces/ITransactions.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/ITransactions.sol";
contract MTransactions is
diff --git a/contracts/core/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol b/contracts/core/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol
index 2d21bf057..101e7cb82 100644
--- a/contracts/core/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol
+++ b/contracts/core/contracts/protocol/Exchange/mixins/MWrapperFunctions.sol
@@ -21,7 +21,7 @@ pragma experimental ABIEncoderV2;
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
import "@0x/contracts-libs/contracts/libs/LibFillResults.sol";
-import "../interfaces/IWrapperFunctions.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol";
contract MWrapperFunctions is
diff --git a/contracts/core/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol b/contracts/core/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol
index 8e077e3e8..d8c65929d 100644
--- a/contracts/core/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol
+++ b/contracts/core/contracts/test/ReentrantERC20Token/ReentrantERC20Token.sol
@@ -21,7 +21,7 @@ pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
import "../../tokens/ERC20Token/ERC20Token.sol";
-import "../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
diff --git a/contracts/core/package.json b/contracts/core/package.json
index 43fa9370e..be2214177 100644
--- a/contracts/core/package.json
+++ b/contracts/core/package.json
@@ -33,7 +33,7 @@
"lint-contracts": "solhint contracts/**/**/**/**/*.sol"
},
"config": {
- "abis": "generated-artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|DutchAuction|ERC20Token|ERC20Proxy|ERC721Token|ERC721Proxy|Forwarder|Exchange|ExchangeWrapper|IAssetData|IAssetProxy|InvalidERC721Receiver|MixinAuthorizable|MultiAssetProxy|OrderValidator|ReentrantERC20Token|TestAssetProxyOwner|TestAssetProxyDispatcher|TestConstants|TestExchangeInternals|TestLibBytes|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist|WETH9|ZRXToken).json"
+ "abis": "generated-artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|DutchAuction|ERC20Token|ERC20Proxy|ERC721Token|ERC721Proxy|Forwarder|Exchange|ExchangeWrapper|InvalidERC721Receiver|MixinAuthorizable|MultiAssetProxy|OrderValidator|ReentrantERC20Token|TestAssetProxyOwner|TestAssetProxyDispatcher|TestConstants|TestExchangeInternals|TestLibBytes|TestSignatureValidator|TestStaticCallReceiver|Validator|Wallet|Whitelist|WETH9|ZRXToken).json"
},
"repository": {
"type": "git",
@@ -77,6 +77,7 @@
"@0x/contracts-multisig": "^1.0.0",
"@0x/contracts-utils": "^1.0.0",
"@0x/contracts-libs": "^1.0.0",
+ "@0x/contracts-interfaces": "^1.0.0",
"@0x/types": "^1.3.0",
"@0x/typescript-typings": "^3.0.4",
"@0x/utils": "^2.0.6",
diff --git a/contracts/core/src/artifacts/index.ts b/contracts/core/src/artifacts/index.ts
index d578c36fe..1d868bae2 100644
--- a/contracts/core/src/artifacts/index.ts
+++ b/contracts/core/src/artifacts/index.ts
@@ -14,11 +14,7 @@ import * as ERC721Token from '../../generated-artifacts/ERC721Token.json';
import * as Exchange from '../../generated-artifacts/Exchange.json';
import * as ExchangeWrapper from '../../generated-artifacts/ExchangeWrapper.json';
import * as Forwarder from '../../generated-artifacts/Forwarder.json';
-import * as IAssetData from '../../generated-artifacts/IAssetData.json';
-import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json';
import * as InvalidERC721Receiver from '../../generated-artifacts/InvalidERC721Receiver.json';
-import * as IValidator from '../../generated-artifacts/IValidator.json';
-import * as IWallet from '../../generated-artifacts/IWallet.json';
import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json';
import * as OrderValidator from '../../generated-artifacts/OrderValidator.json';
@@ -49,10 +45,6 @@ export const artifacts = {
Exchange: Exchange as ContractArtifact,
ExchangeWrapper: ExchangeWrapper as ContractArtifact,
Forwarder: Forwarder as ContractArtifact,
- IAssetData: IAssetData as ContractArtifact,
- IAssetProxy: IAssetProxy as ContractArtifact,
- IValidator: IValidator as ContractArtifact,
- IWallet: IWallet as ContractArtifact,
InvalidERC721Receiver: InvalidERC721Receiver as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact,
MultiAssetProxy: MultiAssetProxy as ContractArtifact,
diff --git a/contracts/core/src/wrappers/index.ts b/contracts/core/src/wrappers/index.ts
index ed9d8ef47..92e2f6b9f 100644
--- a/contracts/core/src/wrappers/index.ts
+++ b/contracts/core/src/wrappers/index.ts
@@ -12,8 +12,6 @@ export * from '../../generated-wrappers/erc721_token';
export * from '../../generated-wrappers/exchange';
export * from '../../generated-wrappers/exchange_wrapper';
export * from '../../generated-wrappers/forwarder';
-export * from '../../generated-wrappers/i_asset_data';
-export * from '../../generated-wrappers/i_asset_proxy';
export * from '../../generated-wrappers/invalid_erc721_receiver';
export * from '../../generated-wrappers/mixin_authorizable';
export * from '../../generated-wrappers/order_validator';
diff --git a/contracts/core/test/asset_proxy/proxies.ts b/contracts/core/test/asset_proxy/proxies.ts
index 2527b0fbf..faa643924 100644
--- a/contracts/core/test/asset_proxy/proxies.ts
+++ b/contracts/core/test/asset_proxy/proxies.ts
@@ -1,3 +1,4 @@
+import { artifacts as interfacesArtifacts, IAssetDataContract, IAssetProxyContract } from '@0x/contracts-interfaces';
import {
chaiSetup,
constants,
@@ -22,8 +23,6 @@ import { DummyMultipleReturnERC20TokenContract } from '../../generated-wrappers/
import { DummyNoReturnERC20TokenContract } from '../../generated-wrappers/dummy_no_return_erc20_token';
import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
-import { IAssetDataContract } from '../../generated-wrappers/i_asset_data';
-import { IAssetProxyContract } from '../../generated-wrappers/i_asset_proxy';
import { MultiAssetProxyContract } from '../../generated-wrappers/multi_asset_proxy';
import { artifacts } from '../../src/artifacts';
import { ERC20Wrapper } from '../utils/erc20_wrapper';
@@ -33,12 +32,12 @@ chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
const assetProxyInterface = new IAssetProxyContract(
- artifacts.IAssetProxy.compilerOutput.abi,
+ interfacesArtifacts.IAssetProxy.compilerOutput.abi,
constants.NULL_ADDRESS,
provider,
);
const assetDataInterface = new IAssetDataContract(
- artifacts.IAssetData.compilerOutput.abi,
+ interfacesArtifacts.IAssetData.compilerOutput.abi,
constants.NULL_ADDRESS,
provider,
);
diff --git a/contracts/core/test/exchange/core.ts b/contracts/core/test/exchange/core.ts
index fd6b9ee6b..45eae0f22 100644
--- a/contracts/core/test/exchange/core.ts
+++ b/contracts/core/test/exchange/core.ts
@@ -1,3 +1,4 @@
+import { artifacts as interfacesArtifacts, IAssetDataContract } from '@0x/contracts-interfaces';
import {
chaiSetup,
constants,
@@ -27,7 +28,6 @@ import { DummyNoReturnERC20TokenContract } from '../../generated-wrappers/dummy_
import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy';
import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy';
import { ExchangeCancelEventArgs, ExchangeContract } from '../../generated-wrappers/exchange';
-import { IAssetDataContract } from '../../generated-wrappers/i_asset_data';
import { MultiAssetProxyContract } from '../../generated-wrappers/multi_asset_proxy';
import { ReentrantERC20TokenContract } from '../../generated-wrappers/reentrant_erc20_token';
import { TestStaticCallReceiverContract } from '../../generated-wrappers/test_static_call_receiver';
@@ -40,7 +40,7 @@ chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
const assetDataInterface = new IAssetDataContract(
- artifacts.IAssetData.compilerOutput.abi,
+ interfacesArtifacts.IAssetData.compilerOutput.abi,
constants.NULL_ADDRESS,
provider,
);
diff --git a/contracts/core/tsconfig.json b/contracts/core/tsconfig.json
index f2f3c4e97..ca3e6c15f 100644
--- a/contracts/core/tsconfig.json
+++ b/contracts/core/tsconfig.json
@@ -21,11 +21,6 @@
"./generated-artifacts/Exchange.json",
"./generated-artifacts/ExchangeWrapper.json",
"./generated-artifacts/Forwarder.json",
- "./generated-artifacts/IAssetData.json",
- "./generated-artifacts/IAssetProxy.json",
- "./generated-artifacts/IValidator.json",
- "./generated-artifacts/IWallet.json",
- "./generated-artifacts/InvalidERC721Receiver.json",
"./generated-artifacts/MixinAuthorizable.json",
"./generated-artifacts/MultiAssetProxy.json",
"./generated-artifacts/OrderValidator.json",
@@ -39,6 +34,7 @@
"./generated-artifacts/WETH9.json",
"./generated-artifacts/Wallet.json",
"./generated-artifacts/Whitelist.json",
+ "./generated-artifacts/InvalidERC721Receiver.json",
"./generated-artifacts/ZRXToken.json"
],
"exclude": ["./deploy/solc/solc_bin"]
diff --git a/contracts/interfaces/.solhint.json b/contracts/interfaces/.solhint.json
new file mode 100644
index 000000000..076afe9f3
--- /dev/null
+++ b/contracts/interfaces/.solhint.json
@@ -0,0 +1,20 @@
+{
+ "extends": "default",
+ "rules": {
+ "avoid-low-level-calls": false,
+ "avoid-tx-origin": "warn",
+ "bracket-align": false,
+ "code-complexity": false,
+ "const-name-snakecase": "error",
+ "expression-indent": "error",
+ "function-max-lines": false,
+ "func-order": "error",
+ "indent": ["error", 4],
+ "max-line-length": ["warn", 160],
+ "no-inline-assembly": false,
+ "quotes": ["error", "double"],
+ "separate-by-one-line-in-contract": "error",
+ "space-after-comma": "error",
+ "statement-indent": "error"
+ }
+}
diff --git a/contracts/interfaces/README.md b/contracts/interfaces/README.md
new file mode 100644
index 000000000..7e1c42c7b
--- /dev/null
+++ b/contracts/interfaces/README.md
@@ -0,0 +1,72 @@
+## Contracts interfaces
+
+Smart contract interfaces of the 0x protocol.
+
+## Usage
+
+Contracts that make up and interact with version 2.0.0 of the protocol can be found in the [contracts](./contracts) directory. The contents of this directory are broken down into the following subdirectories:
+
+* [protocol](./contracts/protocol)
+ * This directory contains the contract interfaces that make up version 2.0.0. A full specification can be found [here](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
+
+## Bug bounty
+
+A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
+
+## Contributing
+
+We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
+
+For proposals regarding the 0x protocol's smart contract architecture, message format, or additional functionality, go to the [0x Improvement Proposals (ZEIPs)](https://github.com/0xProject/ZEIPs) repository and follow the contribution guidelines provided therein.
+
+Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
+
+### Install Dependencies
+
+If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
+
+```bash
+yarn config set workspaces-experimental true
+```
+
+Then install dependencies
+
+```bash
+yarn install
+```
+
+### Build
+
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
+
+```bash
+PKG=@0x/contracts-interfaces yarn build
+```
+
+Or continuously rebuild on change:
+
+```bash
+PKG=@0x/contracts-interfaces yarn watch
+```
+
+### Clean
+
+```bash
+yarn clean
+```
+
+### Lint
+
+```bash
+yarn lint
+```
+
+### Run Tests
+
+```bash
+yarn test
+```
+
+#### Testing options
+
+Contracts testing options like coverage, profiling, revert traces or backing node choosing - are described [here](../TESTING.md).
diff --git a/contracts/interfaces/compiler.json b/contracts/interfaces/compiler.json
new file mode 100644
index 000000000..38a232541
--- /dev/null
+++ b/contracts/interfaces/compiler.json
@@ -0,0 +1,35 @@
+{
+ "artifactsDir": "./generated-artifacts",
+ "contractsDir": "./contracts",
+ "compilerSettings": {
+ "optimizer": {
+ "enabled": true,
+ "runs": 1000000
+ },
+ "outputSelection": {
+ "*": {
+ "*": [
+ "abi",
+ "evm.bytecode.object",
+ "evm.bytecode.sourceMap",
+ "evm.deployedBytecode.object",
+ "evm.deployedBytecode.sourceMap"
+ ]
+ }
+ }
+ },
+ "contracts": [
+ "IAssetData",
+ "IAssetProxy",
+ "IAuthorizable",
+ "IAssetProxyDispatcher",
+ "IExchange",
+ "IExchangeCore",
+ "IMatchOrders",
+ "ISignatureValidator",
+ "ITransactions",
+ "IValidator",
+ "IWallet",
+ "IWrapperFunctions"
+ ]
+}
diff --git a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetData.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol
index e2da68919..e2da68919 100644
--- a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetData.sol
+++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol
diff --git a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol
index b25d2d75a..b25d2d75a 100644
--- a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAssetProxy.sol
+++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol
diff --git a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol
index 96ee05dee..96ee05dee 100644
--- a/contracts/core/contracts/protocol/AssetProxy/interfaces/IAuthorizable.sol
+++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol
index 8db8d6f6c..8db8d6f6c 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IAssetProxyDispatcher.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IExchange.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol
index b92abba04..b92abba04 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IExchange.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IExchangeCore.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol
index 0da73529c..0da73529c 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IExchangeCore.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IMatchOrders.sol b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol
index b88e158c3..b88e158c3 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IMatchOrders.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol
index 1fd0eccf0..1fd0eccf0 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/ISignatureValidator.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/ITransactions.sol b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol
index 4446c55ce..4446c55ce 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/ITransactions.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol
index 2dd69100c..2dd69100c 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IValidator.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IWallet.sol b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol
index c97161ca6..c97161ca6 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IWallet.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol
diff --git a/contracts/core/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol
index 833bb7e88..833bb7e88 100644
--- a/contracts/core/contracts/protocol/Exchange/interfaces/IWrapperFunctions.sol
+++ b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol
diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json
new file mode 100644
index 000000000..b79ae20ff
--- /dev/null
+++ b/contracts/interfaces/package.json
@@ -0,0 +1,57 @@
+{
+ "private": true,
+ "name": "@0x/contracts-interfaces",
+ "version": "1.0.0",
+ "engines": {
+ "node": ">=6.12"
+ },
+ "description": "Smart contract interfaces of 0x protocol",
+ "main": "lib/src/index.js",
+ "scripts": {
+ "build": "yarn pre_build && tsc -b",
+ "build:ci": "yarn build",
+ "pre_build": "run-s compile generate_contract_wrappers",
+ "compile": "sol-compiler --contracts-dir contracts",
+ "clean": "shx rm -rf lib generated-artifacts generated-wrappers",
+ "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
+ "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
+ "lint-contracts": "solhint contracts/**/**/**/**/*.sol"
+ },
+ "config": {
+ "abis": "generated-artifacts/@(IAssetData|IAssetProxy|IAuthorizable|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions).json"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/0xProject/0x-monorepo.git"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/0xProject/0x-monorepo/issues"
+ },
+ "homepage": "https://github.com/0xProject/0x-monorepo/contracts/interfaces/README.md",
+ "devDependencies": {
+ "@0x/abi-gen": "^1.0.17",
+ "@0x/sol-compiler": "^1.1.14",
+ "@0x/tslint-config": "^1.0.10",
+ "npm-run-all": "^4.1.2",
+ "shx": "^0.2.2",
+ "solhint": "^1.2.1",
+ "tslint": "5.11.0",
+ "typescript": "3.0.1",
+ "yargs": "^10.0.3"
+ },
+ "dependencies": {
+ "@0x/base-contract": "^3.0.8",
+ "@0x/contracts-utils": "^1.0.0",
+ "@0x/contracts-libs": "^1.0.0",
+ "@0x/types": "^1.3.0",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.6",
+ "@0x/web3-wrapper": "^3.1.6",
+ "ethereum-types": "^1.1.2",
+ "lodash": "^4.17.5"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/contracts/interfaces/src/artifacts/index.ts b/contracts/interfaces/src/artifacts/index.ts
new file mode 100644
index 000000000..5a2a37d8a
--- /dev/null
+++ b/contracts/interfaces/src/artifacts/index.ts
@@ -0,0 +1,29 @@
+import { ContractArtifact } from 'ethereum-types';
+
+import * as IAssetData from '../../generated-artifacts/IAssetData.json';
+import * as IAssetProxy from '../../generated-artifacts/IAssetProxy.json';
+import * as IAssetProxyDispatcher from '../../generated-artifacts/IAssetProxyDispatcher.json';
+import * as IAuthorizable from '../../generated-artifacts/IAuthorizable.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';
+
+export const artifacts = {
+ IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact,
+ IAuthorizable: IAuthorizable 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,
+ IAssetData: IAssetData as ContractArtifact,
+ IAssetProxy: IAssetProxy as ContractArtifact,
+ IValidator: IValidator as ContractArtifact,
+ IWallet: IWallet as ContractArtifact,
+};
diff --git a/contracts/interfaces/src/index.ts b/contracts/interfaces/src/index.ts
new file mode 100644
index 000000000..d55f08ea2
--- /dev/null
+++ b/contracts/interfaces/src/index.ts
@@ -0,0 +1,2 @@
+export * from './artifacts';
+export * from './wrappers';
diff --git a/contracts/interfaces/src/wrappers/index.ts b/contracts/interfaces/src/wrappers/index.ts
new file mode 100644
index 000000000..f7f72fada
--- /dev/null
+++ b/contracts/interfaces/src/wrappers/index.ts
@@ -0,0 +1,12 @@
+export * from '../../generated-wrappers/i_asset_data';
+export * from '../../generated-wrappers/i_asset_proxy';
+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_authorizable';
+export * from '../../generated-wrappers/i_wrapper_functions';
+export * from '../../generated-wrappers/i_validator';
+export * from '../../generated-wrappers/i_wallet';
diff --git a/contracts/interfaces/tsconfig.json b/contracts/interfaces/tsconfig.json
new file mode 100644
index 000000000..90b7d41bb
--- /dev/null
+++ b/contracts/interfaces/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "extends": "../../tsconfig",
+ "compilerOptions": {
+ "outDir": "lib",
+ "rootDir": ".",
+ "resolveJsonModule": true
+ },
+ "include": ["./src/**/*", "./generated-wrappers/**/*"],
+ "files": [
+ "./generated-artifacts/IAssetData.json",
+ "./generated-artifacts/IAssetProxy.json",
+ "./generated-artifacts/IAuthorizable.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"
+ ],
+ "exclude": ["./deploy/solc/solc_bin"]
+}
diff --git a/contracts/interfaces/tslint.json b/contracts/interfaces/tslint.json
new file mode 100644
index 000000000..1bb3ac2a2
--- /dev/null
+++ b/contracts/interfaces/tslint.json
@@ -0,0 +1,6 @@
+{
+ "extends": ["@0x/tslint-config"],
+ "rules": {
+ "custom-no-magic-numbers": false
+ }
+}