Several functions accept token IDs without validating they exist in the system, which could lead to unexpected behavior or wasted gas. Functions like read_stats()
, skill_of()
, and balance_of()
don't verify token existence before attempting to access them.
This lack of validation could result in runtime errors or wasted computation on non-existent tokens.
Likelihood:
Users could query non-existent tokens
Wasted gas on invalid operations
Potential runtime errors
Impact:
Wasted computational resources
Poor user experience
Potential system confusion
This PoC demonstrates the lack of validation:
The mitigation adds proper input validation:
This validation prevents operations on non-existent tokens and improves error handling.
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.
The contest is complete and the rewards are being distributed.