It is possible for the organizer to obtain/get funds back within the distribute function itself and by calling either deploy proxy and distribute or use meta transaction to send the signature to someone else to deploy proxy and distribute, as there is no check that impedes the organizer to be included into the winners array.
According to “More Context” in README of Sparkn repo “If a contest is created and funded, there is no way to refund”. This categorization includes any percentage of the funds. But consider the following scenario:
1.- A new contest is set by the owner using setContest() function specifying all the pertinent parameters.
2.- The contest is funded by an organizer sending the corresponding ERC20 tokens.
3.- At this point, there are two possibilities for the sponsor (aka organizer) to get its funds back:
Since there is no check that ensures organizers cannot be included into the winners array (the only existing verification within this array is related to its length):
1.- If the organizer is included in the winners array, and its length equals one (meaning there will be only the organizer in the array), he can call the deployProxyandDistribute function, or even deployProxyAndDistributeBySignature to distribute the prize only to him (minus COMISSION FEE). It might be possible even for the owner to execute this transaction using the distributeByOwner, but for the sake of the scenario we can focus only with the previous functions.
2.- If the organizer is included in the winners array, and its length is greater than one (meaning there are more winners) the distribution will include of course other addresses as well, but the organizer might be able to still obtain a percentage of his funds back.
Nevertheless since the organizer is able to call the deploy functions, he can get this funds back after the contest close time.
The following PoC under test testIfAllConditionsMetThenUsdcSendingCallShouldSuceed proofs that a sponsor can be added to the winners array without restriction getting a percentage of his funds back. Minor modifications to the original test file where made to include a sponsor into the winners array and after running the complete evlauation where all the conditions are met, at the end of the test the balance of the sponsor will be increased because it is considered a winner:
At the beginning of the test the balance of user1 is 0 and we can see sponsor has already some balance:
But at the end, when contest is finished and prizes are distributed to winners, since sponsor is included into the array, and this is allowed by the contest, his balance is increased:
Considering that the organizer can be put into the winners array, it is possible for him to violate the philosophy of “supporters first”, meaning there will be a way to recover the majority (or part) of his funds after a contest is created and funded and after the contest close time is reached.
Static review
Ensure that winners != organizers during the creation of the contest.
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.