Skip to content

feat(evm): add XDC Network (50) and XDC Apothem testnet (51) default assets#217

Open
AnilChinchawale wants to merge 1 commit into
coinbase:mainfrom
AnilChinchawale:feat/add-xdc-network
Open

feat(evm): add XDC Network (50) and XDC Apothem testnet (51) default assets#217
AnilChinchawale wants to merge 1 commit into
coinbase:mainfrom
AnilChinchawale:feat/add-xdc-network

Conversation

@AnilChinchawale

Copy link
Copy Markdown

Summary

Adds XDC Network mainnet (eip155:50) and XDC Apothem testnet (eip155:51) to the EVM default-asset registries, following DEFAULT_ASSETS.md. This lets USD-string pricing (price: "$0.10") resolve to native USDC on XDC out of the box, across all three SDKs.

Changes

Per the cross-SDK checklist in DEFAULT_ASSETS.md, same CAIP-2 key / address / EIP-712 name+version / decimals in each:

SDK File Map
TypeScript typescript/packages/mechanisms/evm/src/shared/defaultAssets.ts DEFAULT_STABLECOINS
Go go/mechanisms/evm/constants.go NetworkConfigs (+ ChainIDXDC/ChainIDXDCApothem vars)
Python python/x402/mechanisms/evm/constants.py NETWORK_CONFIGS

Asset selection & on-chain-verified values

XDC's default asset is native Circle USDC — Circle launched native USDC + CCTP V2 on XDC Network in August 2025 (native issuance, not a bridge wrapper). Native USDC implements EIP-3009 transferWithAuthorization, so the default exact scheme works with no Permit2 fallback required.

The EIP-712 domain values below were read directly from the token contracts on-chain (not from docs), since DEFAULT_ASSETS.md requires name/version to match the domain separator exactly:

XDC mainnet (eip155:50) XDC Apothem (eip155:51)
Address 0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1 0xb5AB69F7bBada22B28e79C8FFAECe55eF1c771D4
name() USDC USDC
version() 2 2
decimals() 6 6
EIP-3009 authorizationState() present → supported present → supported

⚠️ Note: the EIP-712 domain name on XDC USDC is "USDC", not "USD Coin" as on some chains. Using the wrong name would break signature verification, so it is set to "USDC" here.

Validation

  • Go: go build ./mechanisms/evm/ and go vet ./mechanisms/evm/ pass; gofmt clean.
  • Python: python -m py_compile on constants.py passes.
  • TypeScript: entries mirror the existing DEFAULT_STABLECOINS shape exactly.
  • The addresses, EIP-712 domain, and EIP-3009 support were verified via eth_call/eth_getCode against XDC mainnet (https://rpc.xdc.org) and Apothem (https://rpc.apothem.network).

Ecosystem note

XDC mainnet already has the canonical Permit2 (0x0000…78BA3) and the x402 exact-permit2 proxy (0x402085…0001) deployed, so both the EIP-3009 and Permit2 paths are viable there. (Multicall3 is not yet deployed on XDC; flagging in case facilitator batch-verification relies on it.)

This follows DEFAULT_ASSETS.md exactly (the three registry files). Happy to add a changeset or touch the legacy/e2e network tables if maintainers would like parity there.

…assets

Registers XDC Network mainnet and Apothem testnet in the EVM default-asset
registries (TypeScript, Go, Python) so USD-string pricing ("$0.01") resolves
to native USDC on XDC.

XDC has native Circle USDC (not bridged) with EIP-3009
transferWithAuthorization, so the default exact scheme works without Permit2.
EIP-712 domain values were read on-chain:

- mainnet (eip155:50): 0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1,
  name "USDC", version "2", 6 decimals
- apothem (eip155:51): 0xb5AB69F7bBada22B28e79C8FFAECe55eF1c771D4,
  name "USDC", version "2", 6 decimals

Note: the EIP-712 domain name is "USDC" (not "USD Coin").
Native USDC + CCTP V2 launched on XDC in Aug 2025.
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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

Development

Successfully merging this pull request may close these issues.

2 participants