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

PURCHASED_PRESENT_COST mismatch with amount burned in buyPresent function

Summary

PURCHASED_PRESENT_COST equals 2e18, but it is not used in buyPresent function, where only 1e18 token is burned

Vulnerability Details

buyPresent function burned token amount is less than specified in PURCHASED_PRESENT_COST constant, and that constant is never used.

Impact

buyPresent function burned token amount is less than specified

Tools Used

Foundry

Recommendations

add a burn function in SantaToken to burn arbitrary amount, and pass in PURCHASED_PRESENT_COST amount to it.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other
Ryan Submitter
over 1 year ago
equious Auditor
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Price is not enforced in buyPresent

This line indicates that the intended cost of presents for naughty people should be 2e18: https://github.com/Cyfrin/2023-11-Santas-List/blob/6627a6387adab89ae2ba2e82b38296723261c08a/src/SantasList.sol#L87 PURCHASE_PRESENT_COST should be implemented to enforce the cost of presents.

Support

FAQs

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