MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Contest Address Existence Check Missing

Summary

The closeContest function in the ContestManager contract does not verify whether the provided contest address exists in the contests before attempting to close the contest. This can lead to potential issues if an invalid or non-existent contest address is provided.

Vulnerability Details

The closeContest function is implemented as follows:

function closeContest(address contest) public onlyOwner {
_closeContest(contest);
}

There is no validation to check if the contest address is part of the contests array or if it has any associated rewards. As a result, the _closeContest function may be called with an invalid address, leading to potential errors or unintended behavior.

Impact

  • Calling _closeContest with a non-existent contest address may cause errors or fail silently if the address is not valid or does not exist in the contests array.

  • If the address does not correspond to a valid contest, it could lead to unintended consequences or mismanagement of rewards.

Tools Used

Manual Code Review

Recommendations

Ensure the closeContest function verifies that the provided contest address either exists in the contests array or has a non-zero value in contestToTotalRewards.

Updates

Lead Judging Commences

equious Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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