Due to the mistake in the rewards formula, a big part of ETH will be stuck in the contract forever.
This lines introduces the issue
uint256 totalVotes = totalVotesFor + totalVotesAgainst;
If a voting is approved, and there was some votes against it, they will be summed with the total for-votes, but rewards will be sent only to users who voted for. For example, the reward pool is 1 ETH, there is 5 voters total, 2 votes for, 1 against, 1 ETH will be divided by 3, BUT will be sent only to 2 voters for, leaving the 1/3 of total ETH stuck in the contract forever, as it can be used only once.
The issue is present in every scenario, where a voting is accepted and there's some votes against.
here's the test
You can see ETH left in the contract and that test passes, the contract's balance is not 0
foundry
I guess just deleting the votesAgainst from the formula would be enough.
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.