Pot::constructor assigns rewards according to place in Pot::i_players and Pot::i_rewardsPot::constructor uses a for loop to assign players' rewards to mapping Pot::playersToRewards, according to i's place in both Pot::i_players and Pot::i_rewards, which removes any element of a game. Additionally, this method requires that an equal number of players and rewards are given in the respective arrays.
Likelihood:
This is guaranteed to happen every time a contest is created.
Impact:
The impact is that the players are given rewards based on their placement within the array players passed to Pot::constructor and the placement of rewards in the array rewards passed to Pot::constructor.
This reduces any kind of game element to the contest. It is simply a convoluted way of distributing rewards to players whose rewards are already predetermined.
Below we use the testing suite with our test function TestMyCut::testRewardsAreAssignedToPlayers to verify that a player's reward is directly correlated with their placement within their players array and rewards array.
We see that the player at position 0, player1, has a reward that is the 0th element in rewards, and the player at position 1, player2, has a reward that is at position 1 in rewards.
The test function passes.
We recommend that a different way of distributing rewards to players be devised so that an element of a game is retained. We recommend deleting the for loop.
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.