The constructor of the contract allows for initializing players and their corresponding rewards. However, there is no validation to ensure that the lengths of the `players` and `rewards` arrays are equal. This omission can lead to significant issues during the execution of the loop that maps players to their rewards.
If the `players` array and the `rewards` array have mismatched lengths:
If `players.length` is greater than `rewards.length`, the constructor will attempt to access an out-of-bounds index in the `rewards` array, potentially leading to a runtime error or undefined behavior.
If `rewards.length` is greater than `players.length`, some rewards will remain unallocated, leading to potential discrepancies in the intended reward distribution.Impact
Manual Review
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.