The contract contains a discrepancy in the cost calculation for purchasing presents. The intended cost is specified as 2e18, but the burn
function, which is responsible for deducting the cost from the user, is currently burning 1e18. This mismatch may allow users to exploit the contract and purchase presents at a lower cost than intended.
The vulnerability lies in the burn
function, which is used to deduct SantaTokens when a user purchases a present. The parameter passed to _burn
is inconsistent with the intended cost, leading to a mismatch between the intended cost and the actual deduction.
If exploited, users could purchase presents at a lower cost than intended, potentially disrupting the economic balance of the contract.
Manual Review
Update the burn
function's parameter in SantaToken
to match the intended cost (2e18).
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.