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

no guaranteed spot for the 16 players in the players array and replacing "approved" players is not possible

Summary

Thers is no guaranteed spot for the 16 players in the players array and If a player losses interest in the protocol before the tornament starts, there is no way to remove him and replace him with another user

Vulnerability Details

Since the protocol does not have a fundtion that replaces players, it is impossible to switch player for another player. Another event is, if the organizer mistakenly approve more than 14 strangers, it means the 16 supposed whitelisted accounts will not all be added to the 30 players array.

Impact

  • whitelisted accounts may lose spot on the players array if the `organizer mistakenly add more than 14 starngers

Tools Used

  • manual review

Recommendations

  • In the constructor of ThePlayer.sol fill the players array first with the 16 whitelisted accounts

+ address[16] whitelist = [0xa1,0xa2,0xa1,0xa2,0xa1,0xa2,0xa1,0xa2,0xa1,0xa2,0xa1,0xa2,0xa1,0xa2,0xa1,0xa2];//including the organizer address
constructor(
address _scoreBoard,
uint256 _entranceFee,
uint256 _predictionFee
) {
organizer = msg.sender;
scoreBoard = ScoreBoard(_scoreBoard);
entranceFee = _entranceFee;
predictionFee = _predictionFee;
+ for(uint8 i = 0; i< whitelist.length; ++i){
+ players.push(whitelist[i]);
+ }
}
Updates

Lead Judging Commences

NightHawK Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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