Merge pull request #1385 from 0xProject/feature/contracts-monorepo-5
Refactor our protocol interfaces into `@0x/contracts-interfaces`
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -87,6 +87,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/
|
||||
|
||||
@@ -96,6 +97,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,11 +33,7 @@
|
||||
"Exchange",
|
||||
"ExchangeWrapper",
|
||||
"Forwarder",
|
||||
"IAssetData",
|
||||
"IAssetProxy",
|
||||
"InvalidERC721Receiver",
|
||||
"IValidator",
|
||||
"IWallet",
|
||||
"MixinAuthorizable",
|
||||
"MultiAssetProxy",
|
||||
"OrderValidator",
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
20
contracts/interfaces/.solhint.json
Normal file
20
contracts/interfaces/.solhint.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
72
contracts/interfaces/README.md
Normal file
72
contracts/interfaces/README.md
Normal file
@@ -0,0 +1,72 @@
|
||||
## Contract 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).
|
||||
35
contracts/interfaces/compiler.json
Normal file
35
contracts/interfaces/compiler.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
57
contracts/interfaces/package.json
Normal file
57
contracts/interfaces/package.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
29
contracts/interfaces/src/artifacts/index.ts
Normal file
29
contracts/interfaces/src/artifacts/index.ts
Normal file
@@ -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,
|
||||
};
|
||||
2
contracts/interfaces/src/index.ts
Normal file
2
contracts/interfaces/src/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './artifacts';
|
||||
export * from './wrappers';
|
||||
12
contracts/interfaces/src/wrappers/index.ts
Normal file
12
contracts/interfaces/src/wrappers/index.ts
Normal file
@@ -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';
|
||||
24
contracts/interfaces/tsconfig.json
Normal file
24
contracts/interfaces/tsconfig.json
Normal file
@@ -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"]
|
||||
}
|
||||
6
contracts/interfaces/tslint.json
Normal file
6
contracts/interfaces/tslint.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": ["@0x/tslint-config"],
|
||||
"rules": {
|
||||
"custom-no-magic-numbers": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user