Skip to content

flashbacknetwork/FlashOnStellar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashOnStellar

Soroban smart contract for a multi-cloud storage marketplace on Stellar. Providers offer storage buckets; consumers create deals and fund them with tokens. The contract holds escrowed funds and pays providers based on consumption and SLA metrics reported by an off-chain oracle.

Setup

The scripts in scripts/ use Soroban identities for deployment, upgrades, and oracle operations. Configure these identities locally before running:

  • flashback – Used for contract deploy, upgrade, and oracle invocations (mainnet/testnet).
  • issuer – Used by faucet.sh for USDC minting on testnet.

Add identities with soroban keys add <name>, or import from a secret key. Identities and keys are stored in .soroban/ (gitignored) and never committed.

Architecture (V2)

Key entities:

  • Owner – Contract admin; sets stable asset, platform fee, upgrades contract, deletes entities, triggers oracle-driven payments
  • Provider – Registers, creates buckets, accepts/rejects deals, cancels deals
  • Consumer – Registers, creates deals, funds deals, completes deals
  • Oracle – Off-chain; supplies consumption and SLA data to Owner for update_deal_consumption and update_deal_sla

Deal flow:

  1. Consumer creates a deal for a bucket (create_deal) → Pending
  2. Provider accepts or rejects → Accepted or Cancelled
  3. Consumer funds the deal (set_deal_funded) → Funded
  4. Oracle updates consumption/SLA; Owner calls pay_pending_consumption to settle payments
  5. Consumer completes the deal → Completed; or breaches lead to BreachedConsumer / BreachedProvider

Buckets – Providers create buckets with pricing (storage/egress per GB), SLA (latency, uptime), and API compatibility. Buckets have status: Active, Inactive, Deleted.

Reputation – Providers and consumers have a reputation score (0–100). It is updated on deal completion and breach; future tokenomics may use it more heavily.

Oracle

Flashback Network gathers consumption stats from network node telemetry. An oracle process reads those stats and, for active deals, calls:

  • update_deal_sla – Updates SLA metrics (latency, uptime)
  • update_deal_consumption – Reports storage and egress consumed
  • pay_pending_consumption – Settles payments from escrowed funds to the provider (with platform fee deduction)

The Owner identity must sign these oracle invocations.

Documentation

Build & Test

soroban contract build
cargo test

For mainnet deployment, use --no-default-features to exclude testnet-only features (faucets, minting).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors