Skip to content

Commit

Permalink
Check if native offers were invalid after the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
d1ll0n committed Jun 8, 2022
1 parent 9257c85 commit 6a7e070
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/lib/OrderCombiner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
mstore(orderHashes, 0)
}
bool nonMatchFn;
bool anyInvalidNativeOffers;
bool anyNativeOfferItems;
assembly {
// Add a boolean to the stack indicating if we are in a function
// that is not matchAdvancedOrders or matchOrders.
Expand Down Expand Up @@ -276,9 +276,9 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
assembly {
// If the offer item is for the native token and we are not
// in a match function, it is invalid.
anyInvalidNativeOffers := or(
anyInvalidNativeOffers,
and(nonMatchFn, iszero(mload(offerItem)))
anyNativeOfferItems := or(
anyNativeOfferItems,
iszero(mload(offerItem))
)
}

Expand Down Expand Up @@ -391,7 +391,7 @@ contract OrderCombiner is OrderFulfiller, FulfillmentApplier {
}
}

if (anyInvalidNativeOffers) {
if (anyNativeOfferItems && nonMatchFn) {
revert InvalidNativeOfferItem();
}

Expand Down

0 comments on commit 6a7e070

Please sign in to comment.