The createContest() function accepts players and rewards arrays but does not validate that they have the same length. This allows the owner to create a Pot with mismatched arrays, where players[i] may not have a corresponding rewards[i].
In the Pot constructor, the loop for (uint256 i = 0; i < i_players.length; i++) iterates over i_players.length and assigns playersToRewards[i_players[i]] = i_rewards[i]. If rewards.length < players.length, this will cause an out-of-bounds access and revert. If rewards.length > players.length, some rewards are ignored.
Likelihood: High - The owner may accidentally pass mismatched arrays; no validation exists.
Impact:
If rewards.length < players.length: Pot creation will revert (index out of bounds)
If rewards.length > players.length: Some rewards are ignored, and the totalRewards may not match sum of rewards
Economic invariants broken: rewards distribution may not match expected behavior
This POC demonstrates that passing mismatched array lengths to createContest() causes the Pot constructor to revert (if rewards is shorter than players) or ignore some rewards (if rewards is longer).
Adding validation ensures that the players and rewards arrays have the same length before creating the Pot, preventing out-of-bounds access or ignored rewards.
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.