Skip to content

fix: bulk orders use the passed account as offerer and reject signatures Seaport cannot parse - #1069

Merged
ryanio merged 3 commits into
mainfrom
claude/1793995363-bulk-order-offerer-and-signature-length
Nov 6, 2026
Merged

ryanio merged 3 commits into
mainfrom
claude/1793995363-bulk-order-offerer-and-signature-length

Conversation

@ryanio

@ryanio ryanio commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Two community PRs edit src/seaport.ts in createBulkOrders and signBulkOrder. This branch stacks them so they land and get checked together. The commits are cherry-picked unchanged, so each contributor keeps authorship of their own commits.

This supersedes #1068 and #1061. Both need closing once this merges, pointing at this PR. #1061 fixes #1060.

Solution

From #1068 by furkan3152, 1ca8001 and 00d01d1: createBulkOrders takes the accountAddress passed in as the offerer, the same as createOrder (accountAddress ?? await signer.getAddress()). Before, it always used the signer's address. With a signer that signs for a contract wallet, bulk orders came out with the signer as offerer, the signer's counter, and consideration defaulting to the signer. Line 258 was the only offerer resolution that differed. The fulfill paths use the signer's address on purpose, because the signer sends the transaction.

From #1061 by nftpoetrist, 771a194: signBulkOrder throws when the signature, after compaction, is not 64 or 65 bytes. Seaport only parses a bulk order signature as 64 or 65 bytes followed by the proof (_isValidBulkOrderSize in seaport-core Verifiers.sol). At any other length it checks the whole value against the single order digest, so a multi-owner wallet's 130 byte signature produced orders that can never fill. createBulkOrders signs through signBulkOrder, and a test covers that path. getMessageToSign only returns the payload, so no other path builds bulk orders from a signature. The PR adds a test contract, TestERC1271TwoOwnerWallet, and extends WrappedDigestSigner in a backward-compatible way.

The two changes interact: after #1068, a contract wallet can be the offerer of a bulk order. After #1061, that only succeeds when the wallet's signature is 64 or 65 bytes. The #1068 test uses the 65 byte TestERC1271WrappedWallet, which passes the #1061 check.

Verification

All of this ran on this branch, rebased on main at e635c29:

  • npm run build, then npm run lint (tsc and Biome): exit 0. The three Biome warnings (useMathMinMax in balance.ts and item.ts) are identical on main.
  • npm test: 303 passing.
  • Tripwire for fix: use accountAddress as the offerer in createBulkOrders #1068. With only the offerer line reverted, create-bulk-orders.spec.ts fails 1 test: AssertionError: expected '0x057Eb9…785f' to equal '0x2279B7…eBe6'. That is the signer's address where the wallet's was expected.
  • Tripwire for fix: reject a bulk order signature Seaport cannot read as one #1061. With only the length check removed, sign-order.spec.ts fails 3 tests: expected promise to be rejected with an error including 'Seaport only reads a 64 or 65 byte si…' but it was fulfilled with [ …(2) ].

Security direction: #1061 only adds a rejection. #1068 changes which account a bulk order commits. It now matches createOrder and the caller's stated account, instead of silently committing the signer's assets.

Semver: #1061 adds a throw on input that used to return, and #1068 changes the offerer for callers whose accountAddress differs from the signer. Both should ship in a minor, not a patch.

Merge order: #1063 touches only src/utils/fulfill.ts and its tests, so it can merge on its own before this PR.

Confidence: high. Both fixes are small, each test fails on its own assertion when its fix is reverted, and the full suite passes.

🤖 Generated with Claude Code

furkan3152 and others added 3 commits November 6, 2026 12:02
createOrder uses the account passed in as the offerer and only falls back
to the signer's address, but createBulkOrders always used the signer's
address. With a signer that signs for another account, bulk orders were
built and signed for the signer instead of that account.
Seaport reads a bulk order signature as 64 or 65 bytes followed by the
proof. At any other length it checks the whole value against the single
order's digest. A contract wallet with more than one owner returns a
longer signature (#323), so signBulkOrder and createBulkOrders returned
orders whose fill reverts in the wallet's isValidSignature, while the
same wallet's signature fills a single order.

Throw from signBulkOrder when the signature, after compaction, is not 64
or 65 bytes, and point to signOrder. Single orders are unchanged.
@ryanio
ryanio merged commit 330299e into main Nov 6, 2026
8 checks passed
@ryanio
ryanio deleted the claude/1793995363-bulk-order-offerer-and-signature-length branch November 6, 2026 20:20
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.

signBulkOrder returns unfillable orders for a contract wallet signature longer than 65 bytes

3 participants