Incorrect Calculations in buyPresent function, the contract will be burn 1e18 and not 2e18.
This vulnerability leads to users buy NFTS at a cheaper price because in the
function burn(address from) external {
if (msg.sender != i_santasList) {
revert SantaToken__NotSantasList();
}
_burn(from, 1e18);
}
It automatically burns 1e18 and not 2e18 without taking into consideration PURCHASED_PRESENT_COST variable
High
Manual Analysis
In the burn function we need to change this line _burn(from, 1e18)
to _burn(from, 2e18); we can delete the PURCHASED_PRESENT_COST because this value is hard coded in the contract
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.