Skip to content

Repository files navigation

VerbaChain πŸ”—

VerbaChain is a next-generation blockchain application built on the Celo network that revolutionizes how users interact with cryptocurrency through natural language. Send crypto, schedule transfers, stake tokens, and manage your portfolio using simple, conversational commands.

🌟 Key Features

πŸ’¬ Natural Language Transaction Engine (NLTE)

Transform everyday language into blockchain transactions:

  • "Send 10 CELO to Alice tomorrow at 3pm" - Automatically parses and schedules the transfer
  • "Swap 50 cUSD for CELO" - Instant token swaps with minimal friction
  • "Stake 100 CELO for rewards" - Easy staking with natural commands

🎯 Core Capabilities

πŸ“€ Smart Transfers

  • Instant Transfers: Send CELO, cUSD, cEUR, and custom tokens
  • Scheduled Transfers: Set up future payments with date and time
  • Recurring Payments: Automate regular transactions
  • Contact Management: Save and send to contacts by name
  • Multi-Token Support: Handle various Celo ecosystem tokens

πŸ’± Token Swaps

  • Decentralized Exchange Integration: Swap tokens using Uniswap V3 on Celo
  • Real-time Price Quotes: Get accurate exchange rates
  • Slippage Protection: Secure trades with configurable slippage
  • Natural Language Swaps: "Swap X for Y" - it just works

πŸ’° Staking System

  • Native CELO Staking: Earn rewards by staking CELO tokens
  • Smart Contract Integration: Secure, audited staking contracts
  • Flexible Unstaking: Withdraw your stakes anytime
  • Rewards Tracking: Monitor your earnings in real-time
  • APY Display: View current staking rates

πŸ“Š Dashboard & Analytics

  • Portfolio Overview: Track all your assets in one place
  • Transaction History: Detailed logs of all activities
  • Pending Transactions: Monitor scheduled transfers
  • Staking Statistics: View staking performance and rewards
  • Real-time Balance Updates: Stay informed with live data

πŸ”” Notifications System

  • Transaction Alerts: Get notified on successful transfers
  • Staking Updates: Notifications for staking rewards
  • Scheduled Transfer Reminders: Never miss a payment
  • Error Alerts: Immediate notification of any issues

πŸ€– Telegram Integration

  • Bot Notifications: Receive updates directly on Telegram
  • Secure Setup: Easy bot token configuration
  • Custom Chat IDs: Personal notification channels
  • Real-time Updates: Instant transaction confirmations

πŸ—οΈ Architecture

Monorepo Structure

VerbaChain/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                    # Next.js frontend application
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app/           # App router pages
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/ # Main dashboard
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ nlte/      # Natural language interface
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ staking/   # Staking interface
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ history/   # Transaction history
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ scheduled/ # Scheduled transfers
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ contacts/  # Contact management
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ telegram/  # Telegram settings
β”‚   β”‚   β”‚   β”‚   └── api/       # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ lib/           # Utilities and helpers
β”‚   β”‚   β”‚   β”œβ”€β”€ types/         # TypeScript definitions
β”‚   β”‚   β”‚   └── utils/         # Blockchain utilities
β”‚   β”‚   └── public/            # Static assets
β”‚   β”‚
β”‚   └── contracts/             # Hardhat smart contracts
β”‚       β”œβ”€β”€ contracts/         # Solidity contracts
β”‚       β”‚   β”œβ”€β”€ CeloStaking.sol
β”‚       β”‚   └── CeloRewards.sol
β”‚       β”œβ”€β”€ scripts/           # Deployment scripts
β”‚       β”œβ”€β”€ test/              # Contract tests
β”‚       └── ignition/          # Hardhat Ignition modules
β”‚
└── Documentation/             # Project documentation
    β”œβ”€β”€ README.md              # This file
    β”œβ”€β”€ NLTE_README.md         # NLTE detailed docs
    β”œβ”€β”€ STAKING_DEPLOYMENT.md  # Staking guide
    └── NETWORK_SETUP.md       # Network configuration

πŸš€ Quick Start

