A production-ready Web3 invoice creation and management platform that enables seamless payments in USDC and EURC stablecoins on the Arc Testnet.
- π Create Invoices: Generate invoices with custom amounts in USDC or EURC
- π° Web3 Payments: Accept payments directly through blockchain transactions
- π± QR Code Payments: Mobile-friendly QR codes for easy wallet scanning
- π Dashboard: Manage and track all your invoices in one place
- π Theme Support: Light, dark, and system theme modes
- π Secure: Built with Supabase Row Level Security and proper validation
- Framework: Next.js 16.0.7 with TypeScript
- Styling: Tailwind CSS with shadcn/ui components
- Web3: wagmi, viem, and RainbowKit for wallet integration
- Database: Supabase (PostgreSQL)
- Forms: React Hook Form with Zod validation
- Blockchain: Arc Testnet (EVM compatible)
- Smart Contracts: Solidity. See CONTRACT_DEPLOYMENT.md
Before you begin, ensure you have:
- Node.js 18+ installed
- A Supabase account and project
- A WalletConnect Cloud project ID
- A Web3 wallet (MetaMask, WalletConnect, etc.) configured for Arc Testnet
npm install- Create a new project at supabase.com
- Go to the SQL Editor in your Supabase dashboard
- Run the SQL script from
supabase-schema.sqlto create the invoices table and policies
-
Copy the example environment file:
cp env.example .env.local
-
Fill in your environment variables in
.env.local:NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anon/public keyNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: Your WalletConnect Cloud project ID (get it from cloud.walletconnect.com)NEXT_PUBLIC_PAYZED_CONTRACT_ADDRESS: Your deployed contract address (after deployment)
-
Set up the environment file link for Next.js:
npm run setup:env
This creates a symlink so Next.js can read the
.env.localfile from thefrontend/directory.
To test the application, you'll need testnet tokens:
- Visit the Circle Faucet
- Select "Arc Testnet" as the network
- Choose USDC or EURC and request test tokens
- Make sure your wallet is connected to Arc Testnet
If you're using MetaMask:
- Open MetaMask and go to Settings > Networks > Add Network
- Enter the following details:
- Network Name: Arc Testnet
- New RPC URL:
https://rpc.testnet.arc.network - Chain ID:
5042002 - Currency Symbol: USDC
- Block Explorer URL:
https://testnet.arcscan.app
- Save and switch to Arc Testnet
npm run devOpen http://localhost:3000 in your browser.
ArcLedger/
βββ app/ # Next.js app router pages
β βββ page.tsx # Landing page
β βββ login/ # Wallet connection page
β βββ create/ # Invoice creation page
β βββ pay/[id]/ # Payment page (public)
β βββ dashboard/ # User dashboard
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ navbar.tsx # Navigation component
βββ lib/ # Utility functions and configs
β βββ wagmi.ts # Web3 configuration
β βββ supabase.ts # Supabase client
β βββ constants.ts # Contract addresses and ABIs
β βββ utils.ts # Helper functions
βββ supabase-schema.sql # Database schema
- Connect your wallet on the login page
- Navigate to the dashboard and click "Create Invoice"
- Fill in the invoice details:
- Amount (must be positive)
- Currency (USDC or EURC)
- Receiver wallet address
- Submit to create the invoice and get a payment link
- Open the payment link (public, no authentication required)
- Desktop: Click "Pay with Wallet" and confirm the transaction
- Mobile: Scan the QR code with your wallet app
- Wait for transaction confirmation
- The invoice status will automatically update to "paid"
- View all your invoices in the dashboard
- Copy payment links to share with payers
- Track payment status in real-time
- View transaction hashes on ArcScan
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Your Supabase project URL | Yes |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Your Supabase anon key | Yes |
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID |
WalletConnect Cloud project ID | Yes |
NEXT_PUBLIC_ARC_TESTNET_RPC_URL |
Arc Testnet RPC endpoint | No (has default) |
NEXT_PUBLIC_ARC_TESTNET_CHAIN_ID |
Arc Testnet chain ID | No (has default) |
NEXT_PUBLIC_USDC_CONTRACT_ADDRESS |
USDC contract address | No (has default) |
NEXT_PUBLIC_EURC_CONTRACT_ADDRESS |
EURC contract address | No (has default) |
- Network Name: Arc Testnet
- RPC URL:
https://rpc.testnet.arc.network - Chain ID:
5042002 - Currency Symbol: USDC
- Block Explorer: testnet.arcscan.app
- Faucet: faucet.circle.com
Source: Arc Network Documentation
- USDC:
0x3600000000000000000000000000000000000000(ERC-20 interface, 6 decimals) - EURC:
0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a(6 decimals)
Important Note: The USDC ERC-20 interface uses 6 decimals, while the native USDC gas token uses 18 decimals. Always use the decimals() function to interpret balances correctly.
- All inputs are validated on both frontend and backend
- Supabase Row Level Security (RLS) policies protect user data
- Wallet addresses are normalized to lowercase for consistency
- Transaction hashes are stored for audit purposes
- Never expose private keys or sensitive data
- Ensure your wallet is connected to Arc Testnet
- Check that you have testnet tokens in your wallet
- Try disconnecting and reconnecting your wallet
- Verify you have sufficient balance (including gas fees)
- Check that the receiver address is valid
- Ensure you're on the correct network (Arc Testnet)
- Verify your Supabase credentials are correct
- Ensure the database schema has been created
- Check RLS policies are properly configured
npm run build
npm startThis project is open source and available for use.
The application is fully integrated with the ArcLedger.sol smart contract for:
- β On-chain invoice registration - All invoices registered on blockchain
- β Automatic status updates - Event-based real-time status updates
- β Contract-based payments - Secure payment processing through the contract
NEXT_PUBLIC_ARCLEDGER_CONTRACT_ADDRESS in your .env.local.
See:
- CONTRACT_DEPLOYMENT.md - How to deploy the contract
- CONTRACT_INTEGRATION.md - How the integration works
For issues related to:
- Arc Testnet: Visit docs.arc.network
- Supabase: Visit supabase.com/docs
- WalletConnect: Visit docs.walletconnect.com