const MaxBodyLen, MaxCommentLen, MaxPageLimit
── Constants ────────────────────────────────────────────────
AcceptOwnership completes the handoff. Only the staged pendingModerator may call it — including against the outgoing moderator, so the two steps cannot be collapsed into one by the party giving up the role.
CancelOwnershipTransfer clears a staged handoff. Moderator only, so a proposal can be aborted without the proposed address cooperating.
DeleteComment tombstones the caller's comment: clears the body. Only the original author may delete.
DeleteReview tombstones the caller's review: keeps the ID + reaction history, clears the body, and frees the (author, subject) pair for a fresh review. Only the original author may delete.
EditComment updates the body of an existing, non-deleted comment. Only the original author may edit.
EditReview updates rating + body of an existing non-deleted review. Only the original author may edit.
Flag records one community flag per account per target (review or comment). Auto-hide is NOT performed here; takedowns are multisig-only (HideReview/HideComment). Deleted/hidden targets are rejected.
GetCommentsJSON returns a JSON array of a review's non-hidden comments (paginated).
GetFlaggedJSON returns a JSON array of flagged target IDs for the mod dashboard, paginated. IDs are returned as bare integers (not quoted strings). Uses early-stop iteration to avoid loading the entire tree.
GetModerator returns the address that currently holds moderation.
GetPendingModerator returns the staged successor ("" when none).
GetReputation returns the net likes−dislikes reputation for an address. Returns 0 for unknown addresses. Queried via vm/qeval (bare int64).
GetReviewsJSON returns a JSON array of a subject's non-hidden reviews (paginated). Deleted reviews are included as tombstones (empty body, deleted:true).
GetSubjectSummaryJSON returns {"count":N,"average":A,"sum":S} over non-hidden, non-deleted reviews for a subject. Average is integer-rounded. GetSubjectSummaryJSON returns the count/average/sum of a subject's VISIBLE reviews. RV-1: O(1) — reads the maintained per-subject counters instead of scanning the (sybil- growable) review list, so it can never exceed the query gas cap.
HideComment soft-deletes a comment. Moderator (multisig) only.
HideReview soft-deletes a review. Moderator (multisig) only.
PostComment posts a flat reply to an existing, non-deleted, non-hidden review.
PostReview creates the caller's review for `subject`, or replaces it in place if one already exists (the "one editable review per pair" rule).
React records or toggles a like/dislike on a review or comment. Re-reacting with the same kind toggles it off; switching kind replaces it. Updates the target's Likes/Dislikes counters and the author's reputation by Δ(likes−dislikes). Self-reactions are rejected. Deleted/hidden targets are rejected.
Render — human gnoweb view. "" → home (total count); "s/<subject>" → subject review list; else 404.
TransferOwnership stages a handoff of the moderator role. Moderator only; it takes effect only once newModerator calls AcceptOwnership. Calling it again before acceptance replaces the staged address, which is how a mistyped proposal is corrected.
Unhide reverses a hide (manual or auto-flag) on a review or comment. Moderator (multisig) only. Also removes the target from the mod dashboard index.
GetModerationState returns a zero value for an absent ID. The flagged-index bit is distinct from historical flags; Unhide removes only the index entry.
ModerationState is a bounded copied snapshot, including hidden/deleted items. No pointer or body is exposed. BodyHash binds edits even within the same block. Reactions and cumulative flag counts are not moderation authorization inputs.
1type Review struct {
2 ID uint64
3 Subject string // g1… address OR realm path
4 Author address
5 Rating int // 1..5
6 Body string // optional, ≤ MaxBodyLen
7 CreatedAt int64 // block height
8 EditedAt int64 // block height of last edit (0 if never)
9 Hidden bool // multisig soft-delete / auto-hide
10 Deleted bool // author tombstone
11 Likes uint64
12 Dislikes uint64
13 FlagCount uint64
14}── Types ────────────────────────────────────────────────────