The addTreat()
function does not check if a treat with the same name already exists, potentially leading to unintended overwriting of treat data.
Function: addTreat()
Code Reference:
There is no validation to check if a treat with the same name is already present, which could lead to overwriting data.
Overwriting treats can cause operational issues and confusion for users if existing treats are accidentally replaced.
Manual Code Review
Add a check to prevent duplicate treat names:
This ensures that no treat can be overwritten accidentally.
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.