SantasList::buyPresent
is vulnerable to front-running attacks.
SantasList::buyPresent
is vulnerable to front-running attacks furthermore, the function as is currently is misleading because, instead of minting the SantasList ERC721 token to the present receiver, and extracting the ERC20 SantaToken from the msg.sender
, it does the opposite. It rather bills the 1e18
SantaToken to the presentReceiver
and mints the SantasList ERC721 token to the msg.Sender
In the terminal run forge test --mt testFrontRunBuyPresent
A malicious user can buy a present on someone else's dime even if said someone else did not intend for the malicious user to be the recipient of the present.
Manual review
In SantasList::buyPresent
, we should burn the ERC20 SantaToken of the msg.sender
and mint the ERC721 SantasList token to the presentReceiver
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.