Description: The VotingBooth::_distributeRewards
function always distribute the rewarding fees by dividing the funding by all voters count, which leads to money losing forever if at least one "against" voter has voted. The more "against" voters vote and the bigger funding is, the more money will be lost in case "for" voters win. It could be not a problem if the creator could withdraw the money, but there no such a function in the contract. In case "for" voters expect to receive all funding, their expectations will be wrong as well.
Impact: Creator can unintentionally lose his/her money
Proof of Concept:
If "against" and "for" voters vote, and "for" voters win, the creator will lose part of the money stuck in the contract forever.
Place the following into VotingBoothTest.t.sol
Recommended Mitigation: There are two alternatives.
If the creator is 100% trusted, the withdraw
function with only creator access can be created so that the creator could take back all money from contract after the voting was closed. But it is still not recommended, because there is always a threat of the creator being compromised.
Distribute all funding among the "for" voters.
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.