No proper array validity check for contract Pot constructor arguments players and rewards array could cause the Pot:playersToRewards fails to map out properly which any player who calls the Pot:claimCut will be reverted with Pot__RewardNotFound() error, making it useless as reward distribution protocol.
Contract Pot maps the players to rewards in its constructor. For this mapping, it depends on the constructor arguments array players and rewards. However, there is no array condition check currently to ensure these arrays are not zero length and their length size matches.
Proof of Concept:
In test/TestMyCut.t.sol, add the following test case:
Test run will pass indicating that empty array in the constructor arguments array Players and Rewards will eventually cause the protocol to revert with Pot__RewardNotFound when player calls the Pot:claimCut function.
Contract Pot fails to map out players to rewards and cause the protocol is not able to function as intended reward distribution protocol
Manual review
To include prerequisite check for the constructor argument players and rewards array in the Pot contract as demonstrated below :
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.