The more people enter the treat array, the more gas it will cost. Resulting in a potential Denial of Service.
When the constructor needs to loop through the array it costs gas, the longer the array, the more gas it costs.
New users won't be able to enter the treat list.
Remove the Loop from the Constructor: Avoid using a loop in the constructor by initializing treats after deployment. This method will reduce deployment gas costs and prevent the risk of gas exhaustion.
Use a Batch Addition Function: Implement a function to add treats in batches after deployment. Instead of adding all treats at once in the constructor, create a function to add them in smaller chunks, which is less likely to hit gas limits.
Limit the Array Size on Deployment: If batch initialization or incremental addition is not desired, limit the maximum length of the treats array passed to the constructor. By keeping the array size small, you can avoid gas limit issues.
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.