SNARKeling Treasure Hunt

First Flight #59
Beginner FriendlyGameFiFoundry
100 EXP
Submission Details
Impact: low
Likelihood: low

Unused Variable Warning in Circuit

Author Revealed upon completion

Root + Impact

Description

  • The withdraw() function emits a Withdrawn event, but there's no check or event indicating WHICH treasures were claimed when withdrawing remaining funds. More critically, if claimsCount >= MAX_TREASURES but some treasures weren't actually claimed (due to the bug #3), the owner could withdraw funds that should have been available for legitimate claimants.

// file: main.br
// Noir enforces constraints on the public inputs,
// so we don't need an explicit check for recipient format here.
// The "unused variable" warning should be ignored.

Risk

Likelihood:

  • Reason 1

  • Reason 2

Impact:

  • Impact 1: While the comment says this is intentional, having an unused public input is confusing

  • Impact 2: The recipient binding relies on it being part of the public inputs that get verified, but there's no explicit constraint showing this relationship.

Proof of Concept

Recommended Mitigation

Add an explicit constraint or documentation clarifying how the recipient provides replay protection.

- remove this code
+ add this code

Support

FAQs

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

Give us feedback!