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

Non SantaTokens holders can call `buyPresent`, potentially resulting in negative balances & an unintended reduction in the total supply of SantaTokens

Summary

A critical vulnerability was identified in the SantsList::buyPresent function. The function allows burning tokens without properly checking whether the caller holds SantaTokens. This omission can lead to unintended consequences, including negative balances and a reduction in the total supply of SantaTokens.

Vulnerability Details

Function: burn(address from)

The buyPresent function allows unauthorized callers to burn tokens without verifying SantaTokens ownership, potentially leading to negative balances and a decrease in total supply.

Impact

The absence of a check for SantaTokens holders in the buyPresent function allows any address to call the function, potentially resulting in negative balances and an unintended reduction in the total supply of SantaTokens.

Tools used

  • Manual review

Recommendations

Add SantaTokens Holder Check:
Implement a check in the burn function to ensure that the caller (msg.sender) holds SantaTokens before allowing the burning process. This can be achieved by verifying the balance of SantaTokens for the specified address.

require(i_santaToken.balanceOf(msg.sender) > 0, "Caller does not have any SantaTokens");
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
0xtheblackpanther Submitter
over 1 year ago
0xtheblackpanther Submitter
over 1 year ago
inallhonesty Lead Judge
over 1 year ago
0xtheblackpanther Submitter
over 1 year ago
inallhonesty Lead Judge
over 1 year ago
0xtheblackpanther Submitter
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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