Improve input validation clarity.
The contract uses assert(ids.length > 0);
to ensure that the ids
array is not empty in _depositIntoEscrow
. While this prevents execution when the condition is not met, assert
is typically reserved for conditions that should never fail, such as internal logic errors. Using require
would provide more informative error messages and is more appropriate for validating inputs.
Less informative errors for users.
Replace assert(ids.length > 0);
with require(ids.length > 0, "No tokens provided");
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.