The buyPresent
function presents 2 issues:
It incorrectly burns tokens from the presentReceiver
account instead of the msg.sender
account.
The person's status is not checked when calling buyPresent()
, therefore the cost of buying a present is the same for any person regardless of his status.
Copy paste the following function inside SantasListTest.t.sol
Any user can burn tokens from another user's balance without their consent.
Addresses with NAUGHTY
status can buy presents for a normal price
Manual review
Burn msg.sender
tokens and mint a present for presentReceiver
Check buyPresent()
caller status
Add an uint256 amount
argument to SantaToken::burn()
function
SantasList.sol
SantaToken.sol
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.