Skip to content

osr21/arc-pay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

⚡ ARC payment — Gasless Stablecoin Transfers

Send USDC or EURC peer-to-peer on Arc Network Testnet with near-zero fees (~$0.01). No ETH needed — USDC is the gas token.

Live Demo Arc Testnet License: MIT


What is ARC payment?

ARC payment is a peer-to-peer stablecoin transfer DApp built on Arc Network Testnet. It lets users send USDC or EURC directly to any wallet address with:

  • Near-zero fees — gas costs ~$0.01 paid in USDC (no ETH required)
  • Gasless relay — optional relayer sponsors gas entirely; only a 0.1% protocol fee is charged
  • Instant finality — transactions confirm in under 1 second
  • Persistent history — all transfers stored in PostgreSQL across sessions

Features

Page Description
Dashboard Wallet balances, transfer stats (total volume, avg gas fee), recent activity feed
Send Full P2P transfer form — token picker (USDC/EURC), gasless toggle, fee preview, on-chain execution
History Paginated transfer log with status badges and ArcScan explorer links
Relay Gasless relay explanation + live relayer status (balance, address)
Network Arc Testnet config, contract addresses, faucet link, one-click MetaMask setup

Arc Network Testnet

Parameter Value
Chain ID 5042002 (0x4cef52)
RPC URL https://rpc.testnet.arc.network
Explorer https://testnet.arcscan.app
USDC 0x3600000000000000000000000000000000000000
EURC 0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a
Faucet https://faucet.circle.com

How the Gasless Relay Works

User signs EIP-2612 permit (off-chain, free)
        │
        ▼
  POST /api/relay
        │
        ▼
Relayer calls permit() on-chain      ← relayer pays gas
        │
        ▼
Relayer calls transferFrom()         ← pulls gross amount from user
        │
        ▼
Relayer calls transfer()             ← sends 99.9% to recipient
        │                               keeps 0.1% as protocol fee
        ▼
  Transaction confirmed < 1s

The user never spends any gas. They only sign a typed message (EIP-712) which authorises the relayer to move tokens on their behalf.

Fee Structure

Transfer type Gas cost Protocol fee
Standard (direct) ~$0.01 USDC None
Gasless relay $0.00 (sponsored) 0.1% of amount

Tech Stack

Layer Technology
Frontend React 18 + Vite + TypeScript
Styling Tailwind CSS + shadcn/ui
API Express 5
Database PostgreSQL + Drizzle ORM
Blockchain viem (Arc Testnet RPC)
Monorepo pnpm workspaces
Validation Zod + drizzle-zod
API contract OpenAPI 3.1 + Orval codegen

Getting Started

Prerequisites

  • Node.js 24+
  • pnpm 10+
  • PostgreSQL database
  • MetaMask or Rabby wallet with Arc Testnet added

1. Clone & Install

git clone https://github.com/osr21/arc-payment.git
cd arc-payment
pnpm install

2. Environment Variables

# Required
DATABASE_URL=postgresql://user:password@host:5432/dbname

# Optional — enables gasless relay endpoint
RELAYER_PRIVATE_KEY=0xyour_funded_arc_testnet_wallet_key

3. Run Database Migrations

pnpm --filter @workspace/db run push

4. Start Development Servers

# API server (port 8080)
pnpm --filter @workspace/api-server run dev

# Frontend (port determined by PORT env var)
pnpm --filter @workspace/arc-payment run dev

Adding Arc Testnet to Your Wallet

MetaMask / Rabby — manual setup:

Field Value
Network name Arc Testnet
RPC URL https://rpc.testnet.arc.network
Chain ID 5042002
Currency symbol USDC
Explorer URL https://testnet.arcscan.app

Get testnet USDC at faucet.circle.com — select Arc Testnet + USDC.


Project Structure

arc-payment/
├── artifacts/
│   ├── api-server/          # Express API (routes, relay, balance)
│   └── arc-payment/             # React Vite frontend
├── lib/
│   ├── api-spec/            # OpenAPI 3.1 contract (source of truth)
│   ├── api-zod/             # Generated Zod schemas
│   ├── api-hooks/           # Generated React Query hooks
│   └── db/                  # Drizzle ORM schema + migrations
└── scripts/                 # Utility scripts

API Reference

See docs/API.md for the full API reference.


Architecture

See docs/ARCHITECTURE.md for a deep dive into the system design.


Security

  • Rate limiting on all endpoints (100 req/15 min general, 20 req/15 min relay)
  • EIP-2612 deadline validation (rejects expired permits)
  • Signature length validation before on-chain submission
  • Input sanitisation — error details never leaked to frontend
  • All relay parameters validated via Zod before processing

License

MIT © 2026 ARC payment

About

⚡ Gasless stablecoin transfer DApp on Arc Network Testnet — send USDC & EURC with near-zero fees

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors