Mist Contract Lifecycle Reference
Production contract lifecycle on Rivellum.
Lifecycle States
| State | Entry | Exit | Invariants |
|---|---|---|---|
| Source | Author .mist file | mistc check/lint pass | deterministic semantics only |
| Bundle | mistc build artifact | mistc deploy accepted | hash-stable artifact |
| Deployed | receipt emitted | upgrade/deprecate/freeze | address immutable |
| Active | callable via mistc call or /v1/mist/call/:id | governance/operator transition | replay inputs available |
| Frozen | policy/governance action | terminal unless policy changed | no new writes |
Build Surface
mistc check contracts/amm.mist
mistc lint contracts/amm.mist
mistc fees contracts/amm.mist
mistc build contracts/amm.mist -o build/amm.bundle.json
Deploy Surface
mistc deploy build/amm.bundle.json --rpc https://rpc.rivellum.network
curl https://rpc.rivellum.network/v1/mist/contract/CONTRACT_ID
Call Surface
mistc call CONTRACT_ID swap '{"in_asset":"0x...","out_asset":"0x...","amount_in":"1000000"}' --rpc https://rpc.rivellum.network
Equivalent RPC:
curl -X POST https://rpc.rivellum.network/v1/mist/call/CONTRACT_ID \
-H "Content-Type: application/json" \
-d '{"fn":"swap","args":{"in_asset":"0x...","out_asset":"0x...","amount_in":"1000000"}}'
Receipt And Replay Artifacts
| Artifact | Endpoint / Command |
|---|---|
| Receipt | mistc receipt RECEIPT_ID --rpc ... or GET /v1/mist/receipts/:id |
| PVI graph | GET /v1/mist/pvi/:id |
| Replay input | GET /v1/mist/replay_inputs/:id |
| Deterministic replay | mistc replay RECEIPT_ID --rpc ... |
Upgrade / Compatibility Discipline
- Never change event schema in place without versioning.
- Introduce new entrypoints instead of mutating old call contracts.
- Keep old readers operational until indexers/frontends migrate.
- Preserve deterministic call shape for fee stability.
Integration Hooks
- Event readers:
GET /v1/events/query+/events/stream - Frontend state hydration: receipt ID + typed event reducer
- Incident forensics: receipt + pvi + replay_inputs
Related References
/docs/dev/mist-toolchain/docs/dev/debugging-replay/docs/dev/fee-planning