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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

maxTextLen

untyped bigint

Value

(280 <untyped> bigint)

ringSize

untyped bigint

Value

(64 <untyped> bigint)

cooldownBlocks

untyped bigint

Value

(2 <untyped> bigint)

Message

type

Message is one line in the room. Every field is set by the contract from the transaction itself EXCEPT Text, which is the only caller-supplied value in this realm — so Text is the only thing any reader has to treat as hostile. Author cannot be forged: it is read from the call, never from an argument.

Value

v1.Message

next

int

// write cursor; wraps once full

Value

5

seen

int64

// total ever posted, including those overwritten

Value

5

Post

func(text string) int64

Post appends one message and returns its ID. It is a crossing function because it reads the caller's identity, and it requires an EOA: cur.Previous().IsUserCall(). A realm posting on a user's behalf would make Author meaningless — the room would show the realm's address for every line and there would be no way to tell who said what. There is no reason for a contract to speak here.

Open
OID
07f746…5644:9
Post details

Inspect func

rejectAttachedCoin

func()

rejectAttachedCoin panics if the caller attached native coin. This realm has no use for any, and — unlike every other realm in SPLASH — no way whatsoever to give it back. See the note in the package comment. Inert on a non-user call, for the reason r/splash/exchange's Buy comment gives: unsafe.OriginSend() reads the envelope attached at the chain root, shared by every realm in the call chain, so reading it is only sound when the immediate caller is an EOA. Post refuses non-EOA callers on the very next line anyway, so nothing is let through by this early return.

Open
OID
07f746…5644:11
rejectAttachedCoin details

Inspect func

checkText

func(text string)

checkText is the whole input policy, in one place so there is one answer to "what is allowed". Control characters are rejected rather than stripped, deliberately: a silent strip means the sender sees something different from the room, and a newline inside a markdown table cell would break every row below it in Render. Better to refuse and say why.

Open
OID
07f746…5644:12
checkText details

Inspect func

Count

func() int64

Count is how many messages the ring currently holds, at most RingSize.

Open
OID
07f746…5644:13
Count details

Inspect func

Seen

func() int64

Seen is every message ever posted, including those the ring has overwritten. The gap between this and Count is exactly what a reader must go to the event log for.

Open
OID
07f746…5644:14
Seen details

Inspect func

RingSize

func() int64

RingSize is the bound, exported so a front end can say "last 64" without hardcoding a number that might change.

Open
OID
07f746…5644:15
RingSize details

Inspect func

MaxTextLen

func() int64

MaxTextLen lets a front end enforce the same cap the contract will, so a too-long message is refused in the browser instead of costing gas to fail.

Open
OID
07f746…5644:16
MaxTextLen details

Inspect func

CooldownBlocks

func() int64

CooldownBlocks lets a front end say how long the wait is instead of surprising someone with a panic.

Open
OID
07f746…5644:17
CooldownBlocks details

Inspect func

NextAllowedHeight

func(addr .uverse.address) int64

NextAllowedHeight is the first block at which addr may post again, or 0 if addr has never posted. A front end can disable its button until then rather than letting someone pay gas to be refused.

Open
OID
07f746…5644:18
NextAllowedHeight details

Inspect func

Recent

func(limit int64) []v1.Message

Recent returns up to \`limit\` messages, MOST RECENT FIRST. limit is clamped to what the ring holds, so no caller can ask for an unbounded amount of work.

Open
OID
07f746…5644:19
Recent details

Inspect func

short

func(a .uverse.address) string
Open
OID
07f746…5644:21
short details

Inspect func
maxTextLen : untyped bigint =(280 <untyped> bigint)
ringSize : untyped bigint =(64 <untyped> bigint)
cooldownBlocks : untyped bigint =(2 <untyped> bigint)
Message : type =v1.Message
messages : []v1.Message (len=5) Inspect
next : int =5
seen : int64 =5
lastPost : *v0.Tree Inspect
Post : func(text string) int64 Inspect
rejectAttachedCoin : func() Inspect
checkText : func(text string) Inspect
Count : func() int64 Inspect
Seen : func() int64 Inspect
RingSize : func() int64 Inspect
MaxTextLen : func() int64 Inspect
CooldownBlocks : func() int64 Inspect
NextAllowedHeight : func(addr .uverse.address) int64 Inspect
Recent : func(limit int64) []v1.Message Inspect
cell : func(s string) string Inspect
short : func(a .uverse.address) string Inspect
Render : func(path string) string Inspect