The lack of withdraw
function locks the token in the contract forever.
Consider the following scenario, there is 5 allowed voters and the threshold of voters required to trigger the reward distribution is 3. Assume the reward is 1 ether and two of the voter votes for the proposal and the other one votes against, the reward for the two for-voter will be:
1st voter: 3333333333333333333 (wei)
2nd voter: 3333333333333333334 (wei)
and the voter votes against will not get any tokens as reward. In this case, there are 3333333333333333333 wei of ether remaining in the contract. However, there is no withdraw function that can take the token out of the contract.
Simple PoC:
Every voting result that totalVotesAgainst < totalVotesFor
but totalVotesFor != totalVotes
will have remaining tokens, and these tokens are unable to transfer to any address, thus locking in the contract.
Manual Review
At the end of the _distributeReward
funciton, send the remaining ether to the s_creator
or design a withdraw function.
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.