Prerequisites

  • Node.js: v18.0.0 or higher
  • pnpm: v8.0.0 or higher (recommended) or npm
  • MetaMask: Browser extension installed
  • Celo Wallet: Some testnet CELO tokens for testing

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/VerbaChain.git
    cd VerbaChain
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    Create a .env.local file in apps/web/:

    # Network Configuration
    NEXT_PUBLIC_NETWORK=sepolia
    
    # Contract Addresses (Sepolia Testnet)
    NEXT_PUBLIC_STAKING_CONTRACT=0x...
    NEXT_PUBLIC_REWARDS_CONTRACT=0x...
    
    # Telegram (Optional)
    NEXT_PUBLIC_TELEGRAM_BOT_TOKEN=your_bot_token
    NEXT_PUBLIC_TELEGRAM_CHAT_ID=your_chat_id
  4. Start the development server

    pnpm dev
  5. Open your browser

    Navigate to http://localhost:3000

Get Testnet Tokens

  1. Visit Celo Faucet
  2. Connect your MetaMask wallet
  3. Request testnet CELO and cUSD tokens
  4. Wait for the transaction to confirm

πŸ“± Usage Guide

Connecting Your Wallet

  1. Click "Connect Wallet" in the navigation bar
  2. Select MetaMask from the wallet options
  3. Approve the connection request
  4. Ensure you're on the Celo Sepolia testnet

Using Natural Language Transfers

  1. Navigate to the NLTE page
  2. Type your command in plain English:
    • "Send 5 CELO to 0x123..."
    • "Transfer 10 cUSD to John"
    • "Send 2 CELO tomorrow at 2pm"
  3. Review the parsed transaction details
  4. Click "Execute" to confirm
  5. Approve the transaction in MetaMask

Swapping Tokens

  1. Go to the Dashboard
  2. Use the swap interface or type:
    • "Swap 10 cUSD for CELO"
  3. Review the exchange rate
  4. Confirm the swap
  5. Approve in MetaMask

Staking CELO

  1. Navigate to the Staking page
  2. Enter the amount to stake or use natural language:
    • "Stake 50 CELO"
  3. Review the estimated rewards
  4. Click "Stake"
  5. Approve the transaction
  6. View your active stakes and rewards

Managing Contacts

  1. Go to Contacts page
  2. Click "Add Contact"
  3. Enter name and wallet address
  4. Save the contact
  5. Use contact names in transfers: "Send 5 CELO to Alice"

Scheduled Transfers

  1. Visit Scheduled Transfers
  2. Create a new scheduled transfer
  3. Set date and time
  4. The system will automatically execute at the specified time
  5. View pending and completed schedules

πŸ› οΈ Technology Stack

Frontend

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui
  • State Management: React Hooks & Context
  • Web3 Integration: Viem, Wagmi

Backend/Blockchain

  • Blockchain: Celo (Ethereum-compatible)
  • Smart Contracts: Solidity
  • Development: Hardhat
  • Testing: Hardhat Test Suite
  • Deployment: Hardhat Ignition

Build Tools

  • Monorepo: Turborepo
  • Package Manager: pnpm
  • Type Checking: TypeScript
  • Linting: ESLint
  • Formatting: Prettier

APIs & Integrations

  • NLP Parser: Custom natural language processor
  • Telegram Bot: Node.js Telegram Bot API
  • Uniswap V3: DEX integration for swaps
  • Celo SDK: Native Celo integrations

πŸ“œ Smart Contracts

CeloStaking.sol

The main staking contract that handles:

  • Staking CELO tokens
  • Tracking user stakes
  • Calculating rewards
  • Unstaking functionality
  • Emergency withdrawals

Key Functions:

function stake() external payable
function unstake(uint256 amount) external
function claimRewards() external
function getStakedBalance(address user) external view returns (uint256)
function getRewards(address user) external view returns (uint256)

CeloRewards.sol

Manages reward distribution and calculations:

  • Time-based reward accrual
  • APY calculations
  • Reward pool management
  • Distribution logic

Deployed Contracts (Sepolia Testnet):

  • Staking: 0x... (See STAKING_DEPLOYMENT.md)
  • Rewards: 0x... (See STAKING_DEPLOYMENT.md)

