@@ -631,6 +631,16 @@ contract RaindexV6 is IRaindexV6, IMetaV1_2, ReentrancyGuard, Multicall, Raindex
631631 ClearStateChangeV2 memory clearStateChange =
632632 calculateClearStateChange (aliceOrderIOCalculation, bobOrderIOCalculation);
633633
634+ // Each side must be one `takeOrders4` would take.
635+ if (
636+ ! clearStateChange.aliceOutput.gt (LibDecimalFloat.FLOAT_ZERO)
637+ || ! clearStateChange.bobOutput.gt (LibDecimalFloat.FLOAT_ZERO)
638+ || aliceOrderIOCalculation.IORatio.lt (LibDecimalFloat.FLOAT_ZERO)
639+ || bobOrderIOCalculation.IORatio.lt (LibDecimalFloat.FLOAT_ZERO)
640+ ) {
641+ revert ClearZeroAmount ();
642+ }
643+
634644 Float aliceBounty = clearStateChange.aliceOutput.sub (clearStateChange.bobInput);
635645 Float bobBounty = clearStateChange.bobOutput.sub (clearStateChange.aliceInput);
636646
@@ -672,14 +682,6 @@ contract RaindexV6 is IRaindexV6, IMetaV1_2, ReentrancyGuard, Multicall, Raindex
672682
673683 handleIO (aliceOrderIOCalculation);
674684 handleIO (bobOrderIOCalculation);
675-
676- // Do this last so we don't swallow errors from the handle IO.
677- // Slither false positive. clearStateChange is a memory variable that
678- // cannot be modified by reentrancy, and clear3 is nonReentrant.
679- //slither-disable-next-line reentrancy-balance
680- if (clearStateChange.aliceOutput.isZero () && clearStateChange.bobOutput.isZero ()) {
681- revert ClearZeroAmount ();
682- }
683685 }
684686
685687 /// Main entrypoint into an order calculates the amount and IO ratio. Both
0 commit comments