Skip to content

Reference

tilttek/bounties
TypeRole
BountiesOffers bounties, moves them, settles their points and dispatches the events
BountyA bounty and its state machine; its awards, payouts and record written and read back, checked
BountyDraftWhat a member asks for: identifier, subject, reason, amount, end
BountyRulesThe site's bounds: shortest and longest bounty, grace, smallest and largest amount, open bounties a sponsor
BountyStateOpen, Awarded, Expired or Cancelled
BountyReasonAttention, Detail, Sources, Reward, Creativity or Other
ClaimA member's claim: identifier, claimant, evidence, time
AwardPoints the sponsor awards to a claim: identifier, claim, amount, time
PrizeAn amount of a unit of points, never money
BountyHoldThe points held for a bounty: key, payer, amount, unit, from when and until when
PayoutPoints of a hold paid to a member
PseudonymWhat stands for an erased member: a reference of the kind erased, drawn for each bounty
Contract\BountyStoreWhere the bounties are kept, one open bounty a subject
Contract\BountyEscrowWhere the points are held: reserve, confirm, cancel
Escrow\PointsBountyEscrowThe points held in the ledger of tilttek/points
Escrow\InMemoryBountyEscrowThe points and the holds in memory
Store\InMemoryBountyStoreThe bounties in memory, kept as records
Event\BountyOffered, BountyClaimed, AwardGiven, BountyAwarded, BountyClosedSee Extension points

Instant, Check, Reader and BountyRecord are internal: the time in UTC, the checks of what the library takes, and the reading and checking of a record.

Exceptions

ExceptionThrown when
Exception\BountiesExceptionThe interface of every exception of the library
Exception\InvalidBountyA value the library refuses: an identifier, an amount, a unit, a draft outside the rules, a time, a record, a reference of the kind erased given by a caller
Exception\BountyRefusedA move the rules do not allow: an unknown bounty or claim, a member who may not, a state or a time past its limit, a limit reached, an amount over what is left, a subject taken, an identifier reused
Exception\BountyConflictAnother writer kept the bounty first, three times in a row; a bounty of the same identifier, or on the same subject, kept already
Exception\EscrowConflictAn escrow move that contradicts its hold: another hold under its key, payouts over its amount, a hold settled twice
Tilttek\Points\Exception\InsufficientPointsThe sponsor's points do not cover the bounty

Nothing is kept and no point moves when one is thrown during a move, except an escrow failure after the move is kept, which settle() makes good. Each message says what was expected, as The bounty "01JD4" has 40 points left to award; 41 is too many.