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

[L-2] Approved player can register twice

Relevant GitHub Links

https://github.com/Cyfrin/2024-07-the-predicter/blob/839bfa56fe0066e7f5610197a6b670c26a4c0879/src/ThePredicter.sol#L55

Summary

lack of validation for approved players at the moment of the registration.

Vulnerability Details

A player with approved status by error can call the ThePredicter::register() function again, pay the the fees and have pending status again.

Recommendations

+ if (playersStatus[msg.sender] == Status.Approved) {
+ revert ThePredicter__PlayerIsAlreadyApproved();
+ }
if (playersStatus[msg.sender] == Status.Pending) {
revert ThePredicter__CannotParticipateTwice();
}

Impact

While the likelihood is high because it can happen to every approved player, the impact on the contract's functionality is low. The main issue lies in the user experience.

Tools Used

Manual review

Updates

Lead Judging Commences

NightHawK Lead Judge 12 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.