normal Behavior: the getUserMemorabiliaDetailed()
function is supposed to return a detailed list of all memorabilia NFTs a specific user owns.
Issue: The function is completely non-functional. It contains incorrect loop logic and an unbounded loop structure that iterates through every NFT ever minted. This design guarantees that any call will fail by running out of gas once even a small number of items exist, making it a permanent Denial of Service vector.as the loop begins its search at ID 1 instead of the correct starting ID of 100, wasting gas on 99 useless iterations in every call.
Explain the specific issue or problem in one or more sentences
Likelihood: High
Reason : This will occur every time the function is called by a user or external service after a moderate number of memorabilia (e.g., a few hundred) have been minted across all collections.
Impact: High
Impact 1 :- Permanent Denial of Service, any off-chain application, such as the festival's website or a secondary marketplace, that relies on this function to display user assets will be permanently broken.
Impact 2:- Gas Wasting, any user or contract attempting to call this function will lose all gas provided for the transaction as it inevitably reverts, with no state change.
this test case show very high gas used in the checking 500 collectionId.
This test proves that the function wastes gas by looping 99 times unnecessarily before starting its actual work. It does this by measuring
for more gas efficiency MerkleProof can be used.
for 99 wasted iteration below changes can be made.
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.