NAUGHTY users can buy a present for less than expected.
SantasList::buyPresent() allows anyone with SataTokens to purchase a present. NAUGHTY users should purchase a present at the price of 2e18 SantaToken. However, SantasList::buyPresent() method does not enforce this obligation.
Place the code for the following test function in test/unit/SantasListTest.t.sol.
In the terminal, run the following command:
forge test --mt test_BuyPresent_ForLessThanExpected
NAUGHTY users can buy a present for less than expected.
Manual review, Foundry
Check that whoever calls SantasList::buyPresent() or whoever receives the ERC721 SantasList token to be minted on that call is marked as NAUGHTY. In either case, 2e18 SantaTokens have been paid.
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.