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

Registration cancellation reverts with inappropriate error.

Summary

Registration cancellation reverts with inappropriate error which could lead to incorrect logs.

Vulnerability Details

The method ThePredicter::cancelRegistration is responsible for canceling user registration and for emitting error if that is not appliable. However, the emitted error is ThePredicter__NotEligibleForWithdraw which does not match the reason for it.

Impact

Emitting inappropriate error when canceling registration leads to incorrect logs.

Tools Used

Manual review

Recommendations

Emit another error in the method ThePredicter::cancelRegistration:

error ThePredicter__PredictionsAreClosed();
error ThePredicter__UnauthorizedAccess();
+ error ThePredicter__NotEligibleForRegistrationCancellation();
function cancelRegistration() public {
if (playersStatus[msg.sender] == Status.Pending) {
(bool success, ) = msg.sender.call{value: entranceFee}("");
require(success, "Failed to withdraw");
playersStatus[msg.sender] = Status.Canceled;
return;
}
- revert ThePredicter__NotEligibleForWithdraw();
+ revert ThePredicter__NotEligibleForRegistrationCancellation();
}
Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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