the marketplace interface expects users to interact through listingId while listings are actually stored and resolved by tokenId, marketplace operations can execute against a different order than the one identified by the provided listing ID.
The intended behavior is that each new listing should receive a unique listingId, and that this identifier should be the one used by buy(), cancelListing(), updatePrice(), and collectUsdcFromSelling() to operate on that specific order.
The issue is that list() increments listingsCounter but does not use that value as the mapping key. Instead, it stores the listing in s_listings[_tokenId]. As a result, the protocol appears to work with listingId, but in practice it resolves orders by tokenId. This allows a purchase using _listingId to point to a different listing than the one the user believes they are executing.
Likelihood: High
The issue is structural and follows directly from how listings are stored and resolved.
It manifests whenever the order of listing creation does not match the tokenId values used as the internal storage keys.
Impact: Medium
Purchase and listing-management operations may no longer correspond to the listingId exposed by the protocol to users and integrators.
This can cause failed purchases or execution against a different listing than the one the user expected.
The following test shows that the first listing created is for tokenId 2, but buy(1) does not resolve that first listing. Instead, it resolves s_listings[1], which contains the listing for tokenId 1.
Listings should be stored using listingsCounter as the actual mapping key, and all marketplace functions should operate on that identifier. If the protocol intends to allow only one active listing per NFT, that restriction should be enforced separately without conflating tokenId with listingId.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.