Skip to content

fix(arc-testnet): correct native token symbol, decimals, and explorer URL - #37

Open
Ccheh wants to merge 2 commits into
circlefin:masterfrom
Ccheh:fix-arc-chain-config
Open

fix(arc-testnet): correct native token symbol, decimals, and explorer URL#37
Ccheh wants to merge 2 commits into
circlefin:masterfrom
Ccheh:fix-arc-chain-config

Conversation

@Ccheh

@Ccheh Ccheh commented May 13, 2026

Copy link
Copy Markdown

Three real chain-configuration bugs that affect any developer forking this sample:

1. lib/chain-config.ts — wrong native token symbol

```diff
export const NATIVE_TOKENS: Record<string, string> = {

  • arcTestnet: "ARC",
  • arcTestnet: "USDC",
    avalancheFuji: "AVAX",
    baseSepolia: "ETH",
    };
    ```

There is no "ARC" token. Arc's documented core property is USDC is the native gas token (see Circle skills use-arc/SKILL.md: "Arc is Circle's blockchain where USDC is the native gas token").

This value flows directly into three user-visible error messages in components/transfer-form.tsx (lines 79, 81, 83, 92, 94, 96, 97), telling users to acquire a non-existent "ARC" token to pay gas. A new user hitting the gas-insufficient path is directed to find "ARC" on Arc Testnet, which doesn't exist — they should be sent to the Circle Faucet to get USDC.

2. lib/circle/gateway-sdk.ts — wrong native decimals

```diff

  • nativeCurrency: { name: 'USD Coin', symbol: 'USDC', decimals: 6 },
  • nativeCurrency: { name: 'USDC', symbol: 'USDC', decimals: 18 },
    ```

Arc's native gas token uses 18 decimals (like ETH on other EVM chains), not 6. ERC-20 USDC at 0x3600... has 6 decimals as a view, but the chain-level nativeCurrency.decimals in a viem/wagmi Chain definition refers to native gas, which is 18 on Arc. This is explicitly documented in use-arc/SKILL.md:

"Dual decimals: Native gas uses 18 decimals (like ETH on other chains). ERC-20 USDC uses 6 decimals. Mixing these up will produce incorrect amounts."

Empirical confirmation: the canonical Chain definition in circlefin/arc-commerce/lib/wagmi/config.ts uses decimals: 18. The current value of 6 causes viem/wagmi balance display to be off by a factor of 10^12 — a 1.0 USDC balance shows as 1,000,000,000,000 in any component that reads formatEther/formatUnits against this nativeCurrency.

3. lib/circle/gateway-sdk.ts — broken block explorer URL

```diff

explorer.arc.testnet.circle.com returns HTTP 000 (DNS does not resolve). The canonical Arc Testnet explorer is testnet.arcscan.app (referenced in circlefin/skills/use-arc/SKILL.md, circlefin/arc-fintech/lib/constants/block-explorers.ts, and circlefin/arc-commerce/components/wallet/network-indicator.tsx).

```bash
$ curl -sI -o /dev/null -w "%{http_code}\n" "https://explorer.arc.testnet.circle.com"
000
$ curl -sI -o /dev/null -w "%{http_code}\n" "https://testnet.arcscan.app"
200
```

Any "View on Explorer" link rendered from this chain config currently 404s.


These are the same kind of chain-config inheritance bugs circlefin/arc-fintech carries (filing a separate PR there). Fixing the sample apps prevents the bugs from propagating into every downstream fork that uses these as templates.

@Sertug17

Copy link
Copy Markdown

+1 verified all three fixes locally on a fresh clone:

1. decimals: 6decimals: 18
Arc Testnet uses USDC as native gas with 18 decimals, while ERC-20 USDC uses 6. With decimals: 6, any balance display via viem's formatEther/formatUnits defaults would be off by 10^12.

2. nativeCurrency.name: 'USD Coin' → 'USDC'
Consistent with the symbol and matches Arc's docs.

3. Explorer URL
Reproduced the issue:

$ curl -I https://explorer.arc.testnet.circle.com
HTTP 000 (connection failed)

$ curl -I https://testnet.arcscan.app
HTTP/2 200

4. chain-config.ts: arcTestnet: "ARC" → "USDC"
Matches the native token symbol used in gateway-sdk.ts nice catch on the cross-file consistency.

Cross-repo context

The same explorer URL pattern was identified and is being fixed in arc-fintech#9 by @skyc1e. Worth checking whether arc-fintech's gateway-sdk.ts also has the decimals: 6 issue I haven't verified that yet, but if the chain config was copied across sample apps the same fix may apply there.

Nice clean PR 👍 hopefully gets a review soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants