maxTextLen
untyped bigintValue
(280 <untyped> bigint)
ringSize
untyped bigintValue
(64 <untyped> bigint)
cooldownBlocks
untyped bigintValue
(2 <untyped> bigint)
Message
typeMessage 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
messages
[]v1.Message// len is capped at ringSize
- OID
- 07f746…5644:53
messages details
next
int// write cursor; wraps once full
Value
5
seen
int64// total ever posted, including those overwritten
Value
5
lastPost
*v0.Tree- OID
- 07f746…5644:7
lastPost details
Post
func(text string) int64Post 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.
- OID
- 07f746…5644:9
Post details
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.
- OID
- 07f746…5644:11
rejectAttachedCoin details
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.
- OID
- 07f746…5644:12
checkText details
Count
func() int64Count is how many messages the ring currently holds, at most RingSize.
- OID
- 07f746…5644:13
Count details
Seen
func() int64Seen 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.
- OID
- 07f746…5644:14
Seen details
RingSize
func() int64RingSize is the bound, exported so a front end can say "last 64" without hardcoding a number that might change.
- OID
- 07f746…5644:15
RingSize details
MaxTextLen
func() int64MaxTextLen 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.
- OID
- 07f746…5644:16
MaxTextLen details
CooldownBlocks
func() int64CooldownBlocks lets a front end say how long the wait is instead of surprising someone with a panic.
- OID
- 07f746…5644:17
CooldownBlocks details
NextAllowedHeight
func(addr .uverse.address) int64NextAllowedHeight 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.
- OID
- 07f746…5644:18
NextAllowedHeight details
Recent
func(limit int64) []v1.MessageRecent 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.
- OID
- 07f746…5644:19
Recent details
cell
func(s string) string- OID
- 07f746…5644:20
cell details
short
func(a .uverse.address) string- OID
- 07f746…5644:21
short details
Render
func(path string) string- OID
- 07f746…5644:22