The getUserMemorabiliaDetailed() view function performs two complete iterations through all collections (cId from 1 to nextCollectionId - 1) and all items (iId from 1 to collections[cId].currentItemId - 1), executing balanceOf(user, tokenId) for every item twice.
As the festival progresses and multiple collections with items are created, the nested loops will exceed Ethereum's transaction/block gas limit (30 million gas), causing this function to permanently revert for all users.
Likelihood:
Inevitable as more memorabilia collections and editions are minted.
Impact:
Permanent Denial of Service for frontend UIs and on-chain integrations querying user memorabilia details.
Index user token ownership via off-chain indexing (e.g. Subgraph / Envio indexer) or store a mapping mapping(address => uint256[]) private userTokenIds updated during mint/burn.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.