Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Invalid

A user can frontrun the opponent when the result dont favour them.

Summary

when lets say the defender wins the RapBattle a transaction will occur credToken.transfer(_defender, defenderBet); which the challenger will see "FrontRun". And can transfer The cred tokens to another address, before credToken.tranferFrom(msg.sender, _defender, _credBet) happens. and vice versa

Vulnerability Details

The protocol is susceptible to MEV attacks. where the defender can withdraw the cred token, before challenger is paid or vice versa.

Impact

Users can not receive their prize even when they win.

Recommendations

  1. Refactor the code add a function of collecting the credTokens in a vault and locking BEFORE winner is chosen, transferring the coins then oppening the vault again.

  2. You can use a private mempool such as FlashbotProtection.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.