Skip to content

DevalPrime/creator-direct

Repository files navigation

CreatorDirect

Direct fan-to-creator subscriptions with zero platform fees

Built with ink! smart contracts on Astar/Shibuya and a React frontend powered by Polkadot.js.

License: MIT ink! 5.0 Astar

CreatorDirect Application

🌟 Overview

CreatorDirect eliminates the middleman in creator-subscriber relationships. Traditional platforms take 20-30% fees; CreatorDirect takes zero.

Creators receive payments directly on-chain with instant access to funds. Subscribers get transparent pricing and censorship-resistant access.

Key Features

  • 💰 Zero Platform Fees - Only minimal blockchain transaction costs
  • Instant Payments - Direct wallet-to-wallet transfers
  • 🔒 Censorship Resistant - No platform can ban or deplatform
  • 🌍 Global Access - Anyone with a wallet can participate
  • 📊 Transparent - All transactions visible on-chain
  • 🔧 Flexible Pricing - Creators set their own terms

📸 Screenshots

Main Interface

The application features a clean, minimal interface focused on subscriptions:

  • Wallet Connection: Easy integration with Polkadot.js Extension
  • Contract Interaction: Simple address input and contract loading
  • Subscription Payment: Enter payment amount in plancks with quick-fill buttons (1 SBY, 5 SBY, 10 SBY)
  • Status Messages: Real-time blockchain status and transaction confirmation feedback
  • Collapsible Help Section: "How to use this app" guide available at the bottom

See the screenshot above for the full interface. The app connects to Shibuya Testnet and displays the current block number in real-time.

🏗️ Architecture

CreatorDirect consists of two main components:

Smart Contract (ink!)

  • Language: Rust with ink! framework
  • Chain: Astar/Shibuya (Polkadot ecosystem)
  • Features: Time-based subscriptions, creator withdrawals, parameter updates
  • Storage: Efficient mapping for subscriber data

Frontend (React)

  • Framework: React 18 + TypeScript
  • Build Tool: Vite
  • Web3 Library: Polkadot.js API
  • Features: Wallet integration, contract interaction, subscription payments

For detailed architecture information, see ARCHITECTURE.md.

🚀 Quick Start

Prerequisites

Run the Frontend

# Clone the repository
git clone https://github.com/DevalPrime/creator-direct.git
cd creator-direct

# Install dependencies
cd frontend
npm install

# Start development server
npm run dev

Open http://localhost:3000 in your browser.

Use the Application

  1. Install Polkadot.js Extension

    • Download from browser extension store
    • Create or import an account
  2. Connect Your Wallet

    • Click "Connect Wallet"
    • Select your account
    • Approve the connection
  3. Subscribe to a Creator

    • Paste the contract address: YQR6oMn2k8Yyzwb7w252jvA27ADa6AswAWfXFaYcMGSmhmq
    • Click "Check Contract" to load contract details
    • Enter payment amount in plancks (e.g., 1000000000000000000 = 1 SBY)
      • Or use quick-fill buttons: "1 SBY", "5 SBY", or "10 SBY"
    • Click "Subscribe & Pay"
    • Sign the transaction in your wallet
  4. Verify Subscription

    • Open Polkadot.js Apps
    • Connect to Shibuya network: Settings → Select "Shibuya" or use wss://rpc.shibuya.astar.network
    • Navigate to Developer → Contracts
    • Add the contract address and interact with it
    • Call is_active(your_address) to check subscription status
    • Call get_subscription_info(your_address) to see expiry details

Note for Creators: To manage your contract (withdraw funds, update pricing), use Polkadot.js Apps contract interface directly on the Shibuya network.

📦 Deployment

Current Deployments

Shibuya Testnet (Active)

  • Network: Shibuya (Astar testnet)
  • RPC: wss://rpc.shibuya.astar.network
  • Contract: YQR6oMn2k8Yyzwb7w252jvA27ADa6AswAWfXFaYcMGSmhmq
  • Purpose: Testing and development
  • Get test tokens: Shibuya Faucet

Astar Mainnet (Ready to Deploy)

  • Network: Astar
  • RPC: wss://rpc.astar.network
  • See DEPLOYMENT.md for mainnet deployment guide

Deploy Your Own Contract

# Install cargo-contract
cargo install cargo-contract --force

# Build the contract
cd contracts/creator_direct
cargo contract build --release

# Deploy via Contracts UI
# 1. Visit https://contracts-ui.substrate.io/
# 2. Connect to Shibuya or Astar
# 3. Upload target/ink/creator_direct.contract
# 4. Set constructor parameters:
#    - price_per_period: Your subscription price in plancks
#    - period_in_blocks: Duration (e.g., 1000 blocks ≈ 3.3 hours)
#    - name: Your creator name
#    - description: Description of your offering
# 5. Deploy and save the contract address

For detailed deployment instructions, including mainnet deployment, see DEPLOYMENT.md.

🧪 Testing

Smart Contract Tests

The contract includes comprehensive unit tests (11 test cases):

cd contracts/creator_direct
cargo test

Test Coverage:

  • ✅ Contract initialization
  • ✅ Subscription purchases and extensions
  • ✅ Insufficient funds handling
  • ✅ Expired subscription checks
  • ✅ Creator-only function protection
  • ✅ Zero price validation
  • ✅ Multi-period subscriptions
  • ✅ Subscription renewal logic
  • ✅ Parameter updates
  • ✅ Withdrawal functionality
  • ✅ Subscription info retrieval

Frontend Testing

cd frontend

# Lint the code
npm run lint

# Format check
npm run format:check

# Build for production
npm run build

📚 Documentation

  • ARCHITECTURE.md - Detailed system architecture and design
  • DEPLOYMENT.md - Complete deployment guide for testnet and mainnet
  • BLOG.md - Technical blog post explaining the approach

🛠️ Technology Stack

Smart Contract

  • ink! 5.0 - Rust-based smart contract framework
  • Substrate Contracts Pallet - WASM contract execution
  • Cargo Contract - Build and deployment tooling

Frontend

  • React 18 - UI framework with hooks
  • TypeScript - Type-safe JavaScript
  • Vite - Fast build tool and dev server
  • Polkadot.js API - Blockchain interaction library
  • Polkadot.js Extension - Wallet integration

Blockchain

  • Astar Network - Production parachain on Polkadot
  • Shibuya Testnet - Test environment for Astar
  • WASM Runtime - Smart contract execution engine

📁 Project Structure

creator-direct/
├── contracts/
│   └── creator_direct/
│       ├── Cargo.toml          # Contract dependencies
│       └── lib.rs              # Smart contract code
├── frontend/
│   ├── public/
│   │   └── metadata.json       # Contract ABI
│   ├── src/
│   │   ├── App.tsx            # Main application
│   │   ├── components/        # React components
│   │   ├── hooks/             # Custom hooks
│   │   └── styles.css         # Styling
│   ├── package.json           # Frontend dependencies
│   └── vite.config.ts         # Vite configuration
├── docs/
│   └── images/                # Documentation images
├── scripts/                   # Deployment scripts
├── ARCHITECTURE.md            # Architecture documentation
├── DEPLOYMENT.md              # Deployment guide
├── BLOG.md                    # Technical blog post
└── README.md                  # This file

💡 Use Cases

For Creators

  • Content Creators: YouTubers, podcasters, bloggers
  • Artists: Musicians, digital artists, performers
  • Educators: Course creators, tutors, coaches
  • Developers: Open source maintainers, tool builders
  • Communities: Private Discord servers, forums, clubs

Benefits Over Traditional Platforms

Feature Traditional Platform CreatorDirect
Platform Fee 20-30% 0%
Payment Delay 7-30 days Instant
Minimum Payout $50-100 None
Geographic Restrictions Many None
Censorship Risk High None
Transaction Fees 3-5% ~$0.0001

🔒 Security

Smart Contract Security

  • ✅ Comprehensive unit test coverage
  • ✅ Rust's memory safety guarantees
  • ✅ Overflow protection with saturating arithmetic
  • ✅ Access control for creator-only functions
  • ✅ Reentrancy protection
  • ✅ Input validation

Frontend Security

  • ✅ No private key handling (uses wallet extension)
  • ✅ All transactions require user approval
  • ✅ Input validation and sanitization
  • ✅ HTTPS/WSS only for RPC connections
  • ✅ Error boundaries for graceful failures

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Report Bugs: Open an issue describing the problem
  2. Suggest Features: Share your ideas for improvements
  3. Submit PRs: Fix bugs or add features
  4. Improve Documentation: Help make docs clearer
  5. Share: Tell other creators about CreatorDirect

Development Setup

# Fork the repository
git clone https://github.com/YOUR_USERNAME/creator-direct.git
cd creator-direct

# Create a feature branch
git checkout -b feature/your-feature-name

# Make your changes and test
cd contracts/creator_direct && cargo test
cd ../../frontend && npm run lint

# Commit and push
git add .
git commit -m "Add your feature"
git push origin feature/your-feature-name

# Open a Pull Request

📖 Additional Resources

Learn More

Community

Block Explorers

🎯 Roadmap

Current Version (v0.1.0)

  • ✅ Basic subscription functionality
  • ✅ Creator withdrawal
  • ✅ Parameter updates
  • ✅ Frontend UI with real-time block status
  • ✅ Quick-fill payment buttons
  • ✅ Shibuya testnet deployment

Future Enhancements

  • Enhanced frontend UI (countdown timers, creator dashboard with withdrawal UI)
  • Multi-tier subscription levels
  • NFT-based subscriptions (transferable)
  • Referral reward system
  • Analytics dashboard for creators
  • Cross-chain support (other parachains)
  • Custom token payments
  • Batch operations
  • Auto-renewal options
  • Mobile wallet support

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Astar Network - For providing an excellent platform for WASM contracts
  • Parity Technologies - For ink! and Substrate
  • Polkadot.js - For comprehensive blockchain interaction tools
  • The Creator Community - For inspiring this project

📞 Support


Built with ❤️ for creators everywhere

Powered by Astar Network and ink! smart contracts

Zero platform fees. Maximum creator freedom.

About

A Web3 application that enables direct subscription from fans to creators with zero platform fees using blockchain technology.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors