Because of centralization and weak randomness, the organizer can take all the funds
The only way to withdraw winnings is if you are ChoosingRam.sol::selectedRam
and ChoosingRam.sol::isRamSelected
is true. Because the only way to set ChoosingRam.sol::isRamSelected
to true is through ChoosingRam.sol::selectRamIfNotSelected
which has a modifier of OnlyOrganiser, the organizer decides when the final ram is picked. Because of weak rng, the organizer can enter with 1 eth and can choose when to call ChoosingRam.sol::selectRamIfNotSelected
to get a favourable rng to become ChoosingRam.sol::selectedRam
and set ChoosingRam.sol::isRamSelected
to true. This allows the organiser to then call Dussehra.sol::killRavana
, sending half the eth to the organiser. Once ravana is killed, the ram, which is the organiser, can call Dussehra.sol:withdraw
which will send the remaining half of the eth to ram which is the organiser.
Proof of code
The organiser can enter once with 1 eth and can be guaranteed to win as ram and steal all the eth from the other entrants. This means that any participant could potentially have no chance of winning half the prize pool reserved for the ram even if they became ram first.
Manual review
Use better randomness such as chainlink VRF.
The organizer is trusted, but the function `ChoosingRam::selectRamIfNotSelected` uses a way to generate a random number that is not completely random.
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.