The getRemainingTreasures() view function calculates MAX_TREASURES - claimsCount without any protection against potential future logic where claimsCount could exceed MAX_TREASURES. While currently protected by the claim() function's AllTreasuresClaimed check, a view function should not rely on state transition invariants.
Likelihood:
Reason 1
Impact:
Future code changes could enable underflow
View functions should be safe under all conditions
Violates defensive programming principles
Add an explicit check or use a saturating subtraction:
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.