> For the complete documentation index, see [llms.txt](https://chaincontext.gitbook.io/help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaincontext.gitbook.io/help-center/building/connecting-contracts.md).

# Connecting Your Contracts

## Importing a contract

1. Navigate to your project → **Contracts** tab
2. Click **Import Contract**
3. Enter the contract address
4. Select the chain type: **EVM** or **Solana**

{% tabs %}
{% tab title="EVM" %}
ChainContext fetches the ABI from Etherscan API v2 (supports Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche, BNB Chain, and their testnets with a single API key).

**Proxy contracts:** If your contract is a proxy (EIP-1967), enable the **Resolve proxy** checkbox. ChainContext will read the implementation slot and fetch the implementation ABI automatically.

**Unverified contracts:** If the contract is not verified on Etherscan, you can paste the ABI JSON manually.
{% endtab %}

{% tab title="Solana" %}
ChainContext fetches Anchor IDLs directly from on-chain (reads the IDL PDA account, decompresses with zlib). No external API required for Anchor programs.

{% hint style="warning" %}
Solana programs without an Anchor IDL are not currently supported for auto-import. You can manually define tools with custom input schemas.
{% endhint %}
{% endtab %}
{% endtabs %}

## Networks

After importing a contract, attach one or more networks. Networks determine which blockchain RPCs your tools will call.

Each network has an **environment tag**: mainnet or testnet. Your project's **mode** (test or live) filters which networks are active at runtime:

* **Test mode** → only testnet networks are used
* **Live mode** → only mainnet networks are used

{% hint style="info" %}
You can attach both mainnet and testnet networks to a contract and switch between them by toggling the project mode. No need to re-import.
{% endhint %}

### Platform RPCs vs custom RPCs

ChainContext provides platform RPC endpoints for all supported networks at no extra cost. You can also provide your own RPC URL for any network — it will be encrypted (AES-256-GCM) before storage and decrypted only at deploy time.

## Labels

Each contract can have an optional label (e.g., "USDC", "Uniswap V3 Router") to help organize contracts within a project.

## Supported networks

### EVM

| Network      | Chain ID | Testnet                   |
| ------------ | -------- | ------------------------- |
| Ethereum     | 1        | Sepolia (11155111)        |
| Base         | 8453     | Base Sepolia (84532)      |
| Arbitrum One | 42161    | Arbitrum Sepolia (421614) |
| Optimism     | 10       | OP Sepolia (11155420)     |
| Polygon      | 137      | Amoy (80002)              |
| Avalanche    | 43114    | Fuji (43113)              |
| BNB Chain    | 56       | BNB Testnet (97)          |

### Solana

| Network        | ID  | Testnet             |
| -------------- | --- | ------------------- |
| Solana Mainnet | 900 | Solana Devnet (901) |
