createContest() passes players[] and rewards[] arrays directly to the Pot constructor without verifying they have equal lengths.
If rewards.length < players.length, the constructor loop will revert with an out-of-bounds index at i_rewards[i], wasting gas. If rewards.length > players.length, extra rewards are silently ignored but still counted in totalRewards, locking excess tokens permanently.
--- Risk ---
Likelihood:
The owner constructs arrays externally (frontend, script). A mismatch is a common mistake, especially when arrays are built dynamically.
No on-chain validation exists to catch this before deployment.
Impact:
If rewards is shorter: Pot deployment reverts, wasting gas but no state corruption.
If rewards is longer: Pot deploys successfully but extra reward values are not assigned to any player. The corresponding token amount is locked permanently in the Pot since remainingRewards includes the unassigned portion.
--- Proof of Concept ---
The following test creates a Pot with 2 players but 3 reward entries. The Pot deploys successfully, but the third reward (40 ether) is never assigned to any player. Those 40 ether are funded into the Pot but can never be claimed, permanently locking them.
--- Recommended Mitigation ---
Add an array length equality check in createContest() before passing the arrays to the Pot constructor. This prevents both the revert case (rewards shorter) and the silent fund lock case (rewards longer) at the earliest point possible.
createContest() passes players[] and rewards[] arrays directly to the Pot constructor without verifying they have equal lengths.
If rewards.length < players.length, the constructor loop will revert with an out-of-bounds index at i_rewards[i], wasting gas. If rewards.length > players.length, extra rewards are silently ignored but still counted in totalRewards, locking excess tokens permanently.
Likelihood:
The owner constructs arrays externally (frontend, script). A mismatch is a common mistake, especially when arrays are built dynamically.
No on-chain validation exists to catch this before deployment.
Impact:
If rewards is shorter: Pot deployment reverts, wasting gas but no state corruption.
If rewards is longer: Pot deploys successfully but extra reward values are not assigned to any player. The corresponding token amount is locked permanently in the Pot since remainingRewards includes the unassigned portion.
The following test creates a Pot with 2 players but 3 reward entries. The Pot deploys successfully, but the third reward (40 ether) is never assigned to any player. Those 40 ether are funded into the Pot but can never be claimed, permanently locking them.
Add an array length equality check in createContest() before passing the arrays to the Pot constructor. This prevents both the revert case (rewards shorter) and the silent fund lock case (rewards longer) at the earliest point possible.
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.