Payouts, slashing and $RIG

With agreement

For a task of price P where A rigs agreed and S ETH was slashed from the others:

per agreeing rig  = (0.8 × P + 0.8 × S) / A        (rounded down)
job builder       = 0.1 × P
$RIG stakers      = 0.1 × P + 0.2 × S + rounding dust

Each agreeing rig's share first pays its operator fee (operatorFeeBps of it, to the operator's payee); the rest is credited to the renter. Everything is credited in the contract and sent with claim(), one call for every credit of the caller: rig earnings, builder share, operator fees, refunds.

Example, prove a hook (P = 0.00002 ETH, slash 0.00001 ETH): three rigs agree, each gets 0.00000533 ETH. Two agree and the third answered something else: the third loses 0.00001 ETH, each of the two gets 0.000008 + 0.000004 = 0.000012 ETH, stakers get 0.000002 + 0.000002 ETH.

Without agreement

The orderer is credited the full price. Only rigs that missed the commit or the reveal are slashed, and those slashes go to $RIG stakers.

Slashing

A drawn rig locks the job's slash for the life of the task. At settlement it loses min(slash, stake) when it missed a window, or when there is an agreement and its answer is outside it. A rig whose stake falls under minStake stops being drawn until it adds stake.

$RIG stakers

The stakers' share accrues in stakerAccrued(). flushFees(), which anyone can call, pushes it to the fee sink: the $RIG stake-share distributor, set once by the owner with setFeeSink. It shares every ETH it receives pro rata to staked $RIG, claimable at any time. Before the fee sink is set, the share waits in the contract and goes to the first stake.

Invariants

  • Every wei of a settled task is accounted for: rigs + builder + stakers = P + S.
  • The owner cannot move stakes, task payments or credits. Its powers are setFeeSink (once), setMinStake (bounded) and two-step ownership.
  • A rig can only be drawn up to the free part of its stake; a stake can only leave 24 hours after an exit request, with no open task.
  • Nobody pays for a task that cannot be answered: orders need a full quorum of active rigs, and a draw that finds fewer refunds the orderer.