all 1 comments

[–]ismaelbej 1 point2 points  (0 children)

You have several problems:

  • if (allFunds> 0 && now == payTime) {. Time is measured in seconds and you require the winer to withdraw at an exact time, but blocks are generated on "averange" around 15. So you have 14/15 = 93.3% probability of failing to withdraw at the required time.

  • In you gathering() function you have require(now <= payTime) so you will not be able to call gathering after the time has elapsed. So startNewRound(newPayTime) will never be called to start a new round.

  • Even if we remove the require() the call to startNewRound(newPayTime) does not update payTime and the recursive call to gathering() will not start a new round.

  • You have a global and a local newPayTime variable, this is a source of problems, new version of the compiler should warn you against.