When someone lists an NFT, the listing data goes into s_listings[_tokenId]. But the NFT_Dealers_Listed event reports listingsCounter as the listing ID — a completely different number. Every function that reads or modifies a listing (buy, cancelListing, updatePrice, collectUsdcFromSelling) looks up s_listings[_listingId], so the ID in the event doesn't match where the data actually lives.
Any frontend or indexer that uses the event to build the listing ID will give users the wrong one. They'll call buy() with the wrong ID, either getting a revert or — worse — accidentally buying a different NFT.
Likelihood: Happens every time tokenId ≠ listingsCounter. If the 5th minted NFT is listed first, tokenId=5 but listingsCounter=1. The event says "1" but the data is at slot 5.
Impact: The marketplace is broken for real-world use. Users will either get reverts (wasting gas) or buy the wrong NFT at the wrong price — a direct loss of funds with no way to recover.
Alice mints NFTs #1, #2, #3.
She lists #3 first. listingsCounter = 1, data stored at s_listings[3]. Event says listing ID = 1.
Bob sees "listing 1" on the frontend, calls buy(1) — reverts because s_listings[1] is empty.
Later Alice lists #1. listingsCounter = 2, data at s_listings[1]. Event says ID = 2.
If Bob retries buy(1) thinking it's the original listing, he actually buys NFT #1 at a different price — not what he intended.
Emit _tokenId in the event instead of listingsCounter, so the event matches the actual storage 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.