NFT presents are bought at discount price
SantasList::buyPresent
is a function that allows any user to burn SantaTokens and mint NFT presents to a receiver address. The cost of the present should be 2 SANTA, represented in the constant PURCHASED_PRESENT_COST
. But, this constant is not used in the calculations. Instead, a fixed value of 1e18
is used in the SantaToken::burn
function. This will make the cost of buying the NFT present to by 1 SANTA instead of 2, a 50% discount in price.
Output:
HIGH, discounted present price.
Manual Review
Foundry
Either move the constant variable to the SantaToken
contract, so it burns 2e18 tokens instead of 1e18, or pass a parameter amount
to the SantaToken::burn
so it knows how many 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.