Googling around I found this on gitter.
Is this drawing process uncrackable?How can I consider it safe or not to use it? How would you guys evaluate that?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
It looks like there's an exploitable issue in it that allows an attacker to guarantee wins. The
drawNumber(drawingId) function uses the current block number as an input to a random number generator. An attacker with a lottery ticket while the draw is in the DRAWING state can simulate the result of calling
drawNumber(drawingId) in the next block, and hold off on calling the function for real until it results in them winning.
The pre-seeding that happens for draws in the SEEDING state is pointless because the data it generates is known to an attacker and the attacker has control of an input in a later step (the block number that they call drawNumber) that influences the winning numbers.
A way to fix these issues would be to do away with the SEEDING state, and make it so the drawNumber function does not use the current block number as an input, but instead uses a fixed block number. For example, it could be made to use the hash of the block that the drawing was previously scheduled to end at.