In the ContestManager::createContest
function, there is no validation to ensure that the sum of the rewards
array matches the totalRewards
value provided. This can result in a situation where the total rewards are either insufficient or exceed the intended distribution, potentially leading to users being unable to withdraw their rewards or funds being locked in the contract.
Users might be unable to withdraw their rewards if the total funds do not match the promised rewards, or conversely, excess funds might be locked in the contract without a mechanism for retrieval.
Manual review.
We can attempt to deploy a Pot with incorrect values and see if the attempt is successful, in TestMyCut.t.sol
add the test:
Then run:
rewards
is an array with the values [3, 1], the correct sum of these values would be 4 but a different number, 50 in this case, doesn't cause a revert.
Introduce a check that verifies the sum of the rewards
array equals totalRewards
before deploying the Pot
contract, for instance:
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.