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

Missing balance check in `goOnStageOrBattle()`

Summary

goOnStageOrBattle() function in RapBattle contract allows users to go into battle with each other using their tokens as bets

Vulnerability Details

The function accepts 2 parameters and one of them is the amount of token to put into bet. But the function does not check if the user has enough tokens.

Impact

If the user has less tokens than his input parameter goOnStageOrBattle() function credToken.transferFrom(msg.sender, address(this), _credBet); will revert. It could be good to revert with an error at the begining of the function

Tools Used

Manual review

Recommendations

if (cred.balanceOf(msg.sender) < _credBet) revert NOT_ENOUGH_BALANCE;

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

missing check for sufficient `_credBet_` approval

Support

FAQs

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