Skip to content

fix: include tips in the fulfiller's balance and approval checks - #962

Open
Dusk1e wants to merge 1 commit into
ProjectOpenSea:mainfrom
Dusk1e:fix/tips-balance-and-approval-checks
Open

fix: include tips in the fulfiller's balance and approval checks#962
Dusk1e wants to merge 1 commit into
ProjectOpenSea:mainfrom
Dusk1e:fix/tips-balance-and-approval-checks

Conversation

@Dusk1e

@Dusk1e Dusk1e commented Aug 16, 2026

Copy link
Copy Markdown

Problem

fulfillOrder and fulfillOrders build the fulfiller's balance and approval set from the order's own items only:

items: [...offer, ...consideration]

The checks that read that set sum tips in alongside the consideration. So a tip in a token the order does not already carry has no entry to look up, and findBalanceAndApproval throws before any transaction is built:

Checking for balance and approvals for token 0x0000000000000000000000000000000000000000 id 0 failed

That rules out a native tip on an ERC20 listing, a tip in a second ERC20, and NFT tips, all of which Seaport itself accepts. Tipping in the same token as the order works fine, which is why the existing tip coverage in partial-fulfill.spec.ts never hit this.

Fix

Include the mapped tip items in the fulfiller's lookup set in both entry points. They go on the end, after the order's items, so the offer and consideration criteria mapping in getItemToCriteriaMap is untouched.

It also makes the check do its job rather than just stop crashing: a tip in a token the fulfiller has not approved now produces its own approval action, which the fulfillment would revert without.

In fulfillOrders the per-order tip mapping is hoisted so it is built once and reused for both the lookup set and ordersMetadata, instead of mapped twice.

Test

test/tips.spec.ts covers both entry points. Both fail on main with the error above.

  • fulfillOrder with a second-ERC20 tip: asserts both approval actions appear, then fulfills and checks the NFT and the tip both land.
  • fulfillOrders with a native tip on an ERC20 listing: asserts the tip rides as msg.value, then fulfills and checks the recipient's balance moved.

Suite green at 174.

fulfillOrder and fulfillOrders collect the fulfiller's balances and
approvals from the order's offer and consideration items only, but the
checks that consume them sum tips in alongside the consideration. When a
tip names a token or identifier the order does not already carry, there
is no entry to look up and findBalanceAndApproval throws

  Checking for balance and approvals for token 0x... id 0 failed

before a transaction is ever built. That rules out ordinary tips: a
native ETH tip on an ERC20-denominated listing, a tip in a second ERC20,
or an NFT tip.

Include the mapped tip items in the fulfiller's lookup set so the tips
are actually checked rather than crashing the lookup. Tips are appended
after the order's items, so the criteria mapping the existing items rely
on is unchanged. This also means a tip in a token the fulfiller has not
approved now surfaces its own approval action, which the fulfillment
would otherwise revert without.
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.

1 participant