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

v0 state

Back to all declarations

Render

func(path string) string

Render 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.

Open
OID
07c3d2…dd24:3
Render details

Inspect func

renderAddr

func(raw string) string
Open
OID
07c3d2…dd24:7
renderAddr details

Inspect func

inbound

func(addr .uverse.address) string
Open
OID
07c3d2…dd24:8
inbound details

Inspect func

outbound

func(addr .uverse.address) string
Open
OID
07c3d2…dd24:9
outbound details

Inspect func

realmPath

untyped string

realmPath 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 string

denom is the only coin a bond can be posted in.

Value

"ugnot"

BoardSize

untyped bigint

BoardSize is how many addresses the index page ranks.

Value

(10 <untyped> bigint)

graph

*v0.Graph

graph 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).

Open
OID
07c3d2…dd24:12
graph details

Inspect pointer

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.

Open
OID
07c3d2…dd24:23
Vouch details

Inspect func

Revoke

func(target .uverse.address) int64

Revoke 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.

Open
OID
07c3d2…dd24:25
Revoke details

Inspect func

Withdraw

func() int64

Withdraw 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.

Open
OID
07c3d2…dd24:26
Withdraw details

Inspect func

IsTrusted

func(addr .uverse.address, min int) bool

IsTrusted 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.

Open
OID
07c3d2…dd24:27
IsTrusted details

Inspect func

ScoreOf

func(addr .uverse.address) int

ScoreOf is how many distinct addresses vouch for addr.

Open
OID
07c3d2…dd24:28
ScoreOf details

Inspect func

BondedFor

func(addr .uverse.address) int64

BondedFor is the total ugnot locked on addr by everyone vouching for them.

Open
OID
07c3d2…dd24:29
BondedFor details

Inspect func

VouchedBy

func(addr .uverse.address) [].uverse.address
Open
OID
07c3d2…dd24:30
VouchedBy details

Inspect func

VouchesOf

func(addr .uverse.address) [].uverse.address
Open
OID
07c3d2…dd24:31
VouchesOf details

Inspect func

Mutual

func(a .uverse.address, b .uverse.address) bool

Mutual reports whether a and b vouch for each other, which is the cheapest sybil shape and therefore worth discounting.

Open
OID
07c3d2…dd24:32
Mutual details

Inspect func

ReasonFrom

func(from .uverse.address, target .uverse.address) string

ReasonFrom is what from wrote about target, or the empty string. It is raw caller text: escape it before rendering it anywhere.

Open
OID
07c3d2…dd24:33
ReasonFrom details

Inspect func

BondFrom

func(from .uverse.address, target .uverse.address) int64

BondFrom is what from locked on target, or zero.

Open
OID
07c3d2…dd24:34
BondFrom details

Inspect func

Count

func() int

Count is how many vouches exist.

Open
OID
07c3d2…dd24:35
Count details

Inspect func

People

func() int

People is how many addresses have at least one vouch for them.

Open
OID
07c3d2…dd24:36
People details

Inspect func

Owed

func(addr .uverse.address) int64

Owed is what addr can collect with [Withdraw](#Withdraw).

Open
OID
07c3d2…dd24:37
Owed details

Inspect func

TotalBonded

func() int64

TotalBonded is everything locked on vouches that still stand.

Open
OID
07c3d2…dd24:38
TotalBonded details

Inspect func

TotalOwed

func() int64

TotalOwed is every revoked bond nobody has collected yet. This realm holds TotalBonded plus TotalOwed on behalf of other people.

Open
OID
07c3d2…dd24:39
TotalOwed details

Inspect func

Badge

func(addr .uverse.address) string

Badge 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.

Open
OID
07c3d2…dd24:40
Badge details

Inspect func

bondOf

func(userCall bool) int64

bondOf 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.

Open
OID
07c3d2…dd24:41
bondOf details

Inspect func

caller

func() (who .uverse.address, userCall bool)
Open
OID
07c3d2…dd24:42
caller details

Inspect func
Render : func(path string) string Inspect
renderIndex : func() string Inspect
board : func() string Inspect
renderAddr : func(raw string) string Inspect
inbound : func(addr .uverse.address) string Inspect
outbound : func(addr .uverse.address) string Inspect
yesno : func(b bool) string Inspect
realmPath : untyped string ="gno.land/r/moul/x/social/vouch/v0"
denom : untyped string ="ugnot"
BoardSize : untyped bigint =(10 <untyped> bigint)
graph : *v0.Graph Inspect
Vouch : func(target .uverse.address, reason string) Inspect
Revoke : func(target .uverse.address) int64 Inspect
Withdraw : func() int64 Inspect
IsTrusted : func(addr .uverse.address, min int) bool Inspect
ScoreOf : func(addr .uverse.address) int Inspect
BondedFor : func(addr .uverse.address) int64 Inspect
VouchedBy : func(addr .uverse.address) [].uverse.address Inspect
VouchesOf : func(addr .uverse.address) [].uverse.address Inspect
Mutual : func(a .uverse.address, b .uverse.address) bool Inspect
ReasonFrom : func(from .uverse.address, target .uverse.address) string Inspect
BondFrom : func(from .uverse.address, target .uverse.address) int64 Inspect
Count : func() int Inspect
People : func() int Inspect
Owed : func(addr .uverse.address) int64 Inspect
TotalBonded : func() int64 Inspect
TotalOwed : func() int64 Inspect
Badge : func(addr .uverse.address) string Inspect
bondOf : func(userCall bool) int64 Inspect
caller : func() (who .uverse.address, userCall bool) Inspect