list() stores listings at s_listings[_tokenId] but emits listingsCounter as the listing ID. All other functions (buy, cancelListing, collectUsdcFromSelling, updatePrice) accept _listingId and read s_listings[_listingId].
Users who pass the emitted listingsCounter value access the wrong storage slot. After any cancel+relist, the emitted ID and tokenId diverge permanently.
Likelihood:
Every off-chain integration using emitted event data to call contract functions accesses the wrong listing
Impact:
buy(emittedId) either reverts or buys the wrong NFT. collectUsdcFromSelling(emittedId) fails or collects from wrong listing
After Alice cancels and relists tokenId=1, the event emits listingId=2 but the listing is stored at s_listings[1]. Bob's buy(2) reverts because s_listings[2] is empty.
Use listingsCounter as the storage key consistently, so the emitted ID matches what buy(), cancelListing(), and other functions expect.
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.