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

Gift cost only 1 token

Vulnerability Details

SantaList.buyPresent call SantaToken.burn which burn 1 token instead of the 2 specified in the README and in the PURCHASED_PRESENT_COST variable.

Impact

The cost for a present is only 1 token.

Recommendations

Change the burn function in SantaToken contract to burn 2 tokens instead of one

function burn(address from) external {
if (msg.sender != i_santasList) {
revert SantaToken__NotSantasList();
}
_burn(from, 2e18);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years 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.