Cost to buy a present is 2e18 of SantaToken according to the documentation. but, Anyone can buy a present in exchange of 1e18 of SantaToken. because, buyPresent
function of SantasList
contract calls burn
function of SantaToken
contract with 1e18
instead of 2e18
.
Below test shows that if someone is extra nice and collect his present then he can buy a present in exchange of his 1e18 SantaTokens. But In the Documentation file, it is mentioned that to buy a present, one must burn his 2e18 of SantaTokens.
This is the terminal output
of the above test. It shows that the test is passed
but it should be failed
because someone can buy a present in exchange of 1e18 of SantaToken instead of 2e18.
This is the burn
function of SantaToken
contract.
Anyone can buy a present in exchange of 1e18 of SantaToken instead of 2e18 of SantaToken.
Manual Review
foundry
In the buyPresent
function of SantasList
contract, burn
function of SantaToken
contract should be called with PURCHASED_PRESENT_COST
(2e18).
In the burn
function of SantaToken
contract, we add an argument amount
in the function and also check that amount
should not be zero.
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.