> ## Documentation Index
> Fetch the complete documentation index at: https://tokenterminal.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To query the Token Terminal data catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# Registry

> One row per contract: the chain, the address, and its first deployment.

One row per contract's first deployment: one address on one chain, with the accounts behind its creation and the size of the code it deployed. It holds every contract we see onchain, far past the ones anyone has labeled, and [Accounts](/docs/catalog/accounts/registry) holds those labels.

## Columns

<table>
  <thead>
    <tr>
      <th width="280">Column</th>
      <th width="130">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>contract\_id</code></td>
      <td><code>INT64</code></td>
      <td>Fingerprint of <code>account\_id</code>, stable across runs.</td>
    </tr>

    <tr>
      <td><code>account\_id</code></td>
      <td><code>STRING</code></td>
      <td>Contract as an account: <code>\{contract\_address}-\{chain\_id}</code>. The same pair as one key, for joining <code>dimensions.accounts</code> and <code>dimensions.tokens</code>.</td>
    </tr>

    <tr>
      <td><code>chain\_id</code></td>
      <td><code>STRING</code></td>
      <td>Chain the contract is deployed on. With <code>contract\_address</code> it is the cluster key and the pair to filter on: the same address on two chains is two different contracts.</td>
    </tr>

    <tr>
      <td><code>contract\_address</code></td>
      <td><code>STRING</code></td>
      <td>Address of the contract, spelled the way its chain spells it: lowercase on EVM and Starknet, base58 and case-sensitive on Solana and Tron. Lowercase an EVM address copied from an explorer before matching it here.</td>
    </tr>

    <tr>
      <td><code>first\_deployed\_at</code></td>
      <td><code>TIMESTAMP</code></td>
      <td>Time the address first held code. An address can be created, destroyed with <code>SELFDESTRUCT</code> and created again; the row describes that first creation.</td>
    </tr>

    <tr>
      <td><code>deployer\_address</code></td>
      <td><code>STRING</code></td>
      <td>Account that signed the first deployment's transaction.</td>
    </tr>

    <tr>
      <td><code>creator\_address</code></td>
      <td><code>STRING</code></td>
      <td>Account that called <code>CREATE</code> on the first deployment. Equals <code>deployer\_address</code> for a direct creation, and differs where a factory contract creates on the signer's behalf.</td>
    </tr>

    <tr>
      <td><code>contract\_size</code></td>
      <td><code>FLOAT64</code></td>
      <td>Deployed bytecode size in bytes, on the first deployment.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Warning>
  The table is clustered on `chain_id` and `contract_address`, and every row is current rather than dated. Filter on the chain, and on the address where you have it; a query that filters on neither reads the whole table.
</Warning>

<Tabs>
  <Tab title="Look up a contract">
    Filter `chain_id` and `contract_address` together, since that pair is the cluster key. Lowercase an EVM address copied from an explorer before you paste it in.

    ```sql theme={null}
    select
        first_deployed_at,
        deployer_address,
        creator_address,
        contract_size
    from `dimensions.contracts`
    where chain_id = 'ethereum'
      and contract_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    ```
  </Tab>

  <Tab title="What one account deployed">
    `creator_address` is the account that called `CREATE`, so filtering it returns a factory's output; filter `deployer_address` instead for the contracts an account signed for.

    ```sql theme={null}
    select
        contract_address,
        first_deployed_at,
        contract_size
    from `dimensions.contracts`
    where chain_id = 'ethereum'
      and creator_address = '0x1f98431c8ad98523631ae4a59f267346ea31f984'
    order by first_deployed_at
    limit 100
    ```
  </Tab>

  <Tab title="Name a contract">
    `dimensions.accounts` holds the label, and the two tables join on `account_id`. An inner join keeps the contracts somebody has attributed, so the project filter reads against a labelled set.

    ```sql theme={null}
    select
        contracts.contract_address,
        contracts.first_deployed_at,
        accounts.project_id,
        accounts.contract_name
    from `dimensions.contracts` as contracts
    join `dimensions.accounts` as accounts
        using (account_id)
    where contracts.chain_id = 'ethereum'
      and accounts.project_id = 'uniswap'
    order by contracts.first_deployed_at
    limit 100
    ```
  </Tab>
</Tabs>
