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

User fight with their own self

Summary

Their is no guarantee that a defender would go on battle with a challenger that is not their own self

Vulnerability Details

Their is no guarantee that a defender would go on battle with a challenger that is not their own self

Impact

No direct harm to the protocol but this shouldn't be the case.

Tools Used

Manual Review

Recommendations

Add a check.

function goOnStageOrBattle(uint256 _tokenId, uint256 _credBet) external {
if (defender == address(0)) {
defender = msg.sender;
defenderBet = _credBet;
defenderTokenId = _tokenId;
emit OnStage(msg.sender, _tokenId, _credBet);
oneShotNft.transferFrom(msg.sender, address(this), _tokenId);
credToken.transferFrom(msg.sender, address(this), _credBet);
} else {
// credToken.transferFrom(msg.sender, address(this), _credBet);
+ if (msg.sender == defender){
+ revert RapBattle__CanFightYourOwnSelf();
}
_battle(_tokenId, _credBet);
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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