Skip to content

fix: separate the order index from the identifier in ERC721 aggregate keys - #1051

Closed
Ocheretovich wants to merge 1 commit into
ProjectOpenSea:mainfrom
Ocheretovich:fix/erc721-aggregate-key-collision
Closed

Ocheretovich wants to merge 1 commit into
ProjectOpenSea:mainfrom
Ocheretovich:fix/erc721-aggregate-key-collision

Conversation

@Ocheretovich

@Ocheretovich Ocheretovich commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #932 (issue #926).

When building fulfillment groups, ERC721 keys get orderIndex-itemIndex appended right after the token id, with no separator. So two different NFTs can produce the same key: id 1 in order 11 and id 11 in order 1 both become ...-111-0, and end up in one group.

The fix adds a - before the index (two places in fulfill.ts).

Tests: a new spec covers the offer and consideration sides. Both cases fail on main and pass with the fix. Lint and fulfill-utils.spec.ts are green.

Checked at the fulfillment-generation level only; I did not run an on-chain fulfill with such a batch.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (f618d19) to head (86720b4).
⚠️ Report is 425 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
+ Coverage   98.27%   99.14%   +0.86%     
==========================================
  Files          35       58      +23     
  Lines       14526    21279    +6753     
  Branches      660     1215     +555     
==========================================
+ Hits        14276    21096    +6820     
+ Misses        245      175      -70     
- Partials        5        8       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ryanio

ryanio commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Ocheretovich, good catch. Both new cases fail with the separator reverted. For the record: the collision needs at least 11 orders from the same offerer and collection in one fulfillOrders call, with ids that concatenate identically with an order index, so it is narrow, but the fix is clearly right.

Five PRs touched overlapping files this week, so this was stacked in #1058 with your commit unchanged, and it shipped in v4.5.0. Closing in favor of #1058.

@ryanio ryanio closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants