Add Arc support - #1106
Add Arc support#1106j0ntz wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f49f9a7. Configure here.
Arc's native USDC has an optional ERC-20 view at 0x3600...0000 with 6 decimals of precision against the native 18. A transfer through that contract moves the native balance, but Alchemy reports it only as an erc20 row on the contract, and Etherscan only in tokentx, never as an external or internal transfer, so native history missed it. A network can now name that contract as nativeErc20Interface. A native sync on the Alchemy or evmscan adapter also reads the contract's transfers, scales each value to the native denomination, and sums them with the transaction's other native rows. The evmscan rows carry a zero gas price, since the same transaction's txlist row already has the fee.
Arc is Circle's EVM chain (5042) with USDC as its gas token. The native balance carries 18 decimals; USDC at 0x3600...0000 is an ERC-20 view of that same balance at 6 decimals, so it is named as the network's nativeErc20Interface rather than listed as a token, which would show the same money twice. History comes from Alchemy, with Etherscan V2 as the fallback and the only source in a build without an Alchemy key; both fold in interface transfers. EURC and cirBTC are the built-in tokens, each checked against the contract's name, symbol and decimals. The base fee holds near 20 gwei.
f49f9a7 to
4856604
Compare
|
Description update for 4856604: the "History source" bullet above is superseded. Arc's history comes from Alchemy with Etherscan V2 as the fallback, and Etherscan is the only source in a build without an Alchemy key. Both adapters fold in transfers through the 0x3600 interface: the evmscan native sync reads the interface's |

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Adds Arc (
arc), Circle's EVM chain 5042 with USDC as its gas token. History comes from the existing Alchemy key.Asana: https://app.asana.com/0/1215088146871429/1218563157181138
Arc's native balance is USDC at 18 decimals, and
0x3600000000000000000000000000000000000000is an ERC-20 view of that same balance at 6 decimals. A transfer through that contract moves native USDC, but Alchemy reports it only as anerc20row on 0x3600, never asexternalorinternal. Bridges deliver this way. The LI.FI funding receive in testing (0x223aa302…) exists on Alchemy only as a 0x3600 row; without the handling below, the wallet showed the balance with an empty history.nativeErc20Interface: a new network option naming that contract and its precision. A native Alchemy sync also reads the contract's transfers in both directions, scales them to 18 decimals, and sums them with the transaction's other native rows.scaleInterfaceTransfersis unit-tested with a real Arc transaction's values.Tested on the iOS sim with this branch's bundle (screenshots below): wallet creation, a LI.FI swap into Arc, a LI.FI swap out of Arc (approval plus swap), and a plain send. Each was checked against Alchemy and the chain.
Companion PRs:
jon/arc-chainin edge-react-gui, edge-exchange-plugins and edge-rates-server.Note
Medium Risk
Shared EVM history adapters gain new merge paths that affect reported native amounts and fees; mistakes would show wrong history, though behavior is gated on the new optional network flag and covered by tests.
Overview
Adds Arc (
arc, EVM chain 5042) as a USDC-native wallet plugin (Alchemy/RPC/Etherscan V2 adapters, built-in EURC and cirBTC, explorers and fees tuned for Arc). The native USDC interface at0x3600…0000is intentionally not a separate token so balances are not double-counted.Introduces optional
nativeErc20Interfaceon EVM network info for chains where native value moves only through an ERC-20 view at different decimals. Alchemy and EvmScan native history sync now also pull those contract transfers, scale amounts to native units, and merge them with regular/internal rows (EvmScan zeroes interface row gas so fees are not duplicated). EvmScan URL selection for token vs regular lists now keys offcontractAddressrather thantokenId.Unit tests cover scaling/merging for both adapters using real Arc-style transaction data.
Reviewed by Cursor Bugbot for commit 4856604. Bugbot is set up for automated code reviews on this repo. Configure here.
Test evidence
4856604Add Arc support
arc in create wallet
arc balance after funding
arc history send swap approval receive
arc wallet usdc symbol
arc send confirm
arc send result
arc history after keyless resync