πŸ”§ Development

Available Scripts

# Development
pnpm dev              # Start all development servers
pnpm build            # Build all packages
pnpm lint             # Lint all packages
pnpm type-check       # Type check all packages
pnpm clean            # Clean all build artifacts

# Smart Contracts
pnpm contracts:compile            # Compile contracts
pnpm contracts:test               # Run contract tests
pnpm contracts:deploy             # Deploy to local network
pnpm contracts:deploy:sepolia     # Deploy to Sepolia testnet
pnpm contracts:deploy:celo        # Deploy to Celo mainnet

# Web App (from apps/web/)
cd apps/web
pnpm dev              # Start Next.js dev server
pnpm build            # Build for production
pnpm start            # Start production server
pnpm lint             # Lint web app

Testing

Smart Contract Tests

cd apps/contracts
pnpm test

Frontend Tests

cd apps/web
pnpm test

Deploying Contracts

  1. Configure network in hardhat.config.ts
  2. Set up your deployer wallet private key
  3. Run deployment:
    pnpm contracts:deploy:sepolia
  4. Update contract addresses in .env.local
  5. Verify contracts on Sepolia Etherscan (optional)

🌐 Network Configuration

Supported Networks

Network Chain ID RPC URL Block Explorer
Sepolia (Testnet) 11155111 https://sepolia.infura.io/v3/YOUR_KEY https://sepolia.etherscan.io
Celo Mainnet 42220 https://forno.celo.org https://celoscan.io

Adding Sepolia to MetaMask

Sepolia Testnet:

πŸ” Security

Best Practices

  • Never commit private keys or sensitive data
  • Use environment variables for configuration
  • Always test on testnet before mainnet
  • Audit smart contracts before deployment
  • Use hardware wallets for production funds
  • Implement proper access controls
  • Validate all user inputs

Smart Contract Security

  • Contracts use OpenZeppelin libraries
  • ReentrancyGuard on all state-changing functions
  • Proper access control with Ownable
  • Events for all critical operations
  • Comprehensive test coverage

🀝 Contributing

We welcome contributions! Please follow these steps:

  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

Coding Standards

  • Follow TypeScript/Solidity best practices
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Use ESLint and Prettier configurations

πŸ“š Documentation

πŸ› Troubleshooting

Common Issues

MetaMask not connecting?

  • Ensure you're on the correct network (Alfajores)
  • Try refreshing the page
  • Clear browser cache and reconnect

Transaction failing?

  • Check you have enough CELO for gas
  • Verify token balances
  • Check if you approved token spending

Staking not working?

  • Verify contract addresses in .env.local
  • Ensure contracts are deployed on the network
  • Check you have sufficient CELO balance

NLTE parsing errors?

  • Use clear, simple language
  • Include necessary details (amount, recipient, token)
  • Check example commands for format

πŸ“„ License

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

πŸ™ Acknowledgments

  • Celo Foundation - For the amazing blockchain platform
  • Next.js Team - For the incredible framework
  • shadcn/ui - For the beautiful UI components
  • OpenZeppelin - For secure smart contract libraries
  • Uniswap - For DEX integration capabilities

πŸ“ž Support & Contact

πŸ—ΊοΈ Roadmap

Q1 2025

  • βœ… Natural Language Transaction Engine
  • βœ… Basic staking functionality
  • βœ… Token swap integration
  • βœ… Telegram notifications

Q2 2025

  • πŸ”„ Advanced scheduling features
  • πŸ”„ Multi-signature wallet support
  • πŸ”„ Mobile app development
  • πŸ”„ Additional language support

Q3 2026

  • πŸ“‹ DeFi protocol integrations
  • πŸ“‹ NFT support
  • πŸ“‹ Cross-chain bridges
  • πŸ“‹ Advanced analytics dashboard

Q4 2026

  • πŸ“‹ Mainnet launch
  • πŸ“‹ Governance token
  • πŸ“‹ DAO implementation
  • πŸ“‹ Enterprise solutions

Built with ❀️ on Celo | Making blockchain accessible through natural language

VerbaChain - Where Words Meet Blockchain

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages