The burn
function of SanataToken
is called by the SantasList
contract when someone want to spend their SantaTokens
to buy present for others ie. a SANTA
NFT. But according to documentation a SANTA
NFT costs 2**e18 SantaTokens
but the burn function only burns 1**e18 SantaTokens
which is called when buying an NFT.
The vulnerability lies in the burn
function of SantaToken
. It costs only half of specified SantaTokens to buy an SANTA NFT.
The _burn
function only burns 1e18 tokens for an NFT, which is half of specified amount (2e18 tokens) in the documentation.
The users can mint double the amount of NFT's with the SantaTokens as burn function only burn half of expected tokens for an NFT
Manual Review
Use 2e18
instead of 1e18
for the amount of tokens to burn.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.