Skip to content

Latest commit

Β 

History

History
90 lines (63 loc) Β· 3.04 KB

README.md

File metadata and controls

90 lines (63 loc) Β· 3.04 KB

Stacks Jackpot Wall πŸ†

A high-performance, real-time decentralized messaging scoreboard built on the Stacks Blockchain. Features an immutable micro-lottery system powered by Clarity Smart Contracts and real-time observability via Hiro Chainhooks.


πŸ—οΈ Stacks Building Mechanics

1. Smart Contract Strategy (Clarity 2.0)

The core engine is an autonomous Clarity contract (jackpot-wall.clar) that enforces:

  • Immutable State: Every post is etched permanently on-chain.
  • Deterministic Payouts: Every 10th poster is rewarded with 90% of the pot, calculated at settlement.
  • Protocol Fees: 10% is retained by the contract to sustain the ecosystem.
  • Zero Control: No admin keys, no pause buttonsβ€”pure, decentralized code.

2. Real-Time Observability (Chainhooks)

Instead of polling the Stacks node, this project utilizes Hiro Chainhooks to achieve sub-second UI updates:

  • Predicates: Custom hooks listen for the print events (new-post and jackpot-won) emitted by the contract.
  • Latency: Near-instant data ingestion, bypassing the block confirmation lag for non-critical UI feedback.

3. Testnet and Mainnet Deployment

The architecture is designed for seamless transitions between environments using standardized Clarinet deployment plans.


πŸ› οΈ Repository Structure

β”œβ”€β”€ contracts/          # Clarity 2.0 smart contract source
β”œβ”€β”€ chainhooks/         # JSON predicates for Hiro Chainhook
β”œβ”€β”€ tests/              # Vitest suite for contract logic
β”œβ”€β”€ deployments/        # Clarinet deployment plans (Mainnet/Testnet)
└── web/                # Stacks-enabled Dashboard (Next.js/Stacks SDK)

🏁 Quick Start

1. Contract Development & Testing

Ensure you have Clarinet installed.

# Run the test suite
npm test

# Check contract syntax
clarinet check

2. Ship to Testnet & Mainnet

# Deploy to Testnet
./deploy-testnet.sh

# Deploy to Mainnet (Requires SP... contract address)
./deploy-mainnet.sh

3. Run the Web App Dashboard

You can run the web app directly from the root directory.

# Install dependencies
npm install

# Start the dashboard in development mode
npm run dev:web

# Build the dashboard for production
npm run build:web

πŸš€ Deploy the Web App Page

You can deploy the web app dashboard instantly to Vercel with a single click:

Deploy with Vercel


πŸ›‘οΈ Security & Privacy

  • Paranoid Review: Full security audit available in security_audit.md.
  • Zero-Key Principle: This repository contains no private keys, seed phrases, or hardcoded secrets.
  • Audit Trails: All event logs are printed on-chain for public verification.

πŸ“œ License

MIT