Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Ambiguous Use of `balanceOf` in collectPresent Function

Summary

The collectPresent function uses the balanceOf function without specifying the token or asset being checked for a balance. This ambiguity raises concerns about the intended balance check and may lead to unexpected behavior.

Vulnerability Details

The code checks balanceOf(msg.sender) > 0 without clarifying the type of balance being referred to. It is unclear what asset or token is being checked, and this lack of specificity can result in misinterpretation or unintended consequences.

if (balanceOf(msg.sender) > 0) {
revert SantasList__AlreadyCollected();
}

Impact

The ambiguous use of balanceOf in the collectPresent function may lead to confusion and potential vulnerabilities if the wrong balance is considered.

Tools Used

Manual code review

Recommendations

  1. Clearly specify the token or asset for which the balance is being checked using balanceOf.

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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