In the Pot.sol
contract, the constructor takes two arrays, players and rewards, as inputs. These arrays are meant to map player addresses to corresponding reward amounts. However, the constructor does not validate that the length of the players array matches the length of the rewards array. This can lead to inconsistent state mapping between players and rewards, potentially causing unexpected behavior during reward distribution.
The lack of validation could result in:
Incorrect reward assignments leading to potential disputes.
Funds being locked in the contract or distributed incorrectly, causing financial losses.
Potential vulnerabilities due to the mismatch in array lengths, which may be exploited in specific scenarios.
The contract is created successfully even though the arrays are of unequal lengths, highlighting the lack of validation in the constructor.
add a check in the constructor to ensure that the players and rewards arrays are of equal length before proceeding with the assignment.
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.