From 48021a227f7034c2238c64146b2eb05eb8bfb687 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 5 Dec 2018 11:19:10 +0100 Subject: Refactor our protocol interfaces into @0x/contracts-interfaces --- contracts/interfaces/.solhint.json | 20 +++ contracts/interfaces/README.md | 72 ++++++++++ contracts/interfaces/compiler.json | 35 +++++ .../contracts/protocol/AssetProxy/IAssetData.sol | 44 ++++++ .../contracts/protocol/AssetProxy/IAssetProxy.sol | 46 ++++++ .../protocol/AssetProxy/IAuthorizable.sol | 52 +++++++ .../protocol/Exchange/IAssetProxyDispatcher.sol | 37 +++++ .../contracts/protocol/Exchange/IExchange.sol | 38 +++++ .../contracts/protocol/Exchange/IExchangeCore.sol | 60 ++++++++ .../contracts/protocol/Exchange/IMatchOrders.sol | 44 ++++++ .../protocol/Exchange/ISignatureValidator.sol | 57 ++++++++ .../contracts/protocol/Exchange/ITransactions.sol | 35 +++++ .../contracts/protocol/Exchange/IValidator.sol | 37 +++++ .../contracts/protocol/Exchange/IWallet.sol | 35 +++++ .../protocol/Exchange/IWrapperFunctions.sol | 160 +++++++++++++++++++++ contracts/interfaces/package.json | 57 ++++++++ contracts/interfaces/src/artifacts/index.ts | 29 ++++ contracts/interfaces/src/index.ts | 2 + contracts/interfaces/src/wrappers/index.ts | 12 ++ contracts/interfaces/tsconfig.json | 24 ++++ contracts/interfaces/tslint.json | 6 + 21 files changed, 902 insertions(+) create mode 100644 contracts/interfaces/.solhint.json create mode 100644 contracts/interfaces/README.md create mode 100644 contracts/interfaces/compiler.json create mode 100644 contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol create mode 100644 contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol create mode 100644 contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IExchange.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IValidator.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IWallet.sol create mode 100644 contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol create mode 100644 contracts/interfaces/package.json create mode 100644 contracts/interfaces/src/artifacts/index.ts create mode 100644 contracts/interfaces/src/index.ts create mode 100644 contracts/interfaces/src/wrappers/index.ts create mode 100644 contracts/interfaces/tsconfig.json create mode 100644 contracts/interfaces/tslint.json (limited to 'contracts/interfaces') 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/interfaces/contracts/protocol/AssetProxy/IAssetData.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol new file mode 100644 index 000000000..e2da68919 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol @@ -0,0 +1,44 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +// solhint-disable +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + + +// @dev Interface of the asset proxy's assetData. +// The asset proxies take an ABI encoded `bytes assetData` as argument. +// This argument is ABI encoded as one of the methods of this interface. +interface IAssetData { + + function ERC20Token(address tokenContract) + external; + + function ERC721Token( + address tokenContract, + uint256 tokenId + ) + external; + + function MultiAsset( + uint256[] amounts, + bytes[] nestedAssetData + ) + external; + +} diff --git a/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol new file mode 100644 index 000000000..b25d2d75a --- /dev/null +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol @@ -0,0 +1,46 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + +import "./IAuthorizable.sol"; + + +contract IAssetProxy is + IAuthorizable +{ + /// @dev Transfers assets. Either succeeds or throws. + /// @param assetData Byte array encoded for the respective asset proxy. + /// @param from Address to transfer asset from. + /// @param to Address to transfer asset to. + /// @param amount Amount of asset to transfer. + function transferFrom( + bytes assetData, + address from, + address to, + uint256 amount + ) + external; + + /// @dev Gets the proxy id associated with the proxy address. + /// @return Proxy id. + function getProxyId() + external + pure + returns (bytes4); +} diff --git a/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol new file mode 100644 index 000000000..96ee05dee --- /dev/null +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol @@ -0,0 +1,52 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + +import "@0x/contracts-utils/contracts/utils/Ownable/IOwnable.sol"; + + +contract IAuthorizable is + IOwnable +{ + /// @dev Authorizes an address. + /// @param target Address to authorize. + function addAuthorizedAddress(address target) + external; + + /// @dev Removes authorizion of an address. + /// @param target Address to remove authorization from. + function removeAuthorizedAddress(address target) + external; + + /// @dev Removes authorizion of an address. + /// @param target Address to remove authorization from. + /// @param index Index of target in authorities array. + function removeAuthorizedAddressAtIndex( + address target, + uint256 index + ) + external; + + /// @dev Gets all authorized addresses. + /// @return Array of authorized addresses. + function getAuthorizedAddresses() + external + view + returns (address[] memory); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol new file mode 100644 index 000000000..8db8d6f6c --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol @@ -0,0 +1,37 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + + +contract IAssetProxyDispatcher { + + /// @dev Registers an asset proxy to its asset proxy id. + /// Once an asset proxy is registered, it cannot be unregistered. + /// @param assetProxy Address of new asset proxy to register. + function registerAssetProxy(address assetProxy) + external; + + /// @dev Gets an asset proxy. + /// @param assetProxyId Id of the asset proxy. + /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered. + function getAssetProxy(bytes4 assetProxyId) + external + view + returns (address); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol new file mode 100644 index 000000000..b92abba04 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol @@ -0,0 +1,38 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + +import "./IExchangeCore.sol"; +import "./IMatchOrders.sol"; +import "./ISignatureValidator.sol"; +import "./ITransactions.sol"; +import "./IAssetProxyDispatcher.sol"; +import "./IWrapperFunctions.sol"; + + +// solhint-disable no-empty-blocks +contract IExchange is + IExchangeCore, + IMatchOrders, + ISignatureValidator, + ITransactions, + IAssetProxyDispatcher, + IWrapperFunctions +{} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol new file mode 100644 index 000000000..0da73529c --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol @@ -0,0 +1,60 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + +import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; +import "@0x/contracts-libs/contracts/libs/LibFillResults.sol"; + + +contract IExchangeCore { + + /// @dev Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch + /// and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress). + /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled. + function cancelOrdersUpTo(uint256 targetOrderEpoch) + external; + + /// @dev Fills the input order. + /// @param order Order struct containing order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signature Proof that order has been created by maker. + /// @return Amounts filled and fees paid by maker and taker. + function fillOrder( + LibOrder.Order memory order, + uint256 takerAssetFillAmount, + bytes memory signature + ) + public + returns (LibFillResults.FillResults memory fillResults); + + /// @dev After calling, the order can not be filled anymore. + /// @param order Order struct containing order specifications. + function cancelOrder(LibOrder.Order memory order) + public; + + /// @dev Gets information about an order: status, hash, and amount filled. + /// @param order Order to gather information on. + /// @return OrderInfo Information about the order and its state. + /// See LibOrder.OrderInfo for a complete description. + function getOrderInfo(LibOrder.Order memory order) + public + view + returns (LibOrder.OrderInfo memory orderInfo); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol new file mode 100644 index 000000000..b88e158c3 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol @@ -0,0 +1,44 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + +import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; +import "@0x/contracts-libs/contracts/libs/LibFillResults.sol"; + + +contract IMatchOrders { + + /// @dev Match two complementary orders that have a profitable spread. + /// Each order is filled at their respective price point. However, the calculations are + /// carried out as though the orders are both being filled at the right order's price point. + /// The profit made by the left order goes to the taker (who matched the two orders). + /// @param leftOrder First order to match. + /// @param rightOrder Second order to match. + /// @param leftSignature Proof that order was created by the left maker. + /// @param rightSignature Proof that order was created by the right maker. + /// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders. + function matchOrders( + LibOrder.Order memory leftOrder, + LibOrder.Order memory rightOrder, + bytes memory leftSignature, + bytes memory rightSignature + ) + public + returns (LibFillResults.MatchedFillResults memory matchedFillResults); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol new file mode 100644 index 000000000..1fd0eccf0 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol @@ -0,0 +1,57 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + + +contract ISignatureValidator { + + /// @dev Approves a hash on-chain using any valid signature type. + /// After presigning a hash, the preSign signature type will become valid for that hash and signer. + /// @param signerAddress Address that should have signed the given hash. + /// @param signature Proof that the hash has been signed by signer. + function preSign( + bytes32 hash, + address signerAddress, + bytes signature + ) + external; + + /// @dev Approves/unnapproves a Validator contract to verify signatures on signer's behalf. + /// @param validatorAddress Address of Validator contract. + /// @param approval Approval or disapproval of Validator contract. + function setSignatureValidatorApproval( + address validatorAddress, + bool approval + ) + external; + + /// @dev Verifies that a signature is valid. + /// @param hash Message hash that is signed. + /// @param signerAddress Address of signer. + /// @param signature Proof of signing. + /// @return Validity of order signature. + function isValidSignature( + bytes32 hash, + address signerAddress, + bytes memory signature + ) + public + view + returns (bool isValid); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol new file mode 100644 index 000000000..4446c55ce --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol @@ -0,0 +1,35 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +pragma solidity 0.4.24; + + +contract ITransactions { + + /// @dev Executes an exchange method call in the context of signer. + /// @param salt Arbitrary number to ensure uniqueness of transaction hash. + /// @param signerAddress Address of transaction signer. + /// @param data AbiV2 encoded calldata. + /// @param signature Proof of signer transaction by signer. + function executeTransaction( + uint256 salt, + address signerAddress, + bytes data, + bytes signature + ) + external; +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol new file mode 100644 index 000000000..2dd69100c --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol @@ -0,0 +1,37 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + + +contract IValidator { + + /// @dev Verifies that a signature is valid. + /// @param hash Message hash that is signed. + /// @param signerAddress Address that should have signed the given hash. + /// @param signature Proof of signing. + /// @return Validity of order signature. + function isValidSignature( + bytes32 hash, + address signerAddress, + bytes signature + ) + external + view + returns (bool isValid); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol new file mode 100644 index 000000000..c97161ca6 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol @@ -0,0 +1,35 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; + + +contract IWallet { + + /// @dev Verifies that a signature is valid. + /// @param hash Message hash that is signed. + /// @param signature Proof of signing. + /// @return Validity of order signature. + function isValidSignature( + bytes32 hash, + bytes signature + ) + external + view + returns (bool isValid); +} diff --git a/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol new file mode 100644 index 000000000..833bb7e88 --- /dev/null +++ b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol @@ -0,0 +1,160 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + +import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; +import "@0x/contracts-libs/contracts/libs/LibFillResults.sol"; + + +contract IWrapperFunctions { + + /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled. + /// @param order LibOrder.Order struct containing order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signature Proof that order has been created by maker. + function fillOrKillOrder( + LibOrder.Order memory order, + uint256 takerAssetFillAmount, + bytes memory signature + ) + public + returns (LibFillResults.FillResults memory fillResults); + + /// @dev Fills an order with specified parameters and ECDSA signature. + /// Returns false if the transaction would otherwise revert. + /// @param order LibOrder.Order struct containing order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signature Proof that order has been created by maker. + /// @return Amounts filled and fees paid by maker and taker. + function fillOrderNoThrow( + LibOrder.Order memory order, + uint256 takerAssetFillAmount, + bytes memory signature + ) + public + returns (LibFillResults.FillResults memory fillResults); + + /// @dev Synchronously executes multiple calls of fillOrder. + /// @param orders Array of order specifications. + /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders. + /// @param signatures Proofs that orders have been created by makers. + /// @return Amounts filled and fees paid by makers and taker. + function batchFillOrders( + LibOrder.Order[] memory orders, + uint256[] memory takerAssetFillAmounts, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously executes multiple calls of fillOrKill. + /// @param orders Array of order specifications. + /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders. + /// @param signatures Proofs that orders have been created by makers. + /// @return Amounts filled and fees paid by makers and taker. + function batchFillOrKillOrders( + LibOrder.Order[] memory orders, + uint256[] memory takerAssetFillAmounts, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Fills an order with specified parameters and ECDSA signature. + /// Returns false if the transaction would otherwise revert. + /// @param orders Array of order specifications. + /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders. + /// @param signatures Proofs that orders have been created by makers. + /// @return Amounts filled and fees paid by makers and taker. + function batchFillOrdersNoThrow( + LibOrder.Order[] memory orders, + uint256[] memory takerAssetFillAmounts, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker. + /// @param orders Array of order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signatures Proofs that orders have been created by makers. + /// @return Amounts filled and fees paid by makers and taker. + function marketSellOrders( + LibOrder.Order[] memory orders, + uint256 takerAssetFillAmount, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker. + /// Returns false if the transaction would otherwise revert. + /// @param orders Array of order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signatures Proofs that orders have been signed by makers. + /// @return Amounts filled and fees paid by makers and taker. + function marketSellOrdersNoThrow( + LibOrder.Order[] memory orders, + uint256 takerAssetFillAmount, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker. + /// @param orders Array of order specifications. + /// @param makerAssetFillAmount Desired amount of makerAsset to buy. + /// @param signatures Proofs that orders have been signed by makers. + /// @return Amounts filled and fees paid by makers and taker. + function marketBuyOrders( + LibOrder.Order[] memory orders, + uint256 makerAssetFillAmount, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker. + /// Returns false if the transaction would otherwise revert. + /// @param orders Array of order specifications. + /// @param makerAssetFillAmount Desired amount of makerAsset to buy. + /// @param signatures Proofs that orders have been signed by makers. + /// @return Amounts filled and fees paid by makers and taker. + function marketBuyOrdersNoThrow( + LibOrder.Order[] memory orders, + uint256 makerAssetFillAmount, + bytes[] memory signatures + ) + public + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Synchronously cancels multiple orders in a single transaction. + /// @param orders Array of order specifications. + function batchCancelOrders(LibOrder.Order[] memory orders) + public; + + /// @dev Fetches information for all passed in orders + /// @param orders Array of order specifications. + /// @return Array of OrderInfo instances that correspond to each order. + function getOrdersInfo(LibOrder.Order[] memory orders) + public + view + returns (LibOrder.OrderInfo[] memory); +} 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 + } +} -- cgit v1.2.3 From 51b1de041e3ce2a03ba79614d9a3166fbcab6222 Mon Sep 17 00:00:00 2001 From: Fabio B Date: Fri, 7 Dec 2018 11:11:36 +0100 Subject: Update contracts/interfaces/README.md Co-Authored-By: LogvinovLeon --- contracts/interfaces/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/README.md b/contracts/interfaces/README.md index 7e1c42c7b..b7d519abb 100644 --- a/contracts/interfaces/README.md +++ b/contracts/interfaces/README.md @@ -1,4 +1,4 @@ -## Contracts interfaces +## Contract interfaces Smart contract interfaces of the 0x protocol. -- cgit v1.2.3 From c580f4ddcb61844e590e0829c32cbdd15ab03beb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 10 Dec 2018 15:13:36 -0800 Subject: Change contracts publish config --- contracts/interfaces/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index b79ae20ff..6461e9779 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -52,6 +52,6 @@ "lodash": "^4.17.5" }, "publishConfig": { - "access": "public" + "access": "private" } } -- cgit v1.2.3 From 5e6d1779cb51fc1687c46f687a2140e05b0a6559 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 10 Dec 2018 15:20:52 -0800 Subject: Re-use solhint configuration --- contracts/interfaces/.solhint.json | 20 -------------------- contracts/interfaces/package.json | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 contracts/interfaces/.solhint.json (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/.solhint.json b/contracts/interfaces/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/interfaces/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "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/package.json b/contracts/interfaces/package.json index 6461e9779..9ba41192c 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -15,7 +15,7 @@ "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" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(IAssetData|IAssetProxy|IAuthorizable|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions).json" @@ -35,7 +35,7 @@ "@0x/tslint-config": "^1.0.10", "npm-run-all": "^4.1.2", "shx": "^0.2.2", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" -- cgit v1.2.3 From 928b253c81971eb6f59efd09ab6a9063d4e6e4ca Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 10 Dec 2018 15:47:13 -0800 Subject: Revert access changes --- contracts/interfaces/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 9ba41192c..04d307f5d 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -52,6 +52,6 @@ "lodash": "^4.17.5" }, "publishConfig": { - "access": "private" + "access": "public" } } -- cgit v1.2.3 From 96b8100a787d00142dcf875d940c9125571cbde6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 11 Dec 2018 15:38:43 -0800 Subject: Publish - 0x.js@2.0.7 - @0x/abi-gen@1.0.18 - @0x/abi-gen-wrappers@2.0.1 - @0x/assert@1.0.19 - @0x/asset-buyer@3.0.3 - @0x/base-contract@3.0.9 - @0x/connect@3.0.9 - @0x/contract-wrappers@4.1.2 - @0x/dev-tools-pages@0.0.9 - @0x/dev-utils@1.0.20 - ethereum-types@1.1.3 - @0x/fill-scenarios@1.0.15 - @0x/instant@1.0.3 - @0x/json-schemas@2.1.3 - @0x/metacoin@0.0.31 - @0x/migrations@2.2.1 - @0x/monorepo-scripts@1.0.15 - @0x/order-utils@3.0.6 - @0x/order-watcher@2.2.7 - @0x/pipeline@1.0.1 - @0x/react-docs@1.0.21 - @0x/react-shared@1.0.24 - @0x/sol-compiler@1.1.15 - @0x/sol-cov@2.1.15 - @0x/sol-doc@1.0.10 - @0x/sol-resolver@1.1.0 - @0x/sra-spec@1.0.12 - @0x/subproviders@2.1.7 - @0x/testnet-faucets@1.0.59 - @0x/types@1.4.0 - @0x/typescript-typings@3.0.5 - @0x/utils@2.0.7 - @0x/web3-wrapper@3.2.0 - @0x/website@0.0.62 - @0x/contracts-examples@1.0.1 - @0x/contracts-extensions@1.0.1 - @0x/contracts-interfaces@1.0.1 - @0x/contracts-libs@1.0.1 - @0x/contracts-multisig@1.0.1 - @0x/contracts-protocol@2.1.57 - @0x/contracts-test-utils@1.0.1 - @0x/contracts-tokens@1.0.1 - @0x/contracts-utils@1.0.1 --- contracts/interfaces/package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 04d307f5d..85d0ccc26 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0x/contracts-interfaces", - "version": "1.0.0", + "version": "1.0.1", "engines": { "node": ">=6.12" }, @@ -30,8 +30,8 @@ }, "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/abi-gen": "^1.0.18", + "@0x/sol-compiler": "^1.1.15", "@0x/tslint-config": "^1.0.10", "npm-run-all": "^4.1.2", "shx": "^0.2.2", @@ -41,14 +41,14 @@ "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", + "@0x/base-contract": "^3.0.9", + "@0x/contracts-libs": "^1.0.1", + "@0x/contracts-utils": "^1.0.1", + "@0x/types": "^1.4.0", + "@0x/typescript-typings": "^3.0.5", + "@0x/utils": "^2.0.7", + "@0x/web3-wrapper": "^3.2.0", + "ethereum-types": "^1.1.3", "lodash": "^4.17.5" }, "publishConfig": { -- cgit v1.2.3 From 5a45bc5e7ba3945fe5788b7f86f885768f034f4b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 11:10:24 -0800 Subject: Revert version bump to unpublished contracts packages --- contracts/interfaces/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 85d0ccc26..555b7e2db 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0x/contracts-interfaces", - "version": "1.0.1", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -42,8 +42,8 @@ }, "dependencies": { "@0x/base-contract": "^3.0.9", - "@0x/contracts-libs": "^1.0.1", - "@0x/contracts-utils": "^1.0.1", + "@0x/contracts-libs": "^1.0.0", + "@0x/contracts-utils": "^1.0.0", "@0x/types": "^1.4.0", "@0x/typescript-typings": "^3.0.5", "@0x/utils": "^2.0.7", -- cgit v1.2.3 From 2abd8fe4ee860e5a4008a9f92f6d29239d14b2bc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:28:27 -0800 Subject: Publish - 0x.js@2.0.8 - @0x/abi-gen@1.0.19 - @0x/abi-gen-wrappers@2.0.2 - @0x/assert@1.0.20 - @0x/asset-buyer@3.0.4 - @0x/base-contract@3.0.10 - @0x/connect@3.0.10 - @0x/contract-wrappers@4.1.3 - @0x/dev-tools-pages@0.0.10 - @0x/dev-utils@1.0.21 - ethereum-types@1.1.4 - @0x/fill-scenarios@1.0.16 - @0x/instant@1.0.4 - @0x/json-schemas@2.1.4 - @0x/metacoin@0.0.32 - @0x/migrations@2.2.2 - @0x/order-utils@3.0.7 - @0x/order-watcher@2.2.8 - @0x/pipeline@1.0.2 - @0x/react-docs@1.0.22 - @0x/react-shared@1.0.25 - @0x/sol-compiler@1.1.16 - @0x/sol-cov@2.1.16 - @0x/sol-doc@1.0.11 - @0x/sol-resolver@1.1.1 - @0x/sra-spec@1.0.13 - @0x/subproviders@2.1.8 - @0x/testnet-faucets@1.0.60 - @0x/tslint-config@2.0.0 - @0x/types@1.4.1 - @0x/typescript-typings@3.0.6 - @0x/utils@2.0.8 - @0x/web3-wrapper@3.2.1 - @0x/website@0.0.63 - @0x/contracts-examples@1.0.1 - @0x/contracts-extensions@1.0.1 - @0x/contracts-interfaces@1.0.1 - @0x/contracts-libs@1.0.1 - @0x/contracts-multisig@1.0.1 - @0x/contracts-protocol@2.1.58 - @0x/contracts-test-utils@1.0.2 - @0x/contracts-tokens@1.0.1 - @0x/contracts-utils@1.0.1 --- contracts/interfaces/package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 555b7e2db..a4f152bba 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@0x/contracts-interfaces", - "version": "1.0.0", + "version": "1.0.1", "engines": { "node": ">=6.12" }, @@ -30,9 +30,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/interfaces/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.18", - "@0x/sol-compiler": "^1.1.15", - "@0x/tslint-config": "^1.0.10", + "@0x/abi-gen": "^1.0.19", + "@0x/sol-compiler": "^1.1.16", + "@0x/tslint-config": "^2.0.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solhint": "^1.4.1", @@ -41,14 +41,14 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.9", - "@0x/contracts-libs": "^1.0.0", - "@0x/contracts-utils": "^1.0.0", - "@0x/types": "^1.4.0", - "@0x/typescript-typings": "^3.0.5", - "@0x/utils": "^2.0.7", - "@0x/web3-wrapper": "^3.2.0", - "ethereum-types": "^1.1.3", + "@0x/base-contract": "^3.0.10", + "@0x/contracts-libs": "^1.0.1", + "@0x/contracts-utils": "^1.0.1", + "@0x/types": "^1.4.1", + "@0x/typescript-typings": "^3.0.6", + "@0x/utils": "^2.0.8", + "@0x/web3-wrapper": "^3.2.1", + "ethereum-types": "^1.1.4", "lodash": "^4.17.5" }, "publishConfig": { -- cgit v1.2.3 From 545101f7a5155fed77f9c65153bd13bdc23387bf Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:36:34 -0800 Subject: Make contracts packages not private --- contracts/interfaces/package.json | 1 - 1 file changed, 1 deletion(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index a4f152bba..b7f8f0e2b 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,5 +1,4 @@ { - "private": true, "name": "@0x/contracts-interfaces", "version": "1.0.1", "engines": { -- cgit v1.2.3 From d018f6d9ccb6fd31e9dacb845a68bf6851a4cd4c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:58:48 -0800 Subject: Updated CHANGELOGS --- contracts/interfaces/CHANGELOG.json | 11 +++++++++++ contracts/interfaces/CHANGELOG.md | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 contracts/interfaces/CHANGELOG.json create mode 100644 contracts/interfaces/CHANGELOG.md (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/CHANGELOG.json b/contracts/interfaces/CHANGELOG.json new file mode 100644 index 000000000..19ac770af --- /dev/null +++ b/contracts/interfaces/CHANGELOG.json @@ -0,0 +1,11 @@ +[ + { + "timestamp": 1544741676, + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + } +] diff --git a/contracts/interfaces/CHANGELOG.md b/contracts/interfaces/CHANGELOG.md new file mode 100644 index 000000000..716353d05 --- /dev/null +++ b/contracts/interfaces/CHANGELOG.md @@ -0,0 +1,10 @@ + + +CHANGELOG + +## v1.0.2 - _December 13, 2018_ + + * Dependencies updated -- cgit v1.2.3 From 44e516ac65d4923cc83b0112c509317c6a6d87b6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:58:57 -0800 Subject: Publish - @0x/contracts-examples@1.0.2 - @0x/contracts-extensions@1.0.2 - @0x/contracts-interfaces@1.0.2 - @0x/contracts-libs@1.0.2 - @0x/contracts-multisig@1.0.2 - @0x/contracts-protocol@2.1.59 - @0x/contracts-tokens@1.0.2 - @0x/contracts-utils@1.0.2 --- contracts/interfaces/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index b7f8f0e2b..4d3e4b7f9 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-interfaces", - "version": "1.0.1", + "version": "1.0.2", "engines": { "node": ">=6.12" }, @@ -41,8 +41,8 @@ }, "dependencies": { "@0x/base-contract": "^3.0.10", - "@0x/contracts-libs": "^1.0.1", - "@0x/contracts-utils": "^1.0.1", + "@0x/contracts-libs": "^1.0.2", + "@0x/contracts-utils": "^1.0.2", "@0x/types": "^1.4.1", "@0x/typescript-typings": "^3.0.6", "@0x/utils": "^2.0.8", -- cgit v1.2.3 From abfb358250200f93323851bbb56120f7fdf15dc6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 19 Dec 2018 14:13:35 +0100 Subject: Add the sol-compiler watch command to all packages --- contracts/interfaces/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 4d3e4b7f9..15385a154 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -10,7 +10,8 @@ "build": "yarn pre_build && tsc -b", "build:ci": "yarn build", "pre_build": "run-s compile generate_contract_wrappers", - "compile": "sol-compiler --contracts-dir contracts", + "compile": "sol-compiler", + "watch": "sol-compiler -w", "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", -- cgit v1.2.3 From 9b521aeef5ed35b3e9d9926dac1da4d8a3648e50 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 20 Dec 2018 11:37:29 -0800 Subject: Unfix compiler version except for top level contracts --- contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol | 2 +- contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol | 2 +- contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol | 2 +- .../interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IExchange.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol | 2 +- .../interfaces/contracts/protocol/Exchange/ISignatureValidator.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IValidator.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IWallet.sol | 2 +- contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'contracts/interfaces') diff --git a/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol index e2da68919..a130e615f 100644 --- a/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetData.sol @@ -17,7 +17,7 @@ */ // solhint-disable -pragma solidity 0.4.24; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; diff --git a/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol index b25d2d75a..706412dd0 100644 --- a/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAssetProxy.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; import "./IAuthorizable.sol"; diff --git a/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol index 96ee05dee..202173998 100644 --- a/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol +++ b/contracts/interfaces/contracts/protocol/AssetProxy/IAuthorizable.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; import "@0x/contracts-utils/contracts/utils/Ownable/IOwnable.sol"; diff --git a/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol index 8db8d6f6c..b73881c07 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IAssetProxyDispatcher.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; contract IAssetProxyDispatcher { diff --git a/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol index b92abba04..866e4c194 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IExchange.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "./IExchangeCore.sol"; diff --git a/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol index 0da73529c..ab4a62408 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IExchangeCore.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; diff --git a/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol index b88e158c3..5df46ea80 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IMatchOrders.sol @@ -15,7 +15,7 @@ limitations under the License. */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; diff --git a/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol index 1fd0eccf0..c5a4a57e1 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/ISignatureValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; contract ISignatureValidator { diff --git a/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol index 4446c55ce..aaaee389f 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/ITransactions.sol @@ -15,7 +15,7 @@ limitations under the License. */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; contract ITransactions { diff --git a/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol index 2dd69100c..d214e54dd 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IValidator.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; contract IValidator { diff --git a/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol index c97161ca6..c2db4a5b1 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IWallet.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; contract IWallet { diff --git a/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol index 833bb7e88..0eeaa874b 100644 --- a/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol +++ b/contracts/interfaces/contracts/protocol/Exchange/IWrapperFunctions.sol @@ -16,7 +16,7 @@ */ -pragma solidity 0.4.24; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "@0x/contracts-libs/contracts/libs/LibOrder.sol"; -- cgit v1.2.3