There is no check on the data passed while distributing tokens to winners, organizer can pass their own address as winners and rug pull actual winners by paying just a COMMISSION_FEE which is set to 5%.
https://github.com/Cyfrin/2023-08-sparkn/blob/47c22b818818af4ea7388118dd83fa308ad67b83/src/ProxyFactory.sol#L127-L138
https://github.com/Cyfrin/2023-08-sparkn/blob/47c22b818818af4ea7388118dd83fa308ad67b83/src/ProxyFactory.sol#L249-L253
When contest's closeTime
is over i.e., saltToCloseTime[salt] <= block.timestamp
, organizer
can call deployProxyAndDistribute
function with the data defined as below:
Here, organizer is passing encoded data of Distributor.distribute
function.
As winners = [ORGANIZER_CONTROLLED_ADDRESS] and percentages = [10000 - COMMISSION_FEE], ORGANIZER_CONTROLLED_ADDRESS will receive 95% of all the tokens that was sent before deployment as COMMISSION_FEE is set to 5%. So organizer is only paying COMMISSION_FEE for conducting a contest, which is very cheap for organizer but supporters(winners) are losing their share.
Organizer can rug pull supporters(winners) just at a cost of commission fee.
Manual
We recommend to have some trusted parties may be only owner to distribute tokens that was sent before deployments to winners list shared by organizer.
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.