diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-08 13:57:09 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-07-08 13:57:09 +0800 |
commit | 8314bbbbac0101831bf8167c01e5ccf46663a2f0 (patch) | |
tree | ff6d2100884518336078c38a11312f096cda8ed4 /packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol | |
parent | 462f1f00d8151ad17f8909f2c07dbc807a0df87d (diff) | |
download | dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar.gz dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar.bz2 dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar.lz dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar.xz dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.tar.zst dexon-sol-tools-8314bbbbac0101831bf8167c01e5ccf46663a2f0.zip |
Add interfaces and mixins
Diffstat (limited to 'packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol b/packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol new file mode 100644 index 000000000..75c8e8c98 --- /dev/null +++ b/packages/contracts/src/2.0.0/forwarder/interfaces/IForwarderCore.sol @@ -0,0 +1,79 @@ +/* + + 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 "../../protocol/Exchange/libs/LibOrder.sol"; +import "../../protocol/Exchange/libs/LibFillResults.sol"; + + +contract IForwarderCore { + + /// @dev Market sells ETH for ERC20 tokens, performing fee abstraction if required. This does not support ERC721 tokens. This function is payable + /// and will convert all incoming ETH into WETH and perform the trade on behalf of the caller. + /// This function allows for a deduction of a proportion of incoming ETH sent to the feeRecipient. + /// The caller is sent all tokens from the operation. + /// If the purchased token amount does not meet an acceptable threshold then this function reverts. + /// @param orders An array of Order struct containing order specifications. + /// @param signatures An array of Proof that order has been created by maker. + /// @param feeOrders An array of Order struct containing order specifications for fees. + /// @param feeSignatures An array of Proof that order has been created by maker for the fee orders. + /// @param feeProportion A proportion deducted off the incoming ETH and sent to feeRecipient. The maximum value for this + /// is 1000, aka 10%. Supports up to 2 decimal places. I.e 0.59% is 59. + /// @param feeRecipient An address of the fee recipient whom receives feeProportion of ETH. + /// @return FillResults amounts filled and fees paid by maker and taker. + function marketSellEthForERC20( + LibOrder.Order[] memory orders, + bytes[] memory signatures, + LibOrder.Order[] memory feeOrders, + bytes[] memory feeSignatures, + uint16 feeProportion, + address feeRecipient + ) + public + payable + returns (LibFillResults.FillResults memory totalFillResults); + + /// @dev Buys the exact amount of assets (ERC20 and ERC721), performing fee abstraction if required. + /// All order assets must be of the same type. Deducts a proportional fee to fee recipient. + /// This function is payable and will convert all incoming ETH into WETH and perform the trade on behalf of the caller. + /// The caller is sent all assets from the fill of orders. This function will revert unless the requested amount of assets are purchased. + /// Any excess ETH sent will be returned to the caller + /// @param orders An array of Order struct containing order specifications. + /// @param signatures An array of Proof that order has been created by maker. + /// @param feeOrders An array of Order struct containing order specifications for fees. + /// @param makerTokenFillAmount The amount of maker asset to buy. + /// @param feeSignatures An array of Proof that order has been created by maker for the fee orders. + /// @param feeProportion A proportion deducted off the ETH spent and sent to feeRecipient. The maximum value for this + /// is 1000, aka 10%. Supports up to 2 decimal places. I.e 0.59% is 59. + /// @param feeRecipient An address of the fee recipient whom receives feeProportion of ETH. + /// @return FillResults amounts filled and fees paid by maker and taker. + function marketBuyTokensWithEth( + LibOrder.Order[] memory orders, + bytes[] memory signatures, + LibOrder.Order[] memory feeOrders, + bytes[] memory feeSignatures, + uint256 makerTokenFillAmount, + uint16 feeProportion, + address feeRecipient + ) + public + payable + returns (LibFillResults.FillResults memory totalFillResults); +}
\ No newline at end of file |