Skip to main content

Module moderation_charter

Module moderation_charter 

Source
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 reason is a ground for a moderation action, keyed by its owner and a three-letter code;
  • a submittedCharter is 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 joinRequest is an identity’s offer to serve on the team of a proposal, with a message only the leader can read;
  • an electedCharter is 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 maxAddedModerators at a time (addedModerator, taken back by deleting it), and remove elected members (removedModerator, undone by deleting it); a member asks to leave with a resignationRequest, 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§

ElectedCharter
A proposal put to the vote with its team, as read out of an electedCharter document. Its owner is the leader, the owner of the proposal.
ModerationCharterRewardSplit
How a team splits every settle of the moderators pot, a claim or a change of the team: three percentages summing to 100.
SubmittedCharter
A proposal to moderate a contract, as read out of a submittedCharter document. 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 as Value::Identifier anyway, see Index::extract_contested_values). None for 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_name in the contract contract_id is a moderation election: an electedCharter of 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_share percent 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.