lovable skill · lovable-arc

The Arc / Circle skill, in full.

Everything that broke building on Arc testnet and mainnet with Circle wallets, Privy and USDC / EURC / cirBTC, plus the fixes. Lovable uses it automatically on Arc builds. Add it under Settings → Skills, then type / in chat to call it up.

Download .zip

Arc on Lovable — failure modes

SymptomCauseFix
App returns a blank 500 after adding Circle features@circle-fin/* SDK pulled Node-only deps into the WorkerRemove the SDK; hand-roll fetch + Web Crypto against api.circle.com/v1/w3s
[unenv] X is not implemented yet! / __dirname is not definedNode-only package in the Worker bundleReplace with a Worker-safe library or a plain HTTP call
add_secret rejects VITE_PRIVY_APP_IDVITE_* is a reserved prefix in LovableSave as PRIVY_APP_ID, expose via a route loader reading process.env
DNS failure on rpc.testnet.arc.ioWrong hostname in Circle/Arc docsUse rpc.testnet.arc.network
Circle 409 on a brand-new API keyOnboarding pre-primed the entity secretRegister through Console → Configurator with your own base64 ciphertext
invalid entity secret after pastingPasted the recovery blob, not the 64-hex secretUse the raw hex you persisted before registration
SCP deploy 400Missing idempotencyKey, or abiJson sent as an arraySend a UUID + JSON.stringify(abi)
Circle tx 400 mentioning gasPriceSent an EIP-1559/fee objectfeeLevel: "MEDIUM" (string)
Circle rejects the ciphertextReused a previous ciphertextRe-encrypt per request against a freshly fetched public key
Deploy hangs foreverPolling the wrong fieldWait for data.contract.status === "COMPLETE"
eth_getLogs errors after ~10 blocksAlchemy free-tier Arc capUse the public Arc RPC for logs; chunk + shrink the window on range errors
RPC rate-limit errors in a payout/activity panelUnbounded lookback and polling remountsCap lookback (~5,000 blocks), cache results ~60s, prefer Arcscan v2
Activity panel misses old eventsRPC window can't reach the first mintRead history from the Arcscan v2 REST API, keep RPC as fallback
Arcscan "Unable to verify"Local solc newer than the deployed pragmaPin solc@0.8.24 in devDependencies; exact pragma; matching optimizer runs
Verification "started" but never verifiedQueued, not finishedPoll /api/v2/smart-contracts/{address} for is_verified: true
Native balance off by 10^12Native USDC read with 6 decimalsNative = 18 decimals; only the ERC-20 interface is 6
Tx rejected / wrong chain on mainnetchainId mismatch (5042 vs 5042002)Read chain from the NETWORKS table for the active toggle
Circle 401/404 on mainnetTEST key used with blockchain ARCLIVE key + ARC blockchain id
Commit fails: file exceeds 10 MBLarge download written into the repoUpload with lovable-assets create, commit the .asset.json pointer
cirBTC balance off by 100×Hardcoded 1e6 conversionRead decimals from the TOKENS table (cirBTC is 8)
Privy modal shows USDC while approving EURC/cirBTCModal always shows the gas tokenRender your own pre-confirmation summary — not a bug
Approve step silently skippedToken address env unset → zero addressGate zero-address tokens in the switcher
Privy modal asks for ETHArc gas is USDCFund the wallet at faucet.circle.com → Arc Testnet
Privy crashes SSR / workerdStatic import of @privy-io/react-auth<ClientOnly> + React.lazy()
Payout fails with an opaque errorTreasury out of USDC gasSurface treasury address + balance + lowGas warning; refill at the faucet
Faucet drained mid-demoPer-payout amounts too large~$0.001 units, off-chain batching, settle at ~$0.50
CoinGecko 401Demo key sent to the pro hostDemo host + x-cg-demo-api-key header; keep a static fallback rate
"Claim"/action looks on-chain but isn'tUI-only stateAnchor it with a real contract call and show the Arcscan link
Mode/tab switch does nothing on the published siteMode mapping duplicated across routesCentralise mode → surface mapping in one component
Agent negotiation always ends in a refusalBudget hardcoded in the goal string, below every catalog priceDerive the budget from the live catalog at request time (cheapest in-policy item + headroom)
Seller agent refuses instead of counteringPrompt only gave it a list priceRender listUsd + floorUsd and forbid flat refusals — discount or substitute
Quote total off by ~1e6LLM returned minor units, not decimalsNormalise + clamp in code; re-derive the charged total from the catalog
Run ends with no quote and no explanationNo-deal outcome not modelledReturn { accepted: false, reason } and render the reason next to the transcript
Sticky header vanishes when a dropdown opens mid-scrollRadix menus default to modal, setting overflow:hidden + position:relative on <body>, which breaks the sticky containing blockmodal={false} on non-overlay menus (nav "More", currency toggle)
Prefilled agent goal fails against live pricesBudget hardcoded in the goal stringDerive it from the catalog; dirty-flag the input so edits stick
Run ledger reads as a wall of codeEvery payload rendered expandedCollapsible payloads + a summary bar with the receipt button
Judges ask "did anything actually settle?"No cross-mode transaction listOne shared client ledger written by every settlement path
Cart drawer feels crowded / pushes pay button below foldInline transaction history or settlement list inside the cartMove history to a dedicated route; keep the cart footer to totals, pay button, and a compact history link