list() uses _tokenId as the mapping key for s_listings but emits the auto-incremented listingsCounter in the NFT_Dealers_Listed event.
All other functions (buy, cancelListing, collectUsdcFromSelling, updatePrice) take a _listingId parameter and look up s_listings[_listingId]. When tokenId != listingsCounter, the listing ID from the event does not match the actual storage key.
Likelihood:
This occurs whenever NFTs are not listed in sequential tokenId order starting from 1 — for example if tokenId 5 is listed first, listingsCounter=1 but data is at s_listings[5]
Any frontend or integration reading the emitted event will get the wrong ID
Impact:
Buyers calling buy(listingId) using the event data will read an empty or wrong mapping slot, either reverting or purchasing a completely different NFT
cancelListing and updatePrice also fail for the same reason, locking seller's collateral
The marketplace is fundamentally broken for any non-sequential listing order
Use listingsCounter consistently as the mapping key:
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.