A decentralized payment application built with React and Ethereum smart contracts, inspired by Venmo. Send and receive cryptocurrency payments with ease while maintaining full transparency on the blockchain.
- Secure Wallet Integration: Connect with MetaMask wallet for secure transactions
- Real-time Transactions: Send and receive payments instantly on the blockchain
- Transaction History: View all past transactions with timestamps and details
- Modern UI: Clean, responsive design with smooth animations
- Smart Contract Integration: Deployed on Ethereum blockchain for transparency
- Activity Feed: Track all transactions in real-time
- React 18 - Modern React with hooks
- JavaScript - ES6+ features
- CSS Modules - Scoped styling
- Framer Motion - Smooth animations
- Heroicons - Beautiful icons
- Tailwind CSS - Utility-first CSS framework
- Solidity - Smart contract development
- Ethers.js - Ethereum JavaScript library
- Truffle - Development framework
- MetaMask - Wallet integration
- React Scripts - Build and development tools
- Web3 Provider - Blockchain connectivity
- JavaScript Time Ago - Relative time formatting
Before running this application, make sure you have:
- Node.js (v14 or higher)
- npm or yarn package manager
- MetaMask browser extension
- Ethereum testnet (Goerli, Sepolia, or local network)
git clone <repository-url>
cd cryptopaynpm install
# or
yarn installnpm install -g trufflecd smart_contract
truffle compile
truffle migrate --network <your-network>Update the contract address in src/utils/constants.js with your deployed contract address.
Create a .env file in the root directory:
REACT_APP_CONTRACT_ADDRESS=your_deployed_contract_addressnpm start
# or
yarn startThe application will open at http://localhost:3000
cryptopay/
βββ public/ # Static assets
βββ src/
β βββ components/ # React components
β β βββ activity/ # Activity feed components
β β βββ transaction/ # Transaction form components
β βββ context/ # React context for state management
β βββ styles/ # CSS modules
β βββ utils/ # Utility functions and constants
βββ smart_contract/ # Solidity smart contracts
β βββ contracts/ # Smart contract source files
β βββ migrations/ # Deployment scripts
β βββ build/ # Compiled contracts
βββ package.json # Dependencies and scripts
The application uses a simple but effective smart contract for managing transactions:
addToBlockchain()- Records new transactionsgetAllTransactions()- Retrieves transaction historygetTransactionCount()- Returns total transaction count
Transfer- Emitted when a new transaction is created
- Click "Connect Wallet" to link your MetaMask account
- Ensure you're connected to the correct network
- Enter recipient's wallet address
- Specify the amount in ETH
- Add an optional message
- Click "Send" to initiate the transaction
- All transactions are displayed in the activity feed
- See sender, receiver, amount, and timestamp
- Transactions are permanently recorded on the blockchain
- Wallet Integration: Secure connection through MetaMask
- Transaction Validation: All transactions are validated by the blockchain
- Immutable Records: Once recorded, transactions cannot be altered
- Gas Fee Protection: Users control gas fees for transactions
The application supports:
- Ethereum Mainnet (for production)
- Goerli Testnet (for testing)
- Sepolia Testnet (for testing)
- Local Development Networks
npm testcd smart_contract
truffle testnpm run buildThis creates an optimized production build in the build folder.
Deploy the build folder to your preferred hosting service:
- Vercel
- Netlify
- AWS S3
- GitHub Pages
cd smart_contract
truffle migrate --network mainnet- 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.
This application is for educational and demonstration purposes. Always verify smart contracts and conduct thorough testing before using in production. Cryptocurrency transactions are irreversible, so use with caution.
If you encounter any issues:
- Check the Issues page
- Ensure MetaMask is properly installed and configured
- Verify you're connected to the correct network
- Check that you have sufficient ETH for gas fees
Happy Coding! π