Normal behavior: The constructor of Pot should only accept arrays of equal length for players and rewards. Each player must have exactly one corresponding reward.
Issue: There is no validation in the constructor to enforce players.length == rewards.length. If mismatched arrays are passed, the constructor can panic due to array out-of-bounds access or arithmetic underflow, causing deployment to fail entirely.
Deployment should succeed only when players.length == rewards.length.
Each player is correctly mapped to a single reward.
Mismatched arrays should revert gracefully with a clear error message.
Deployment panics when players.length != rewards.length.
Panic occurs due to low-level Solidity array operations failing (out-of-bounds access).
The contract cannot be deployed, blocking deployment scripts or automated pipelines.
Requires misconfiguration or human error during deployment (e.g., manual array construction or faulty script).
Deployment failure is critical: the contract cannot be used, breaking the intended functionality.
Any automation relying on successful deployment (scripts, CI/CD, other contracts) will fail.
While the occurrence is unlikely, the impact is immediate and deployment-breaking.
This PoC demonstrates the bug exactly as it occurs in the wild using Foundry:
The test first shows a normal deployment with matching arrays succeeds.
It then attempts a mismatched deployment.
The constructor panics due to array index out-of-bounds, demonstrating the real-world impact: deployment failure.
This shows the bug is not just a logical mismatch — it’s deployment-blocking.
Add an explicit check in the constructor:
This prevents deployment with mismatched arrays.
Provides a clear, user-friendly revert message.
Eliminates panic-level errors caused by unguarded array access.
Why this works:
The constructor immediately validates the array lengths.
Any mismatch causes a revert with a descriptive error, preventing deployment failure.
Maintains mapping integrity: each player is guaranteed exactly one reward.
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.