diff --git a/contracts/LoopringProtocol.sol b/contracts/LoopringProtocol.sol index dc931a02..96997de9 100644 --- a/contracts/LoopringProtocol.sol +++ b/contracts/LoopringProtocol.sol @@ -85,7 +85,7 @@ contract LoopringProtocol { function cancelAllOrdersByTradingPair( address token1, address token2, - uint cutoff + uint cutoff ) external; @@ -116,7 +116,7 @@ contract LoopringProtocol { function submitRing( address[5][] addressesList, uint[6][] valuesList, - uint8[] optionList, + uint8[] optionList, bytes[] sigList, address miner, uint8 feeSelections diff --git a/contracts/LoopringProtocolImpl.sol b/contracts/LoopringProtocolImpl.sol index 92c87a13..0c41e9ae 100644 --- a/contracts/LoopringProtocolImpl.sol +++ b/contracts/LoopringProtocolImpl.sol @@ -600,6 +600,7 @@ contract LoopringProtocolImpl is LoopringProtocol { order.amountS < availableAmountS ? order.amountS : availableAmountS ); + require(order.fillAmountS > 0, "fillAmountS is 0"); } } } @@ -842,6 +843,7 @@ contract LoopringProtocolImpl is LoopringProtocol { order.fillAmountS = fillAmountB.mul( order.rateS ) / order.rateB; + require(order.fillAmountS > 0, "fillAmountS is 0"); newSmallestIdx = i; } diff --git a/contracts/TokenTransferDelegateImpl.sol b/contracts/TokenTransferDelegateImpl.sol index 583c5360..1d6c7782 100644 --- a/contracts/TokenTransferDelegateImpl.sol +++ b/contracts/TokenTransferDelegateImpl.sol @@ -195,14 +195,16 @@ contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { // Here batch[i + 4] has been checked not to be 0. if (owner != prevOwner) { amount = uint(batch[i + 4]); - require( - ERC20(token).transferFrom( - owner, - prevOwner, - amount - ), - "token transfer failure" - ); + if (amount > 0) { + require( + ERC20(token).transferFrom( + owner, + prevOwner, + amount + ), + "token transfer failure" + ); + } if (tracker != 0x0) { require(