Skip to content
/ Cathi- Public

Decentralized donation and governance platform built on Sui blockchain. Connect your wallet, donate SUI, and participate in voting campaigns with a live 7-day countdown. Built with Next.js, React, TailwindCSS, and TypeScript.

License

Notifications You must be signed in to change notification settings

kutmur/Cathi-

Repository files navigation

Cathi DAO - Donation and Voting Platform

A decentralized autonomous organization (DAO) built on the Sui blockchain that allows users to donate SUI tokens and participate in governance voting. The platform features a modern, responsive interface with wallet integration and real-time blockchain interactions.

Screenshots

Main Interface - Wallet Connected

Cathi DAO Main Interface

Donation and Voting Interface

Donation and Voting Interface

Features

🔗 Blockchain Integration

  • Sui Wallet Integration: Seamless connection with Sui Wallet, Ethos Wallet, and Slush Wallet
  • Smart Contract Interaction: Direct interaction with Move smart contracts on Sui blockchain
  • Real-time Balance Updates: Live treasury and wallet balance tracking
  • Secure Transactions: All donations and votes are recorded on-chain

💰 Donation System

  • Minimum Donation: 0.001 SUI minimum donation requirement
  • Automatic Voter Creation: Voter object automatically created upon first donation
  • Treasury Management: All donations are stored in a shared treasury object
  • Transaction Verification: All transactions are verified and confirmed on-chain

🗳️ Governance & Voting

  • Proposal-based Voting: Vote on active governance proposals
  • One Vote Per Donor: Each voter can cast one vote across all proposals
  • Proposal Management: Support for multiple active proposals
  • Vote Tracking: Real-time vote count updates

🎨 User Experience

  • Responsive Design: Mobile-first, responsive layout
  • Real-time Updates: Live balance and voting updates
  • Toast Notifications: User-friendly success/error notifications
  • Loading States: Smooth loading indicators during transactions
  • Countdown Timer: 7-day campaign countdown display

Technical Architecture

Smart Contracts (Move)

  • donation_and_vote.move: Core contract handling donations, voter creation, and voting
  • admin_actions.move: Administrative functions for proposal creation
  • Treasury Management: Shared object for storing all donated funds
  • Voter Objects: Individual voter records with voting status tracking

Frontend (Next.js + React)

  • Next.js 14.2.30: Latest stable version with security updates
  • React 18: Modern React with hooks and functional components
  • TypeScript: Full type safety and developer experience
  • Tailwind CSS: Utility-first CSS framework
  • @mysten/dapp-kit: Official Sui wallet integration
  • React Query: Efficient data fetching and caching

Installation & Setup

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Sui CLI (for contract deployment)
  • Sui wallet extension

1. Clone Repository

git clone <your-repo-url>
cd Cathi-

2. Install Dependencies

# Install frontend dependencies
cd frontend
npm install

3. Deploy Smart Contracts (if needed)

# Navigate to project root
cd ..

# Build Move contracts
sui move build

# Deploy contracts (requires Sui wallet with gas)
sui client publish --gas-budget 100000000

4. Configure Constants

Update frontend/constants.ts with your deployed contract information:

export const PACKAGE_ID = 'your-deployed-package-id';
export const TREASURY_ID = 'your-treasury-object-id';
export const NETWORK = 'devnet'; // or 'testnet', 'mainnet'

5. Run Development Server

cd frontend
npm run dev

6. Access Application

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

Smart Contract Details

Core Functions

Donation System

// Donate SUI and create voter object
public entry fun donate_and_create_voter(
    treasury: &mut Treasury,
    coin: Coin<SUI>,
    ctx: &mut TxContext
)

// Simple donation without voter creation
public fun donate(
    treasury: &mut Treasury, 
    coin: Coin<SUI>,
    ctx: &mut TxContext
)

Voting System

// Vote on a proposal
public fun vote(
    proposal: &mut Proposal, 
    voter: &mut Voter, 
    ctx: &mut TxContext
)

// Create new proposal (admin)
public fun create_proposal(
    title: vector<u8>, 
    ctx: &mut TxContext
): Proposal

Object Types

  • Treasury: Shared object storing all donated SUI
  • Voter: Owned object tracking user's voting eligibility and status
  • Proposal: Shared object representing governance proposals

Development Scripts

# Development
npm run dev

# Production build
npm run build

# Start production server
npm run start

# Linting
npm run lint

Project Structure

Cathi-/
├── sources/                    # Move smart contracts
│   ├── donation_and_vote.move
│   └── admin_actions.move
├── frontend/                   # Next.js application
│   ├── components/            # React components
│   ├── pages/                 # Next.js pages
│   ├── styles/                # CSS styles
│   ├── lib/                   # Utility functions
│   └── constants.ts           # Configuration constants
├── screenshots/               # Application screenshots
├── Move.toml                  # Move project configuration
└── package.json              # Root package configuration

Security Features

  • Minimum Donation Enforcement: Smart contract enforces minimum donation amounts
  • One Vote Per User: Prevents double voting through on-chain verification
  • Input Validation: Frontend and contract-level input validation
  • Secure Wallet Integration: Uses official Sui wallet standards
  • Updated Dependencies: All packages updated to latest secure versions

Troubleshooting

Common Issues

  1. Wallet Connection Fails

    • Ensure you have a compatible Sui wallet installed
    • Check that you're on the correct network (devnet/testnet/mainnet)
    • Try refreshing the page and reconnecting
  2. Transaction Failures

    • Verify you have sufficient SUI for gas fees
    • Check that contract addresses in constants.ts are correct
    • Ensure you're connected to the right network
  3. Build Errors

    • Clear node_modules and reinstall dependencies
    • Check that all environment variables are set correctly
    • Verify TypeScript configuration

Getting Help

  • Check the browser console for detailed error messages
  • Verify transaction hashes on Sui Explorer
  • Ensure Move contracts are properly deployed and accessible

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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


Powered by Sui Blockchain | Built with ❤️ for decentralized governance

About

Decentralized donation and governance platform built on Sui blockchain. Connect your wallet, donate SUI, and participate in voting campaigns with a live 7-day countdown. Built with Next.js, React, TailwindCSS, and TypeScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •