Transaction

3B93B7292D494F…166C8501B11A

Block 26,387 · index 0 · indexed

Summary

Hash
3B93B7292D494F8E05249FDDD6226032E465779D36C6E6D844DA166C8501B11A
Block
26,387
Size
3708 bytes
Gas used
8,053,196 / 9,663,895
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

Arguments · 9

  1. #1ringbufferdemo
  2. #2README.md
  3. #3# Ring Buffer > ⚠️ **Experimental — generated with no human supervision** by the daily MCP pipeline to exercise gno tooling. Not audited. See [r/moul/x/daily](https://github.com/moul/gno-contracts/blob/main/r/moul/x/daily/README.md). --- Pushes six entries into a buffer of capacity four and renders, step by step, what survived and what each overflowing push evicted. Demo of the [`p/moul/x/daily/ringbuffer`](https://github.com/moul/gno-contracts/tree/main/p/moul/x/daily/ringbuffer/v0) library — this realm holds no buffer logic of its own. Stateless, so `Render` is fully deterministic. Showing the evicted value in its own column is deliberate: it is the part of the API that keeps a rolling window from dropping data silently. Built for gno 0.9. <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. **Dependency graph:** ![gno.land/r/moul/x/daily/ringbufferdemo/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/ringbufferdemo/v0/deps.png) > 🧪 **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](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/r/moul/x/daily/ringbufferdemo/v0" gno = "0.9"
  6. #6ringbufferdemo.gno
  7. #7// Package ringbufferdemo is a small gnoweb demo of the fixed-capacity FIFO // provided by the [p/moul/x/daily/ringbuffer](/p/moul/x/daily/ringbuffer/v0) // library: it pushes more entries than the buffer can hold and shows what // survives, plus what each overflowing push evicted. // // It contains no buffer logic of its own. Stateless, so Render is deterministic. package ringbufferdemo import ( "strconv" "strings" "gno.land/p/moul/x/daily/ringbuffer/v0" ) const capacity = 4 var feed = []string{"alpha", "bravo", "charlie", "delta", "echo", "foxtrot"} // Render renders the demo for gnoweb. func Render(path string) string { var b strings.Builder b.WriteString("# Ring Buffer\n\n") b.WriteString("A fixed-capacity FIFO that overwrites its oldest entry, demoing the ") b.WriteString("[`p/moul/x/daily/ringbuffer`](/p/moul/x/daily/ringbuffer/v0) library.\n\n") b.WriteString("Capacity **") b.WriteString(strconv.Itoa(capacity)) b.WriteString("**, pushing ") b.WriteString(strconv.Itoa(len(feed))) b.WriteString(" entries:\n\n") b.WriteString("| push | evicted | contents (oldest → newest) |\n|---|---|---|\n") r := ringbuffer.New(capacity) for _, v := range feed { ev, dropped := r.Push(v) b.WriteString("| `") b.WriteString(v) b.WriteString("` | ") if dropped { b.WriteString("`" + ev + "`") } else { b.WriteString("—") } b.WriteString(" | `") b.WriteString(strings.Join(r.Slice(), " ")) b.WriteString("` |\n") } b.WriteString("\n> The buffer never grows: once full, each push costs the oldest entry. ") b.WriteString("On chain that bound is the point — an unbounded queue is an unbounded storage bill.\n") return b.String() }
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 26,387