MyCut

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

`ContestManager::_closeContest()` not required

Summary

ContestManager::closeContest() has only one line of code and that is calling ContestManager::_closeContest(). This is not required and moving the code of _closeContest to closeContest and removing the _closeContest function entirely would be better.

Vulnerability Details

LoC:
https://github.com/Cyfrin/2024-08-MyCut/blob/946231db0fe717039429a11706717be568d03b54/src/ContestManager.sol#L53-L60

Impact

Making the changes would reduce gas costs and make the code cleaner.

Tools Used

Manual Review

Recommendations

Make the following changes:

- function closeContest(address contest) public onlyOwner {
- _closeContest(contest);
- }
-
- function _closeContest(address contest) internal {
- Pot pot = Pot(contest);
- pot.closePot();
- }
+ function closeContest(address contest) internal {
+ Pot pot = Pot(contest);
+ pot.closePot();
+ }
Updates

Lead Judging Commences

equious 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.