Sorry for sounding kind of snippy, slight headache when I posted that, and no idea where it came from:(. No offense taken, and again, sorry. Since you do see potential problems with this, how would you go about fixing it? I thought it was pretty air tight, but like you pointed out, it can be exploited:(.
That's fine. The problem is that you are basing the tickets off of something the user can manipulate. The address. Something better would be to use transaction hashes.
The other SMALL issue I can see is that if someone REALLY wanted they could re-broadcast till they get a tx hash that works better. It would be harder to do though...
Their tx hash -> decimal
Then once no one enters and time runs use the a block hash from the expiry time. -> decimal
Whoever has the smallest difference wins.
(come up with something where extra btc makes that difference smaller - perhaps (calculated diff)/(btc invested) - I don't know, something like that)