The organizer calling to distribute the balance of Proxy.sol
could enter a duplicate address which would lead to unfair distribution of rewards.
Consider the following scenario:
There are 3 supporters that come up with a solution to a contest
The organizer decides to split the prize pool into 3 equal parts of ~31.66% (we also take into account the 5% protocol fee)
The organizer calls deployProxyAndDistribute
and enters one of the participants' address twice
There are no checks in the _distribute
function inside of Distribute.sol
to compare if 2 of the values in the array are a duplicate address
The participants take ~63.32%, ~31.66% and 0% respectively
In this scenario one of the participants is left without reward since they were distributed unfairly.
We can take a closer look at the _distribute
function inside Distributor.sol
to highlight there are no checks for duplicate addresses:
The impact is unfair distribution of rewards, one participant gets more than they should and another is left with no rewards. This would lead to a High Severity issue if the prize pool for a given contest is large.
VSCode, Manual Review
Check inside the _distribute
function to compare the values input in the winners array and revert if duplicate addresses exist.
Another possible mitigation is to revert if participant % == 0. Although this does not fix the root caues of the issue which is duplicate addresses inside the winners[]
.
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.