Skip to content

tushar11kh/streaming_payroll_solana_flutter

Repository files navigation

streaming_payroll_solana_flutter

Demo Video

Click here to see demo.

The Problem

Traditional payroll systems face several challenges:

  • Delayed Payments: Employees often wait weeks or months for salary payments
  • Geographical Barriers: Cross-border payments are slow and expensive
  • Lack of Transparency: Employees can't track real-time earnings
  • Administrative Overhead: Manual payroll processing is time-consuming
  • Limited Access: Banking infrastructure limitations in some regions

The Solution

A decentralized streaming payroll system built on Solana that enables:

  • Real-time Salary Streaming: Continuous token flow from employer to employee
  • Instant Access: Employees can claim earned tokens anytime
  • Transparent Tracking: Real-time visibility into earnings and available funds
  • Cross-border Payments: Global payroll without traditional banking
  • Automated Processing: Smart contracts handle calculations and distributions

How It Works

For Employers:

  1. Create Stream: Set up payment stream with employee address, token selection, and rate per second
  2. Deposit Funds: Fund the vault with tokens for payroll
  3. Automated Distribution: Smart contract handles continuous payment calculations

For Employees:

  1. View Earnings: Real-time tracking of earned but unclaimed tokens
  2. Claim Anytime: Instant access to accumulated earnings
  3. Transparent History: Complete visibility into payment streams

Tech Stack

Blockchain Layer:

Mobile Application:

  • Flutter: Cross-platform mobile development framework

  • Dart: Programming language for Flutter apps

  • solana Dart Package: Solana blockchain integration

  • Solana: High-performance blockchain for fast, low-cost transactions

  • Anchor Framework: Rust-based framework for Solana program development

  • SPL Tokens: Standard token implementation for payroll payments

Key Infrastructure:

  • Program Derived Addresses (PDAs): Secure account management
  • Cross-Program Invocations (CPI): Token transfer operations
  • System Program: Account creation and management

Flutter Implementation

Architecture & Methodologies:

State Management:

  • Provider Pattern: Centralized state management for wallet and blockchain operations
  • ChangeNotifier: Reactive state updates for wallet connection status
  • Consumer Widgets: Efficient UI updates based on state changes

Service Layer:

  • SolanaClientService: Core blockchain interaction service
  • Singleton Pattern: Single instance managing wallet and RPC connections
  • Async/Await: Non-blocking blockchain operations

Data Models:

  • TokenInfo: Structured token data with mint addresses and decimals
  • JSON Serialization: Efficient data persistence and retrieval

Key Flutter Features Implemented:

UI Components:

  • Custom Cards: Reusable BalanceCard widget with token display
  • Responsive Layout: Adaptive design for various screen sizes
  • Material Design: Consistent UI following Material guidelines

Navigation:

  • MaterialPageRoute: Screen-to-screen navigation
  • Tab-based Interface: Separate employer/employee dashboards

User Experience:

  • Loading States: Progress indicators during blockchain operations
  • Error Handling: User-friendly error messages and recovery
  • SnackBar Notifications: Transaction feedback and status updates

Solana Program

CLick here to go to solana program code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published