Render
func(path string) stringRender routes two views: the realm's own index, and one address's page. An address carries no slash, so the per-address route is a path element and not a prefix strip.
- OID
- 07c3d2…dd24:3
Render details
renderIndex
func() string- OID
- 07c3d2…dd24:5
renderIndex details
board
func() string- OID
- 07c3d2…dd24:6
board details
renderAddr
func(raw string) string- OID
- 07c3d2…dd24:7
renderAddr details
inbound
func(addr .uverse.address) string- OID
- 07c3d2…dd24:8
inbound details
outbound
func(addr .uverse.address) string- OID
- 07c3d2…dd24:9
outbound details
yesno
func(b bool) string- OID
- 07c3d2…dd24:10
yesno details
realmPath
untyped stringrealmPath is this realm's own path, the one its gnomod.toml module line declares. It is written out rather than read from the frame, because every read this realm exports is borrowed and would report whichever realm called it, building every link against somebody else's page.
Value
"gno.land/r/moul/x/social/vouch/v0"
denom
untyped stringdenom is the only coin a bond can be posted in.
Value
"ugnot"
BoardSize
untyped bigintBoardSize is how many addresses the index page ranks.
Value
(10 <untyped> bigint)
graph
*v0.Graphgraph holds every vouch and the refund ledger. A redeploy would wipe it while leaving the bonded coins at this address, which is why this realm is not private (see gnomod.toml).
- OID
- 07c3d2…dd24:12
graph details
Vouch
func(target .uverse.address, reason string)Vouch records that the caller stands behind target, for the stated reason. It is payable: coins sent with the call are locked as a bond on this vouch and are returned by [Revoke](#Revoke), never by anything else. Sending nothing is fine and is the ordinary case. Vouching again for the same address UPDATES the reason and ADDS to the bond. It does not count twice: the score this realm exists to publish is a count of people, so a second transaction from the same address buys precisely nothing. Vouching for yourself is refused.
- OID
- 07c3d2…dd24:23
Vouch details
Revoke
func(target .uverse.address) int64Revoke withdraws the caller's vouch for target and credits any bond back to them. The coins do not move here: call [Withdraw](#Withdraw) to collect them. Splitting it in two is the pull-payment pattern. A realm that sent on revoke would be handing control to the recipient in the middle of its own state change, and a recipient that refuses the coins could make revoking impossible.
- OID
- 07c3d2…dd24:25
Revoke details
Withdraw
func() int64Withdraw pays the caller every bond their revoked vouches freed, and returns the amount sent. The credit is zeroed before the coins leave, so a recipient that calls straight back in finds nothing to take.
- OID
- 07c3d2…dd24:26
Withdraw details
IsTrusted
func(addr .uverse.address, min int) boolIsTrusted reports whether addr is vouched for by at least min distinct addresses. This is the gate, and it is one line at the call site. A min below one is read as one: a gate that lets everybody through is a bug in the caller rather than an answer this realm will agree to. It cannot tell you that the vouchers are distinct people. Two addresses vouching for each other both reach a score of one, which [Mutual](#Mutual) exposes and which is the reason to ask for more than one.
- OID
- 07c3d2…dd24:27
IsTrusted details
ScoreOf
func(addr .uverse.address) intScoreOf is how many distinct addresses vouch for addr.
- OID
- 07c3d2…dd24:28
ScoreOf details
BondedFor
func(addr .uverse.address) int64BondedFor is the total ugnot locked on addr by everyone vouching for them.
- OID
- 07c3d2…dd24:29
BondedFor details
VouchedBy
func(addr .uverse.address) [].uverse.address- OID
- 07c3d2…dd24:30
VouchedBy details
VouchesOf
func(addr .uverse.address) [].uverse.address- OID
- 07c3d2…dd24:31
VouchesOf details
Mutual
func(a .uverse.address, b .uverse.address) boolMutual reports whether a and b vouch for each other, which is the cheapest sybil shape and therefore worth discounting.
- OID
- 07c3d2…dd24:32
Mutual details
ReasonFrom
func(from .uverse.address, target .uverse.address) stringReasonFrom is what from wrote about target, or the empty string. It is raw caller text: escape it before rendering it anywhere.
- OID
- 07c3d2…dd24:33
ReasonFrom details
BondFrom
func(from .uverse.address, target .uverse.address) int64BondFrom is what from locked on target, or zero.
- OID
- 07c3d2…dd24:34
BondFrom details
Count
func() intCount is how many vouches exist.
- OID
- 07c3d2…dd24:35
Count details
People
func() intPeople is how many addresses have at least one vouch for them.
- OID
- 07c3d2…dd24:36
People details
Owed
func(addr .uverse.address) int64Owed is what addr can collect with [Withdraw](#Withdraw).
- OID
- 07c3d2…dd24:37
Owed details
TotalBonded
func() int64TotalBonded is everything locked on vouches that still stand.
- OID
- 07c3d2…dd24:38
TotalBonded details
TotalOwed
func() int64TotalOwed is every revoked bond nobody has collected yet. This realm holds TotalBonded plus TotalOwed on behalf of other people.
- OID
- 07c3d2…dd24:39
TotalOwed details
Badge
func(addr .uverse.address) stringBadge is the one-line trust mark for addr, for a host realm that wants to show what its gate just read. Like [IsTrusted](#IsTrusted) it is a borrowed read and takes no realm token.
- OID
- 07c3d2…dd24:40
Badge details
bondOf
func(userCall bool) int64bondOf reads the coins attached to this call, and only when the chain credited them to THIS realm. The envelope is the transaction's, not the frame's: a realm that was itself paid and then calls here would report coins sitting at its own address, and crediting them would let it bond money this realm never received. A realm may vouch, with no bond; a realm may not vouch while holding somebody's payment, and saying so loudly beats silently reading the bond as zero. It takes the answer rather than the frame because a realm argument in this package must be named cur, which would make this a crossing function.
- OID
- 07c3d2…dd24:41
bondOf details
caller
func() (who .uverse.address, userCall bool)- OID
- 07c3d2…dd24:42