Arc Testnet Lending Protocol v2.3 is a testnet-only DeFi playground that combines collateralized lending, AMM swaps, and a scheduled payout manager on Arc Testnet. The current repo state includes dependency automation, a wagmi + viem wallet stack with RainbowKit popup flow, wallet-independent read paths, stricter app state handling, and a legacy-pool migration UI that prepares users for a replacement lending pool.
This repository is for Arc Testnet only.
- Use test wallets and test funds only.
- Do not connect a mainnet wallet with real assets.
- The protocol is an MVP and is not ready for production use.
- Frontend: https://arclending.vercel.app/
- Bridge reference app: https://arcbridge.vercel.app/
- Dependency automation:
.github/dependabot.ymlcovers the root package,frontend, and GitHub Actions;.github/workflows/dependency-review.ymlreviews dependency changes on pull requests. - Wallet and Web3 migration: the frontend now uses
wagmi+viemwith RainbowKit's wallet popup for injected, Coinbase, and optional WalletConnect flows. - Contract service split: write actions use a signer, while read-only queries use a deterministic read provider and no longer require an attached wallet.
- App state hardening: wallet changes reset stale balances, borrows, supplies, history, and modal state before reloading fresh account data.
- Functional fixes: swap quote race conditions, borrow max precision issues, and negative available-liquidity displays were cleaned up.
- Shared formatting layer: asset display precision is centralized at USDC/EURC = 6, WBTC = 8, ETH/ARC = 6.
- Legacy migration flow: the frontend now includes a migration countdown, legacy-only pool mode, and a dedicated legacy withdrawals/claims page for the old lending pool.
- Active vs legacy pool preparation: the frontend address config now separates
legacyand futureactivepool addresses so the replacement pool can be introduced without losing legacy access. - Tooling cleanup: Tailwind 4, Vite config updates,
dotenvrefresh, and Foundry library updates are in place. - Final cleanup status: the repository root
npm auditis clean, the frontendnpm auditis clean, and the frontend build still emits a Vite chunk-size warning for the wallet bundle. - Security headers:
Content-Security-Policy,X-Content-Type-Options,Referrer-Policy, andPermissions-Policyadded to Vercel deployment config. - UX improvements: withdraw and repay show success notifications with amount and asset; legacy pool screen shows per-asset pool remaining liquidity; withdraw prechecks catch insufficient pool liquidity before sending the transaction.
Latest local validation for this repository:
forge test --match-path test/Contracts.t.sol: 20/20 passingnpm --prefix frontend run build: passing with a Vite chunk-size warning for the RainbowKit wallet bundlenpm auditin the repository root: 0 findingsnpm auditinfrontend: 0 findings
Current pinned library versions:
forge-std:v1.16.0openzeppelin-contracts:v5.6.1- Root
dotenv:^17.4.2 @rainbow-me/rainbowkit:^2.2.10wagmi:^2.19.5
| Setting | Value |
|---|---|
| Chain Name | Arc Testnet |
| Chain ID | 5042002 (0x4cf1a2) |
| Gas Token | USDC |
| Explorer | https://testnet.arcscan.app |
| Primary RPC | https://rpc.testnet.arc.network |
| Fallback RPC 1 | https://rpc.drpc.testnet.arc.network |
| Fallback RPC 2 | https://rpc.quicknode.testnet.arc.network |
| Fallback RPC 3 | https://rpc.blockdaemon.testnet.arc.network |
Arc Testnet add/switch helpers are wired into the header, and the frontend can fall back to bundled RPC endpoints when a custom frontend RPC is not supplied.
| Contract | Address | Notes |
|---|---|---|
| LendingPool | 0x9dD7314B876fF9dFFB4F9aC4d4c8540156cf10b9 |
Current legacy pool used during v2.2 migration window |
| ScheduledPayoutManager | 0x2A094018d03E9F8f6321e55513aA0EaC89DFdEEf |
Deployed, not yet surfaced in the frontend |
| AMM ETH/WBTC | 0xF4638B258905C6a2F7Aa71E05aAC887dB697c338 |
Swap pair |
| AMM ETH/ARC | 0x677df5298Fd0a80672b1E6B4a61BEB75534a83A1 |
Swap pair |
| AMM WBTC/ARC | 0x27e14cfEF1a029A32F574263dce67371bce32d24 |
Swap pair |
| Token | Address | Decimals | Usage |
|---|---|---|---|
| USDC | 0x3600000000000000000000000000000000000000 |
6 | Native Arc testnet stable asset |
| EURC | 0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a |
6 | Lending and collateral |
| ETH | 0x6dC1d97820974558e1bD555C04a5A19608F9512d |
18 | Project-deployed mock testnet ERC20 used for lending, collateral, and swaps |
| WBTC | 0x27488Db1F8F9529B5820De984262179Ad913798E |
8 | Project-deployed mock testnet ERC20 used for lending, collateral, and swaps |
| ARC | 0x56EFFB3b22DBBE576E4327D196aa5ed51476924e |
18 | Project-deployed mock testnet ERC20 used for lending, collateral, and swaps |
| tUSD (legacy) | 0x78b8d44732a7e3601328B016d0bc0D30471685B7 |
18 | Legacy deployment, not part of the main frontend flow |
src/MockETH.sol,src/MockWBTC.sol, andsrc/MockARC.solare mock ERC20 contracts included in this repository.- The configured frontend addresses for ETH, WBTC, and ARC point to deployed testnet mock tokens for this app, not canonical mainnet-style assets.
- USDC is configured as Arc's native testnet stable asset, and EURC is configured as an Arc-side testnet token address for this deployment.
Requirements:
- Node.js 18 or newer
- npm
- Git
- Foundry
git clone https://github.com/dharmanan/ARC-Testnet-Lend.git
cd ARC-Testnet-Lend
# Install root dependencies
npm install
# Install frontend dependencies
npm --prefix frontend install
# Create local environment file
cp .env.example .env
# Run the repository test slice
forge test --match-path test/Contracts.t.sol
# Start the frontend
npm --prefix frontend run devOpen http://localhost:3000 and connect a test wallet on Arc Testnet.
Root .env:
ARC_TESTNET_RPC_URL: RPC endpoint for Foundry scripts and testsPRIVATE_KEY: deployer or relayer key for testnet use onlySCHEDULER_ADDRESS: scheduled payout manager address when needed by scripts
Frontend .env.local or .env:
VITE_ARC_RPC_URL: optional frontend read RPC overrideVITE_WALLETCONNECT_PROJECT_ID: optional WalletConnect project id
If VITE_ARC_RPC_URL is not set, the frontend falls back to the bundled Arc Testnet RPC list.
Never commit .env files or private keys.
frontend/lib/chains.tscentralizes Arc Testnet chain metadata and wallet add/switch helpers.frontend/lib/wagmi.config.tsconfigures injected, Coinbase, and optional WalletConnect connectors.frontend/lib/web3.tsxprovides the sharedWagmiProvider,QueryClientProvider, andRainbowKitProvidertree.frontend/components/Header.tsxrenders RainbowKit's realConnectButton, so wallet selection uses the original popup flow instead of an in-app dropdown.frontend/services/contractService.tskeeps read paths and write paths separate, withsyncWalletClient(walletClient)bridging wagmi into theethersservice layer.frontend/App.tsxresets portfolio state on disconnect and account changes before loading fresh wallet-specific data.frontend/lib/formatters.tsis the shared asset formatter used by swap, modal, history, and market rendering.frontend/components/LegacyClaims.tsxprovides the legacy migration surface for old-pool withdrawals and repayments.frontend/constants.tsnow separatesPOOL_ADDRESSES.legacyandPOOL_ADDRESSES.activeto support the v2.2 migration UI.
The current lending pool remains accessible as a legacy pool while the app prepares for a replacement deployment.
- A live countdown banner is shown in the app.
- The sunset window is currently set to 15 days.
- The main market operates in a legacy wind-down mode.
- New supply and new borrow actions are disabled in the legacy pool UI.
- Withdraw and repay remain available.
- A dedicated
Legacytab provides direct access to legacy balances and actions.
Important migration notes:
- Legacy balances remain user-controlled and are not swept by the owner.
- The old deployed pool does not fully match the newer interest/oracle model.
- Because of that deployment mismatch, legacy APY is intentionally limited or hidden where needed instead of showing possibly incorrect values.
- When the replacement pool is deployed, the user interface will change again to separate the new active pool from the legacy withdrawal flow.
ARC-Testnet-Lend/
├── src/ Solidity contracts
├── test/ Foundry test suite
├── script/ Deployment and liquidity scripts
├── frontend/ React, Vite, wagmi + RainbowKit frontend
├── relayer/ Scheduled payout relayer
├── docs/ Kept reference docs and screenshots
├── foundry.lock Pinned Foundry library versions
├── package.json Root relayer package
├── ROADMAP.md Public roadmap
└── README.md Canonical repository README
- ROADMAP.md
- docs/LENDING_POOL_GUIDE.md
- docs/METAMASK_RED_ALERT_RPC_DELAY.md
- docs/WBTC_ARC_APPROVAL_EXPLAINED.md
Before opening a pull request for contract or frontend changes, run:
forge test --match-path test/Contracts.t.sol
npm --prefix frontend run buildMIT - LICENSE