On-chain infrastructure for VertexChain — a location-aware gist platform built on the Stellar / Soroban blockchain.
The contracts handle registering gists as verifiable blockchain records, organizing them by geographic location, and supplying metadata for off-chain indexers.
| Layer | Technology |
|---|---|
| Language | Rust |
| Smart Contract Framework | Soroban SDK |
| Build Tools | cargo, stellar-cli |
| Target | wasm32-unknown-unknown |
| License | MIT |
contracts/
├── gist-registry/ # Gist registry contract
├── multisig/ # Multi-signature wallet contract
├── governance/ # Governance and proposal contract
├── batch-wallet/ # Batch wallet creation/recovery contract
├── Cargo.toml # Workspace configuration
└── README.md
This is a Cargo workspace with separate packages for each contract, allowing for independent development and deployment.
Location-aware gist registry for storing and retrieving gists by geographic cells.
Data Model:
| Field | Type | Description |
|---|---|---|
gist_id |
u64 |
Auto-incremented identifier |
author |
Option<Address> |
Optional author address |
location_cell |
String |
Coarse geographic cell (e.g. H3 or geohash) |
content_hash |
String |
Content hash pointer (e.g. IPFS CID) |
created_at |
u64 |
Ledger timestamp at creation |
Methods:
post_gist(author, location_cell, content_hash)- Register a new gist. Anonymous posting (author = None) requires no auth; a non-anonymous post (Some(address)) requires that address to authorize the invocation (require_auth), so gist attribution cannot be forged.get_gist(gist_id)- Retrieve a gist record by idlist_gists_by_cell(location_cell, cursor, limit)- Paginated list of gists within a location cell
Multi-signature wallet contract for requiring multiple approvals before transactions can be executed.
Features:
- Configurable signers and threshold
- Transaction submission and approval tracking
- High-value transaction thresholds
- Event emission for all operations
Methods:
initialize(admin)- Initialize the multisig contractset_signers(caller, signers, threshold)- Configure signers and approval thresholdsubmit_transaction(caller, to, amount, payload, asset)- Submit a transaction for approvalapprove_transaction(caller, tx_id)- Approve a pending transactionexecute_transaction(caller, tx_id)- Execute an approved transaction
Governance contract for proposing and voting on configuration changes.
Features:
- Proposal creation with configurable duration
- Voting mechanism with approval thresholds
- Typed parameter governance: an executed proposal changes the
required_approvalsthreshold the contract actually reads - Admin and executor allow-list management
Methods:
initialize(admin, required_approvals)- Initialize governancecreate_proposal(proposer, config_key, config_value, duration_seconds)- Create a proposalvote_proposal(voter, proposal_id, against)- Vote on a proposal (against = falseapproves,truerejects)execute_proposal(caller, proposal_id)- Execute an approved proposalget_config(config_key)- Retrieve the value of a governable parameter
Governable config keys
execute_proposal only applies proposals whose config_key maps to a typed,
explicitly-governable parameter. Currently there is one:
config_key |
Parsed value | Validation | Effect |
|---|---|---|---|
required_approvals |
decimal u32 string |
1..=1_000_000 (rejects empty, non-numeric, 0, and out-of-range) |
Updates the RequiredApprovals threshold read by the next execute_proposal |
Any other key — including admin and executor_allowlist, which are managed
through their dedicated admin-only setters (update_admin /
set_executor_allowlist) — is rejected with GovernanceError::InvalidInput
instead of being persisted as dead storage. get_config returns the current
value for required_approvals and None for every other key.
Batch wallet creation and recovery contract for efficient wallet management.
Features:
- Batch wallet creation with duplicate detection
- Batch wallet recovery operations
- Event emission for batch operations
- Admin-controlled operations
Methods:
initialize(admin)- Initialize the batch wallet contractbatch_create_wallets(caller, requests)- Create multiple wallets in a single transactionbatch_recover_wallets(caller, requests)- Recover multiple wallets in a single transactionget_wallet(owner)- Retrieve wallet information
- Rust (≥ 1.70) — install via rustup
wasm32-unknown-unknowntargetstellar-cli— install guide
rustup target add wasm32-unknown-unknowncargo install --locked stellar-cli --features optcargo build --target wasm32-unknown-unknown --releasecd gist-registry
cargo build --target wasm32-unknown-unknown --releasecargo testcd gist-registry
cargo testcd gist-registry
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/gist_registry.wasm \
--network testnet \
--source <your-identity>- Modifications to contract interfaces require prior discussion via a linked issue and design documentation.
- Public functions should remain compact and well-documented.
- New functionality must be accompanied by test coverage.
- When adding new contracts, create a new package in the workspace.