Fix incorrect OrderSide in createCollectionOffer price validation#1913
Closed
Viktohblake wants to merge 3 commits intoProjectOpenSea:mainfrom
Closed
Fix incorrect OrderSide in createCollectionOffer price validation#1913Viktohblake wants to merge 3 commits intoProjectOpenSea:mainfrom
Viktohblake wants to merge 3 commits intoProjectOpenSea:mainfrom
Conversation
createCollectionOffer was passing OrderSide.LISTING to getPriceParametersCallback instead of OrderSide.OFFER. This bypassed the validation that prevents offers from using native ETH (which is invalid since offers require wrapped ERC-20 tokens for allowance-based approvals). Changed to OrderSide.OFFER to match the behavior of createOffer and createBulkOffers.
ryanio
added a commit
that referenced
this pull request
Feb 25, 2026
createCollectionOffer was passing OrderSide.LISTING to getPriceParametersCallback instead of OrderSide.OFFER, bypassing the validation that prevents offers from using native ETH. This aligns it with createOffer and createBulkOffers. Based on #1913 by @Viktohblake. Co-Authored-By: Claude Opus 4.6 <[email protected]>
2 tasks
Collaborator
|
Thanks for the contribution @Viktohblake! Great catch on the OrderSide bug. We've built on top of your fix in #1916 — same core change, just without the unrelated package-lock.json modifications. Closing in favor of that PR. |
ryanio
added a commit
that referenced
this pull request
Feb 25, 2026
) createCollectionOffer was passing OrderSide.LISTING to getPriceParametersCallback instead of OrderSide.OFFER, bypassing the validation that prevents offers from using native ETH. This aligns it with createOffer and createBulkOffers. Based on #1913 by @Viktohblake. Co-authored-by: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
createCollectionOfferinsrc/sdk/orders.tspassesOrderSide.LISTINGto the price parameters callback (_getPriceParameters) instead ofOrderSide.OFFER. This bypasses the validation that prevents offers from using native ETH:if (isEther && orderSide === OrderSide.OFFER) {
throw new Error("Offers must use wrapped ETH or an ERC-20 token.");
}
Seaport offers require ERC-20 token allowances; native ETH cannot be approved for spending by the Seaport contract. Both createOffer() and createBulkOffers() correctly pass OrderSide.OFFER, but createCollectionOffer() was incorrectly using OrderSide.LISTING, making it the only offer method that skips this check.
Solution
Changed OrderSide.LISTING to OrderSide.OFFER in createCollectionOffer's call to getPriceParametersCallback, aligning it with the other offer creation methods. This ensures native ETH is correctly rejected for collection offers, preventing invalid on-chain orders that would waste gas fees.