PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/moul/addrset/v1

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v1
Namespace
moul / addrset
Files
3 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/moul/addrset/v1
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • addrset.gnogno
README.mdPreviewRaw
# `gno.land/p/moul/addrset/v1`

A set of blockchain addresses, **backed by a B+ tree** (`gno.land/p/nt/bptree`).

The B+ tree successor to [`p/moul/addrset/v0`](https://github.com/moul/gno-contracts/tree/main/p/moul/addrset/v0)
(AVL-backed). **v1 because the backing data structure — and thus the on-chain
storage layout — changed** (a compatibility change ⇒ new version). A B+ tree
packs many entries per persisted node, so a stored address costs ~0.9 KB vs the
AVL backing's ~2.0 KB, and inserts spend materially less gas — prefer v1 for
persisted realm state.

```go
import "gno.land/p/moul/addrset/v1"

var set addrset.Set // zero value is an empty, usable set
set.Add(addr)       // true (newly added)
set.Has(addr)       // true
set.Remove(addr)    // true (was present)
set.IterateByOffset(0, 10, func(a address) bool { return false })
```

**Differences from v1:** the `Tree()` escape hatch is removed (the backing store
never leaks); and — because the B+ tree mutates in place — do not Add/Remove from
inside an iteration callback, and do not copy a non-zero `Set` by value.

<!-- 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/p/moul/addrset/v1 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/p/moul/addrset/v1/deps.png)

Provenance: imported — see [https://github.com/moul/gno-contracts/pull/2](https://github.com/moul/gno-contracts/pull/2) for context and metadata.

> ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).

<!-- END GNOCONTRACTS FOOTER -->

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.