Santa's List

AI First Flight #3
Beginner FriendlyFoundry
EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Unused `Status::NOT_CHECKED_TWICE` Enum Value and `PURCHASED_PRESENT_COST` Constant

Unused Status::NOT_CHECKED_TWICE Enum Value and PURCHASED_PRESENT_COST Constant

Description

  • The contract defines the following enum:

enum Status {
NICE,
EXTRA_NICE,
NAUGHTY,
@> NOT_CHECKED_TWICE
}

and the following constant:

// The cost of santa tokens for naughty people to buy presents
@> uint256 public constant PURCHASED_PRESENT_COST = 2e18;

However, neither Status::NOT_CHECKED_TWICE nor PURCHASED_PRESENT_COST is used anywhere in the contract's logic.

The presence of these unused definitions suggests that functionality related to handling users who have not been checked twice and charging 2e18 SantaTokens for presents purchased by NAUGHTY users may have been intended but is not implemented.

Risk

Impact:

  • This does not directly introduce a security vulnerability. However, unused definitions can indicate incomplete or missing protocol functionality and may cause the implementation to deviate from the intended business logic.

Proof of Concept

The following definitions exist in the contract but have no references in the contract logic:

enum Status {
NICE,
EXTRA_NICE,
NAUGHTY,
NOT_CHECKED_TWICE
}
// The cost of santa tokens for naughty people to buy presents
uint256 public constant PURCHASED_PRESENT_COST = 2e18;

Recommended Mitigation

  • If these definitions are part of the intended protocol design, implement the corresponding logic so that they affect the relevant status checks and present-purchasing behavior.

  • If they are not required by the final protocol design, remove the unused enum value and constant to avoid misleading developers and auditors about functionality that does not actually exist.

enum Status {
NICE,
EXTRA_NICE,
NAUGHTY,
- NOT_CHECKED_TWICE
}
// The cost of santa tokens for naughty people to buy presents
uint256 public constant PURCHASED_PRESENT_COST = 2e18; //implement the corresponding logic in `SantaList::buyPresent`
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 4 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!