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 three views: the realm's own index, one page's threads, and one thread. A page key contains slashes, so "page/\<key>" is split on the prefix rather than by path element: realmpath gives the parts, and rejoining them would only be a way to get it wrong.

Open
OID
074862…17e9:3
Render details

Inspect func

renderPage

func(page string) string
Open
OID
074862…17e9:6
renderPage details

Inspect func

renderThread

func(raw string) string
Open
OID
074862…17e9:7
renderThread details

Inspect func

listing

func(items []v0.Listing, withPage bool) string

listing renders a set of threads. withPage adds the page column, which the index needs and a page view would only repeat.

Open
OID
074862…17e9:8
listing 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 unsafe.CurrentRealm(), which reports the CALLER in every plain read this realm exports and would therefore build every link against whichever realm embedded the block.

Value

"gno.land/r/moul/x/social/threads/v0"

EarnPerReplier

int64

Value

1

PinCost

int64

Value

10

PinBlocks

int64

Value

1000

BlockThreads

untyped bigint

Value

(5 <untyped> bigint)

tokenKey

string

Value

"gno.land/r/moul/x/social/threads/v0.THREAD"

tokenPolicy

v0.Policy

tokenPolicy is the three declarations THREAD is issued under. It is a var and not three literals inside init so that the tests, which rebuild the ledger between cases, issue the same token the chain holds.

Open
OID
074862…17e9:19
tokenPolicy details

Inspect ref

Post

func(page string, body string) int64

Post opens a thread under page. page is a package path, the full one: "gno.land/r/moul/home". It does not have to be a realm that embeds the block, and nothing checks that it exists. A page is just a name, which is what lets a realm key discussion on something finer than itself.

Open
OID
074862…17e9:22
Post details

Inspect func

Reply

func(threadID int64, body string)

Reply appends to a thread. The first time each distinct address replies to a given thread, its author earns EarnPerReplier. Replying again earns nothing, and replying to your own thread never earns anything.

Open
OID
074862…17e9:23
Reply details

Inspect func

Boost

func(threadID int64)

Boost burns PinCost THREAD from the caller and pins the thread to the top of its page for PinBlocks blocks. Anyone may boost anyone's thread. The pin is on the thread and not on the buyer, so the thing being sold is placement and not authorship.

Open
OID
074862…17e9:24
Boost details

Inspect func

Transfer

func(to .uverse.address, amount int64)

Transfer moves the caller's own THREAD. It is what makes the sink a market: somebody who wants a pin and has written nothing has to buy from an author.

Open
OID
074862…17e9:25
Transfer details

Inspect func

Approve

func(spender .uverse.address, amount int64)

Approve lets spender draw amount of the caller's THREAD.

Open
OID
074862…17e9:26
Approve details

Inspect func

TransferFrom

func(from .uverse.address, to .uverse.address, amount int64)

TransferFrom spends an allowance the caller was granted.

Open
OID
074862…17e9:27
TransferFrom details

Inspect func

RenderBlock

func() string

RenderBlock returns the block for the realm CALLING it, which is the form a host realm embeds. It has no cur realm parameter on purpose. A plain read is borrowed: gno opens no realm frame for it, so unsafe.CurrentRealm() reports the caller's path and the block keys itself with no argument. Adding a cur realm here would silently reverse that and key every embed to this realm instead.

Open
OID
074862…17e9:28
RenderBlock details

Inspect func

RenderBlockFor

func(page string) string

RenderBlockFor is [RenderBlock](#RenderBlock) for a named page. Use it from a crossing function, where there is no caller to read off the stack, or when one realm renders several pages.

Open
OID
074862…17e9:29
RenderBlockFor details

Inspect func

blockFor

func(page string) string

blockFor is the shared body, so no exported read of this realm calls another and picks up the wrong path.

Open
OID
074862…17e9:30
blockFor details

Inspect func

Count

func(page string) int

Count is how many threads a page holds.

Open
OID
074862…17e9:31
Count details

Inspect func

Total

func() int

Total is how many threads exist, across every page.

Open
OID
074862…17e9:32
Total details

Inspect func

Pages

func() int

Pages is how many pages have ever been posted on.

Open
OID
074862…17e9:33
Pages details

Inspect func

Repliers

func(threadID int64) int

Repliers is how many distinct addresses have replied to a thread, which is also how much its author has earned from it.

Open
OID
074862…17e9:34
Repliers details

Inspect func

PinnedUntil

func(threadID int64) int64

PinnedUntil is the height a thread stops being pinned at, or 0.

Open
OID
074862…17e9:35
PinnedUntil details

Inspect func

BalanceOf

func(owner .uverse.address) int64

BalanceOf is an address's THREAD balance.

Open
OID
074862…17e9:36
BalanceOf details

Inspect func

Allowance

func(owner .uverse.address, spender .uverse.address) int64

Allowance is what owner let spender draw.

Open
OID
074862…17e9:37
Allowance details

Inspect func

TotalSupply

func() int64

TotalSupply is the THREAD in existence: everything earned, less everything burned by Boost.

Open
OID
074862…17e9:38
TotalSupply details

Inspect func

TokenKey

func() string

TokenKey is the r/nt/grc20reg key for THREAD.

Open
OID
074862…17e9:39
TokenKey details

Inspect func
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderPage : func(page string) string Inspect
renderThread : func(raw string) string Inspect
listing : func(items []v0.Listing, withPage bool) string Inspect
realmPath : untyped string ="gno.land/r/moul/x/social/threads/v0"
EarnPerReplier : int64 =1
PinCost : int64 =10
PinBlocks : int64 =1000
BlockThreads : untyped bigint =(5 <untyped> bigint)
board : *v0.Board Inspect
points : *v0.Coin Inspect
tokenKey : string ="gno.land/r/moul/x/social/threads/v0.THREAD"
tokenPolicy : v0.Policy Inspect
init.14 : func() Inspect
Post : func(page string, body string) int64 Inspect
Reply : func(threadID int64, body string) Inspect
Boost : func(threadID int64) Inspect
Transfer : func(to .uverse.address, amount int64) Inspect
Approve : func(spender .uverse.address, amount int64) Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, amount int64) Inspect
RenderBlock : func() string Inspect
RenderBlockFor : func(page string) string Inspect
blockFor : func(page string) string Inspect
Count : func(page string) int Inspect
Total : func() int Inspect
Pages : func() int Inspect
Repliers : func(threadID int64) int Inspect
PinnedUntil : func(threadID int64) int64 Inspect
BalanceOf : func(owner .uverse.address) int64 Inspect
Allowance : func(owner .uverse.address, spender .uverse.address) int64 Inspect
TotalSupply : func() int64 Inspect
TokenKey : func() string Inspect
caller : func() .uverse.address Inspect