fundContest(uint256 index) is designed to transfer tokens to the pot at position index in the contests array. Contest addresses are stored sequentially by creation order and referenced by position.
There is no bounds check on index. An out-of-range value triggers a Solidity array out-of-bounds panic (0x32) rather than a descriptive custom error. More critically, a valid but incorrect index silently funds the wrong pot — a particularly hazardous failure mode given that the owner calling this function likely intends to fund a specific newly-created contest.
Likelihood:
The onlyOwner restriction limits the attack surface to configuration mistakes rather than adversarial misuse. Off-by-one errors in contest index selection are common when managing multiple contests from scripts or UIs.
There is no double-funding protection — calling fundContest twice with the same index silently over-funds the pot.
Impact:
Out-of-range index: generic panic revert with no information about what went wrong.
Valid-but-wrong index: a different pot receives the tokens intended for the new contest. The misrouted tokens are not automatically recoverable, and the intended pot remains unfunded while appearing deployed.
Place this test in test/ and run forge test --match-test testOutOfRangeIndexPanicsWithNoCustomError. The test demonstrates that passing an out-of-range index to fundContest() triggers a generic array-out-of-bounds panic rather than a descriptive custom error, giving callers no actionable revert reason.
Add an explicit bounds check require(index < contests.length, ContestManager__InvalidIndex()) before the array access so callers receive a meaningful revert message on invalid input.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.