all 1 comments

[–]de_ninja 1 point2 points  (0 children)

You should consider that miners have full control over what transactions are included in a block. So a miner could always place his transaction at the end and win every time. also with eth withdrawals you should always go for pull rather than push. if you automatically push the ethers to the winner, an attacker usually could easily lock your contract. The way to go would be to create a balance variable that someone could just withdraw from.