list() stores listings in s_listings[_tokenId] — keyed by tokenId — and all functions that interact with a listing (buy(), cancelListing(), collectUsdcFromSelling(), updatePrice()) expect a tokenId as their _listingId parameter.
The NFT_Dealers_Listed event emits listingsCounter as listingId, suggesting to off-chain integrators that the returned value is the key needed to interact with the listing. It is not — passing listingsCounter to any of the above functions will cause a revert or interact with the wrong listing.
Likelihood:
Every single list() call emits the wrong ID — this is not conditional, it happens 100% of the time without exception.
Any off-chain integrator, frontend, or user that reads the NFT_Dealers_Listed event and uses the emitted listingId to call buy(), cancelListing(), or updatePrice() will pass the wrong ID.
Impact:
Calls to buy(), cancelListing(), collectUsdcFromSelling(), and updatePrice() revert with ListingNotActive when using the emitted listingId.
Users and integrators have no way to discover the correct key (tokenId) from the event alone, making the protocol difficult to integrate correctly.
Alice lists tokenId 3. s_listings[3] is created. Event emits listingId = 1.
Bob reads the event, sees listingId = 1, and calls buy(1).
s_listings[1] does not exist — transaction reverts with ListingNotActive(1).
Bob must know to call buy(3) (tokenId) instead, which is not communicated anywhere.
Either index s_listings by a dedicated counter and use that as the key across all functions, or fix the event to emit tokenId instead of listingsCounter:
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.