# `gno.land/r/moul/demo/data` Step 3 of the `r/moul/demo` walkthrough: realm state that persists between transactions. ```go var total int func init() { total = 1000 } func Add(nb int) int { total += nb; return total } ``` `total` is a package-level variable in a realm, so the VM persists it after every call. `init` runs once, at deploy time, not on each call. Call `Add(42)` then `Add(295)` and the second call returns 1337: the mutation from the first one was committed to chain storage. That is the whole difference between a `p/` package (no state of its own) and an `r/` realm. Previous: [`args`](../args). Next: [`render`](../render) exposes state through gnoweb. --- 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. **On mainnet:** [![deployment status](https://gnoscope.com/_badges/shield/status/r/moul/demo/data/v0?network=mainnet)](https://gnoscope.com/realm/r/moul/demo/data/v0) [![transactions](https://gnoscope.com/_badges/shield/txs/r/moul/demo/data/v0?network=mainnet)](https://gnoscope.com/realm/r/moul/demo/data/v0) [![unique callers](https://gnoscope.com/_badges/shield/users/r/moul/demo/data/v0?network=mainnet)](https://gnoscope.com/realm/r/moul/demo/data/v0) [![deployed revision](https://gnoscope.com/_badges/shield/version/r/moul/demo/data/v0?network=mainnet)](https://gnoscope.com/realm/r/moul/demo/data/v0) > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).