Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

reaper/v1 package

Overview

Package reaper is a noticeboard whose garbage is a standing bounty.

Anyone can post a note with an expiry. Posting locks a storage deposit, paid by the poster. Once a note expires, anyone at all can delete it, and the chain refunds that deposit to whoever signed the deleting transaction. So the poster pays to occupy space and a stranger is paid to reclaim it.

Nothing here is a token, a reward pool or an emission schedule. The incentive is the chain's own storage accounting, which already works this way for every realm on gno.land; this realm only makes it legible. Reap and Compact are permissionless because the expiry predicate is checked on chain, so the worst a malicious reaper can do is waste their own gas.

Two collaborators own the parts this realm does not:

  • gno.land/p/moul/ulist/v1 stores the notes and owns compaction. Its Delete is a soft delete that leaves a dead tree node behind, and its Compact frees those nodes without moving any live index.
  • gno.land/p/moul/x/storagecost/v0 owns the arithmetic: what a byte refunds, and how many bytes a transaction must free to pay for itself.
  • gno.land/p/moul/kit/ui/v0 owns display: the escaping, the length cap and the address format. A note body is arbitrary bytes chosen by whoever paid to post it and is rendered back to every reader, so it is attacker-controlled input in a markdown slot. Render never emits a body unescaped; ui.Excerpt is what makes that true, and it delegates to p/nt/markdown/sanitize.

The realm deliberately cannot see its own byte count. No stdlib call exposes a realm's locked storage, so every figure Render shows is an estimate from payload length. The authoritative numbers are the chain's, in the StorageDepositEvent and StorageUnlockEvent each transaction emits.

Function

Live

func Live() int

Live counts the notes still holding storage.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/reaper/v1.Live()"

Result