A modern, production-ready decentralized application (DApp) with support for MetaMask and other Web3 wallets. Built with React, Vite, Ethers.js, and Tailwind CSS.
π Live Application: https://guptariya.github.io/dapp/
Note: Make sure you have MetaMask installed to interact with the DApp. The app works best on testnets like Sepolia for testing purposes.
- π Multi-Wallet Support: Connect with MetaMask, WalletConnect, and other Web3 wallets
- π° Transaction Management: Send ETH transactions and sign messages
- π DEX Integration: Token swapping with Uniswap V3 integration
- π Portfolio Tracker: View all ERC-20 token balances and native tokens
- β½ Gas Price Tracker: Real-time gas price monitoring with EIP-1559 support
- π‘οΈ Token Approvals Manager: Check and revoke ERC-20 token approvals
- π Multi-Chain Support: Works with Ethereum, Polygon, Base, and other EVM-compatible chains
- π Smart Contract Interaction: Read and write to any ERC-20 contract
- π¨ Modern UI: Beautiful, responsive interface with Tailwind CSS
- β‘ Fast Development: Built with Vite for lightning-fast hot module replacement
- π Secure: Follows Web3 security best practices
- Node.js 18+ and npm/yarn/pnpm
- MetaMask browser extension (or another Web3 wallet)
- A Web3 wallet with testnet ETH (for testing on Sepolia)
-
Clone or navigate to the project directory:
cd dapp -
Install dependencies:
npm install -
Start the development server:
npm run dev
-
Open your browser: The app will automatically open at
http://localhost:3000
To enable WalletConnect support:
- Go to WalletConnect Cloud
- Create a new project and get your Project ID
- Update
src/config/walletConfig.js:export const WALLETCONNECT_PROJECT_ID = 'your-project-id-here'
Edit src/config/walletConfig.js to add or modify supported networks:
export const SUPPORTED_CHAINS = {
// Add your custom networks here
}- Click the "Connect Wallet" button
- Approve the connection request in MetaMask
- Select the network you want to use (default: Sepolia testnet)
- Start interacting with the DApp!
- Ensure your wallet is connected
- Enter the recipient address
- Enter the amount in ETH
- Click "Send Transaction"
- Approve the transaction in MetaMask
- Wait for confirmation
- Enter a message in the "Sign Message" section
- Click "Sign Message"
- Approve the signature request in MetaMask
- View your signature
dapp/
βββ src/
β βββ components/ # React components
β β βββ WalletButton.jsx
β β βββ TransactionPanel.jsx
β βββ hooks/ # Custom React hooks
β β βββ useWallet.js
β βββ config/ # Configuration files
β β βββ walletConfig.js
β βββ utils/ # Utility functions
β β βββ contracts.js
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
β βββ index.css # Global styles
βββ index.html
βββ package.json
βββ vite.config.js
βββ README.md
The DApp includes utilities for interacting with smart contracts. See src/utils/contracts.js for helper functions:
import { getContract, readContract, writeContract } from './utils/contracts'
import { ERC20_ABI } from './utils/contracts'
// Get contract instance
const contract = getContract(CONTRACT_ADDRESS, ERC20_ABI, signer)
// Read from contract
const balance = await readContract(contract, 'balanceOf', [userAddress])
// Write to contract
const tx = await writeContract(contract, 'transfer', [recipient, amount])- Ethereum Mainnet
- Sepolia Testnet
- Polygon Mainnet
- Base Mainnet
- Base Sepolia
npm run buildnpm run preview- Always verify contract addresses before interacting
- Never share your private keys or seed phrases
- Use testnets for development and testing
- Review transaction details carefully before signing
- Be cautious of phishing attempts
- Ensure MetaMask extension is installed and enabled
- Refresh the page after installing MetaMask
- Check that MetaMask is unlocked
- Ensure you have sufficient ETH for gas fees
- Check that you're on the correct network
- Verify the recipient address is valid
- Check MetaMask for error messages
- Add the network manually in MetaMask
- Or update
walletConfig.jsto include your network
- React 18 - UI framework
- Vite - Build tool and dev server
- Ethers.js 6 - Ethereum library
- Tailwind CSS - Styling
- Lucide React - Icons
This DApp is configured for automatic deployment to GitHub Pages using GitHub Actions.
-
Create a GitHub repository
- Go to GitHub
- Create a new public repository
- Name it
web3-dapp(or updatevite.config.jsbase path if different)
-
Push your code
git remote add origin https://github.com/YOUR_USERNAME/web3-dapp.git git branch -M main git push -u origin main
-
Enable GitHub Pages
- Go to repository Settings β Pages
- Source: GitHub Actions
- Your site will be live at:
https://YOUR_USERNAME.github.io/web3-dapp/
See DEPLOY.md for detailed deployment instructions.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions, please open an issue on GitHub.
Built with β€οΈ by Riya Gupta for the Web3 community