The addTreat function does not verify whether a treat with the same name already exists. This can lead to duplicate entries in the treatNames array if the owner attempts to add a treat with an existing name. Additionally, this would update the metadataURI of the treat for future tokens, creating potential inconsistencies in treat metadata.
Allowing duplicate treat names in treatNames could lead to data inconsistency, user confusion and gas-inefficiency, as it may appear that multiple treats with the same name are distinct, when they are not, they are actually the same treat.
Add a check to ensure that a treat with the specified _name does not already exist before adding it:
This check ensures treats are unique by name and prevents unexpected updates to metadata.
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.