This application integrates Web3Auth for seamless wallet connection with social logins, connecting exclusively to the Ethereum Sepolia testnet for safe testing.
Create a .env.local file in your project root with the following variables:
```bash
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=your_web3auth_client_id_here WEB3AUTH_CLIENT_SECRET=your_web3auth_client_secret_here
NEXT_PUBLIC_ETH_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
NEXT_PUBLIC_XMRT_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890 XMRT_CONTRACT_ABI=path_to_abi_json_or_inline_abi
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_client_id NEXT_PUBLIC_DISCORD_CLIENT_ID=your_discord_client_id ```
-
Go to Web3Auth Dashboard
-
Create a new project
-
Configure your project settings:
- Project Type: Plug and Play
- Product: PnP No Modal SDK
- Platform: Web
- Domain:
coldcash.vercel.app(or your domain)
-
Copy your Client ID to
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Add your domain to authorized origins
- Copy Client ID to
NEXT_PUBLIC_GOOGLE_CLIENT_ID
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create a new OAuth App
- Set Authorization callback URL to your domain
- Copy Client ID to
NEXT_PUBLIC_GITHUB_CLIENT_ID
Choose one of the following:
- Sign up at Infura
- Create a new project
- Copy the Sepolia endpoint to
NEXT_PUBLIC_ETH_RPC_URL
- Sign up at Alchemy
- Create a new app on Sepolia
- Copy the HTTPS endpoint to
NEXT_PUBLIC_ETH_RPC_URL
- Deploy your XMRT token contract on Sepolia testnet
- Copy the contract address to
NEXT_PUBLIC_XMRT_CONTRACT_ADDRESS - The ABI is included in the code for standard ERC20 functions
```bash
npm install
npm run dev
npm run build npm start ```
- Non-custodial: Private keys are managed by Web3Auth, never stored on servers
- Testnet Only: Exclusively connects to Sepolia testnet for safe testing
- Environment Variables: All sensitive data stored securely in environment variables
- Network Validation: Blocks app functionality if not on correct network
- Social Login: Google, GitHub, Discord, and email login options
- Wallet Management: View ETH and XMRT token balances
- Network Guard: Automatic network detection and switching prompts
- Testnet Banner: Clear indication that no real funds are at risk
- Faucet Integration: Direct link to Sepolia faucet for test ETH
- Modular Code: Reusable components for other projects
- Connect with any social login method
- Ensure you're on Sepolia testnet
- Get test ETH from the faucet link
- View your wallet address and balances
- Test XMRT token interactions
- Connection Issues: Check Web3Auth client ID and network settings
- Wrong Network: Use the "Switch to Sepolia" button
- Balance Issues: Use the refresh button or check RPC endpoint
- Login Failures: Verify social login client IDs and domains
The application is fully responsive and works on mobile devices with Web3Auth's mobile-optimized login flow.