func Get
crossing ActionGet returns the value for key and marks it most-recently-used. It records a hit or a miss. The returned bool reports whether the key was present.
⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily
A fixed-capacity (8) least-recently-used cache realm — a port of the classic
LRU. Put inserts or updates an entry and marks it most-recently-used, evicting
the least-recently-used entry when capacity is exceeded. Get returns a value,
bumps its recency, and records a hit or a miss. Render shows the entries in
MRU→LRU order alongside the capacity and hit/miss stats.
Realm path: gno.land/r/REPLACE_ADDR/lru
# insert / update entries (marks them most-recently-used)
Put("a", "1")
Put("b", "2")
# read a value (counts a hit, bumps recency)
Get("a") # -> "1", true
# read a missing key (counts a miss)
Get("zzz") # -> "", false
# clear everything
Reset()
# view state (MRU→LRU order + stats)
Render("")
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Get returns the value for key and marks it most-recently-used. It records a hit or a miss. The returned bool reports whether the key was present.
Put inserts or updates key with value and marks it most-recently-used. Evicts the least-recently-used entry if capacity is exceeded.
Render displays the cache contents in MRU->LRU order with stats.
Reset clears the cache and stats.