Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions contracts/lib/OrderCombiner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
availableOrders[i] = true;

// Retrieve the order parameters.
OrderParameters memory parameters = (advancedOrder.parameters);
OrderParameters memory parameters = advancedOrder.parameters;

{
// Retrieve offer items.
Expand Down Expand Up @@ -860,26 +860,11 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
}
}
}

// Trigger any accumulated transfers via call to the conduit.
_triggerIfArmed(accumulator);

// If any restricted or contract orders are present in the group of
// orders being fulfilled, perform any validateOrder or ratifyOrder
// calls after all executions and related transfers are complete.
if (containsNonOpen) {
// Iterate over each order a second time.
for (uint256 i = 0; i < totalOrders; ++i) {
// Check restricted orders and contract orders.
_assertRestrictedAdvancedOrderValidity(
advancedOrders[i],
orderHashes,
orderHashes[i]
);
}
}
}

// Trigger any accumulated transfers via call to the conduit.
_triggerIfArmed(accumulator);

// Determine whether any native token balance remains.
uint256 remainingNativeTokenBalance;
assembly {
Expand All @@ -894,6 +879,26 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
);
}

// If any restricted or contract orders are present in the group of
// orders being fulfilled, perform any validateOrder or ratifyOrder
// calls after all executions and related transfers are complete.
if (containsNonOpen) {
// Iterate over each order a second time.
for (uint256 i = 0; i < totalOrders; ) {
// Check restricted orders and contract orders.
_assertRestrictedAdvancedOrderValidity(
advancedOrders[i],
orderHashes,
orderHashes[i]
);

// Skip overflow checks as for loop is indexed starting at zero.
unchecked {
++i;
}
}
}

// Clear the reentrancy guard.
_clearReentrancyGuard();

Expand Down