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.
- 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
- 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
- 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
- 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
- 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
- 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
- Node.js 18 or higher
- npm or yarn
- Sui CLI (for contract deployment)
- Sui wallet extension
git clone <your-repo-url>
cd Cathi-
# Install frontend dependencies
cd frontend
npm install
# Navigate to project root
cd ..
# Build Move contracts
sui move build
# Deploy contracts (requires Sui wallet with gas)
sui client publish --gas-budget 100000000
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'
cd frontend
npm run dev
Open http://localhost:3000 in your browser.
// 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
)
// 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
- Treasury: Shared object storing all donated SUI
- Voter: Owned object tracking user's voting eligibility and status
- Proposal: Shared object representing governance proposals
# Development
npm run dev
# Production build
npm run build
# Start production server
npm run start
# Linting
npm run lint
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
- 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
-
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
-
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
-
Build Errors
- Clear node_modules and reinstall dependencies
- Check that all environment variables are set correctly
- Verify TypeScript configuration
- Check the browser console for detailed error messages
- Verify transaction hashes on Sui Explorer
- Ensure Move contracts are properly deployed and accessible
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Powered by Sui Blockchain | Built with ❤️ for decentralized governance