diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-20 23:01:18 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-07-23 23:02:51 +0800 |
commit | e20f3a0f97d3d2029aea24e761d4689e0382756f (patch) | |
tree | 4084f55e8d9cfc6e276efb1de274294da17f1eb4 /packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol | |
parent | c5029e61e3bd147d8b177b60da43e76a32e57c6f (diff) | |
download | dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar.gz dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar.bz2 dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar.lz dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar.xz dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.tar.zst dexon-sol-tools-e20f3a0f97d3d2029aea24e761d4689e0382756f.zip |
Remove redundant external call by reimplementing fillOrderNoThrow
Diffstat (limited to 'packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol b/packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol index 9dee15481..0f5cd9c66 100644 --- a/packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol +++ b/packages/contracts/src/2.0.0/forwarder/mixins/MForwarderCore.sol @@ -28,43 +28,15 @@ contract MForwarderCore is IForwarderCore { - /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. - /// @param wethSellAmount Desired amount of WETH to sell. - /// @param signatures Proofs that orders have been created by makers. - /// @return Amounts filled and fees paid by maker and taker. - function marketSellWeth( - LibOrder.Order[] memory orders, - uint256 wethSellAmount, - bytes[] memory signatures + /// @dev Ensures that all ZRX fees have been repurchased and no extra WETH owned by this contract has been sold. + /// @param orderFillResults Amounts filled and fees paid for primary orders. + /// @param feeOrderFillResults Amounts filled and fees paid for fee orders. + /// @param zrxBuyAmount The amount of ZRX that needed to be repurchased after filling primary orders. + function assertValidFillResults( + LibFillResults.FillResults memory orderFillResults, + LibFillResults.FillResults memory feeOrderFillResults, + uint256 zrxBuyAmount ) internal - returns (LibFillResults.FillResults memory fillResults); - - /// @param orders Array of order specifications used containing desired makerAsset and WETH as takerAsset. - /// @param makerAssetFillAmount Desired amount of makerAsset to buy. - /// @param signatures Proofs that orders have been created by makers. - /// @return Amounts filled and fees paid by maker and taker. - function marketBuyAsset( - LibOrder.Order[] memory orders, - uint256 makerAssetFillAmount, - bytes[] memory signatures - ) - internal - returns (LibFillResults.FillResults memory fillResults); - - /// @dev Buys zrxBuyAmount of ZRX fee tokens, taking into account ZRX fees for each order. This will guarantee - /// that at least zrxBuyAmount of ZRX is purchased (sometimes slightly over due to rounding issues). - /// It is possible that a request to buy 200 ZRX will require purchasing 202 ZRX - /// as 2 ZRX is required to purchase the 200 ZRX fee tokens. This guarantees at least 200 ZRX for future purchases. - /// @param orders Array of order specifications containing ZRX as makerAsset and WETH as takerAsset. - /// @param zrxBuyAmount Desired amount of ZRX to buy. - /// @param signatures Proofs that orders have been created by makers. - /// @return totalFillResults Amounts filled and fees paid by maker and taker. - function marketBuyZrx( - LibOrder.Order[] memory orders, - uint256 zrxBuyAmount, - bytes[] memory signatures - ) - internal - returns (LibFillResults.FillResults memory totalFillResults); + view; } |