Root Cause: treatNames array can contain duplicates
Impact: Inflated array size and incorrect enumeration
https://github.com/Cyfrin/2024-10-trick-or-treat/blob/main/src/TrickOrTreat.sol#L37-L41
Every call to addTreat
pushes to treatNames
array without checking for duplicates:
Inflated array size and incorrect enumeration.
Add a mapping to keep track of particular treat name.
The function `addTreat` is called by the owner. The owner is trusted. There will be no duplicates.
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.