Storage Overview
Xian contract state is exposed through four ORM-style primitives:
VariableHashForeignVariableForeignHash
All of them ultimately map to deterministic key-value storage in LMDB.
What to Use
| Primitive | Use |
|---|---|
Variable | one stored value |
Hash | keyed or multi-dimensional data |
ForeignVariable | read another contract's variable |
ForeignHash | read another contract's hash |
Key Facts
Variableuses.set()and.get()Hashuses index syntax likebalances["alice"]- hash keys can be multi-dimensional
- foreign storage is read-only by design
- values are encoded deterministically for consensus safety
Use the pages in this section for the exact behavior of each primitive.