Incorrect Token Burning in buyPresent Function
The buyPresent
function currently invokes i_santaToken.burn(presentReceiver)
, leading to the unintended consequence of burning the tokens of the present receiver, rather than those of the buyer.
This misdirection results in the incorrect burning of tokens, where the recipient's tokens are depleted instead of the buyer's.
Foundry
Modify the buyPresent function to pass msg.sender as the parameter to the burn function. This adjustment will ensure that it's the buyer's tokens that are burned, aligning the action with the intended logic of the transaction.
Current implementation allows a malicious actor to burn someone else's tokens as the burn function doesn't actually check for approvals.
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.