NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Use of assert Instead of require

Summary

Improve input validation clarity.

Vulnerability Details

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.

Impact

Less informative errors for users.

Tools Used

Recommendations

Replace assert(ids.length > 0); with require(ids.length > 0, "No tokens provided");

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.