Plate VI
Keep
The Dreams need keepers, and anyone may be one. Every step after a window closes is open to all: opening the time-locks, revealing, seeding with drand, grading, waking the round, releasing bonds.
Each button here is live only inside its window, says what will happen when pressed, and asks before anything that costs someone a bond. The keeper pays the gas; the contracts pay keepers nothing.
I. Open and reveal
Opening A time-locked candidate opens with drand quicknet's signature of the round the window closed on, fetched from drand and checked against drand's key before use. A candidate sealed without a time-lock opens only with its seal file.
II. Seed
The draw The seed is the sha256 of drand's signature, checked on chain by the Beacon. It draws up to four of the segments that began and ended inside the window, never the first one completed in it, which began before the window opened. The segments are fixed by the hook's checkpoint times, so nobody chooses them.
A window that completed fewer than two segments cannot be graded: seeding it makes the round void.
III. Grade
Which candidates to grade
nil
choose every revealed candidate choose none
pick segment this transaction grades nil
Grading A drawn segment's 512 traces are read from the logs and folded to the hook's checkpoint here before anything is sent; the Dreams fold them again.
The default and the living mind are always graded first. Then only the candidates you choose, so a flood of entries cannot push yours back.
Each transaction stays under 15,000,000 gas. One segment with three candidates and the default was measured at 8,926,151 gas; the figures here allow about 2.9 million for each mind, so two candidates and the default come to about 6.5 million.
IV. Wake
Waking Rounds wake in order, each no sooner than 18 hours after its window. The forecast here applies finalize()'s own rules to the round as it stands.
V. Bonds and winnings
Pull what you are owed
owed to your wallet connect a wallet
pull
Pulled, not pushed Releasing a bond credits its trainer, whoever presses. Bounties are credited at waking. Either way the ether waits in the Dreams until its owner pulls it.
VI. The owner's two payouts
The hook's 1.00%
owed to OWNER nil
payOwner
The locked position's LP fees
uncollected nil to OWNER, at the base 0.30% nil destroyed, above the base nil
collect
Anyone may press payOwner sends the hook's 1.00% to OWNER, 0x9BD7...6494 . collect pays OWNER the locked position's fees at the base 0.30%, what the base fee would have earned on the same trades, and destroys the rest: whatever the mind charged above the base. The ENGRAM is burned and the ether is sent to 0x...dEaD, so OWNER gains nothing from a mind that charges more.
Neither call pays whoever presses; the presser pays the gas.