DocsWhen something stalls
When something stalls.
A draw waits on people at two points, and people are not reliable. Every waiting phase records when it was entered, and one permissionless call releases all of them.
Every path out
No decryption arrivesabortDraw() after the timeout. The prize rolls forward and the epoch reopens. The same call covers a ladder that stopped mid-build.
Nobody depositedClosing rolls the epoch over without entering the machine at all.
The total decrypts to zeroAborts and rolls forward, so the reduction is never handed a zero divisor.
A submission is replayedA no-op — the phase check rejects it, and the proof is bound to its handle regardless.
A prize is never claimedRolls forward once the claim window closes. Anyone can call it.
Someone claims twiceReverts. One claim per address per epoch.
You want out mid-drawAlways allowed, in all five phases. Principal is never locked, and a test fails loudly if that stops being true.
One abort, not several
An earlier design had a separate call for each stall. They turned out to be the same shape — a phase with a timestamp that nobody advanced — so they are one function with one timeout and one test. Fewer recovery paths is not a simplification for its own sake: each one is code that runs only in the rare case, which is exactly the code least likely to be correct.
The invariant
No user action, decryption failure or draw state can make principal unrecoverable. A deposit credits exactly the ciphertext the token transfer returned, so recorded liability can never exceed the funds actually held.