MyCut

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

Admin can't close old Pots when the claim period has elapsed

Summary

The Admin/Owner is unable to close old Pots after the claim period has elapsed.

Vulnerability Details

Admin can't close old Pots when the claim period has elapsed because there's no implementation that handles removal of a contest from the contests array.

Impact

Old Pots remain accessible even after the Admin attempts to close them, which could lead to unintended interactions with expired contests.

Tools Used

Unit tests

Recommendations

Add this at ContestManager.sol:

function closeContest(address _contest) public onlyOwner {
_closeContest(_contest);
//+++
removeAddress(_contest);
}
//+++
function removeAddress(address toRemove) internal {
uint256 length = contests.length;
for (uint256 i = 0; i < length; i++) {
if (contests[i] == toRemove) {
contests[i] = contests[length - 1];
contests.pop();
return;
}
}
}
Updates

Lead Judging Commences

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