MyCut

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

[Fund Contest] A contest can be funded even if it not exists.

Summary

When we want to fund a fund a contest we are not checking the existence of the contest.

Vulnerability Details

[FAIL. Reason: panic: array out-of-bounds access (0x32)]. If we integrate in a future fundContest with others functions if this piece of code fails then all transaction before this call won't revert, making lost fund, gas and hackers can exploit this to have the contract in a not desire state.

function fundContest(uint256 index) public onlyOwner {
Pot pot = Pot(contests[index]);

Impact

Not desire contract state.

Tools Used

foundry.

Recommendations

Validate contest exists.

function fundContest(uint256 index) public onlyOwner {
require(index < contests.length, "Contest not defined");
Pot pot = Pot(contests[index]);
Updates

Lead Judging Commences

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

Support

FAQs

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