The getUserMemorabiliaDetailed() function uses unbounded nested loops to iterate through all possible collection and item combinations. As the number of collections and items per collection grows, the gas cost increases quadratically, eventually exceeding block gas limits and causing all calls to revert.
The function performs two identical nested loops (once for counting, once for populating arrays), doubling the gas consumption. Additionally, it incorrectly starts the outer loop at cId = 1 when memorabilia collections start at nextCollectionId = 100, wasting gas on non-existent collections.
Likelihood:
Gas costs increase quadratically as collections × items_per_collection
Function becomes unusable once there are moderate numbers of collections and items
Block gas limit will eventually be exceeded for any realistic festival usage
Issue occurs deterministically as the protocol scales
Impact:
Users cannot query their memorabilia holdings, breaking core functionality
Frontend applications cannot display user collections, degrading user experience
Function permanently fails once collections/items exceed gas threshold
No workaround available for affected users
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.