Expand description
Moderation charters.
A data contract may declare that its moderation team is elected by the masternodes (decentralized moderation teams, protocol version 14). The moderation charters system contract holds how a team comes to be:
- a
reasonis a ground for a moderation action, keyed by its owner and a three-letter code; - a
submittedCharteris a leader’s proposal to moderate one contract on that contract’s own terms: the reasons its actions may name, the share of the moderators fee it takes and how it splits the pay; - a
joinRequestis an identity’s offer to serve on the team of a proposal, with a message only the leader can read; - an
electedCharteris a proposal put to the vote with its team, chosen from the identities that asked to join it. Creating one opens or joins the contest for the target contract; - once a charter is seated, its leader may add members from the same join requests, at most
the target’s
maxAddedModeratorsat a time (addedModerator, taken back by deleting it), and remove elected members (removedModerator, undone by deleting it); a member asks to leave with aresignationRequest, which the leader acts on and the member withdraws by deleting it.
The team that acts is the leader plus ElectedCharter::active_members: the elected
members and the additions, less the removals.
Seating writes nothing. Awarding the contest for a target writes the winning
electedCharter to the contract’s storage, the only one ever written there for that target
(contenders live in the contest, and in protocol version 14 a seat is never replaced), so the
charter seated on a contract is the one its byTargetContract index finds. The moderation
paths of the target read it from there: its team moderates, its proposal’s
SubmittedCharter::moderators_share discounts the moderators part of an action fee
(moderators_share_of), and its additions are capped by the target’s
maxAddedModerators.
The schema carries almost every rule through its keywords (references, lookups, key
requirements, distinctFrom, maxBytes for the description’s byte cap, and the
propertyConstraints rule holding the reward split to 100). What is here only reads:
SubmittedCharter and ElectedCharter read the documents’ properties. Nothing here
reads state.
Modules§
- property_
names - The properties of the charter document types.
Structs§
- Elected
Charter - A proposal put to the vote with its team, as read out of an
electedCharterdocument. Its owner is the leader, the owner of the proposal. - Moderation
Charter Reward Split - How a team splits every settle of the moderators pot, a claim or a change of the team: three percentages summing to 100.
- Submitted
Charter - A proposal to moderate a contract, as read out of a
submittedCharterdocument. Its owner is the leader.
Constants§
- ADDED_
MODERATOR_ DOCUMENT_ TYPE_ NAME - The name of the document type of a member the leader adds after the election.
- ELECTED_
CHARTER_ DOCUMENT_ TYPE_ NAME - The name of the elected charter document type, the one on the contested index.
- FULL_
MODERATORS_ SHARE - The moderators share a proposal takes when it declares none: the full declared fee.
- JOIN_
REQUEST_ DOCUMENT_ TYPE_ NAME - The name of the join request document type.
- MODERATION_
CHARTERS_ CONTRACT_ ID - The id of the moderation charters system contract,
EG7RGfV8fDTayC2FyVr8HwdpJh3fXDbVztcfE94UmN88. - REASON_
DOCUMENT_ TYPE_ NAME - The name of the reason document type.
- REMOVED_
MODERATOR_ DOCUMENT_ TYPE_ NAME - The name of the document type of a member the leader removes.
- RESIGNATION_
REQUEST_ DOCUMENT_ TYPE_ NAME - The name of the document type of a member asking to leave the team.
- SUBMITTED_
CHARTER_ DOCUMENT_ TYPE_ NAME - The name of the proposal document type.
Functions§
- charter_
election_ target - The contract a moderation election contends for: the single value of the contested index’s
key,
targetContractId, in any form validation accepts for an identifier (from protocol version 14 a contest’s index values are written asValue::Identifieranyway, seeIndex::extract_contested_values).Nonefor every other contest, and for index values that do not name one contract, a base58 string included. - is_
charter_ election - Whether a contest on the contested index of
document_type_namein the contractcontract_idis a moderation election: anelectedCharterof the moderation charters contract, contending for the seat of its target contract. A moderation election runs on the join and vote windows its target declares and is prefunded with the moderation fund; every other contest keeps the generic windows and fund. - moderators_
share_ of - The moderators part a seated charter’s team charges for an action whose document type
declares
declared_moderators:moderators_sharepercent of it, rounded down to the credit. A document action on a type the target moderates may agree to exactly this amount instead of the declared one; it is then charged this amount, and nothing else below the declared amount is accepted. A share of 100 (or none declared) gives the declared amount itself.