The getTreats()
function returns the entire treatNames[]
array, which can become inefficient as the array grows in size.
Function: getTreats()
Code Reference:
As the number of treats grows, retrieving the entire array in a single call will increase gas usage significantly, making it impractical for users.
As the list of treats grows, gas costs for this function could become prohibitive, affecting the usability of the contract.
Manual Code Review
Implement pagination for retrieving treat names:
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.