> ## 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.

# Contracts

> Every contract deployed on Base, with the account that created it.

`dimensions.contracts` holds one row per contract deployed on Base, keyed on `chain_id` and `contract_address`. The row describes the address's first deployment: the time it appeared, the account that signed for it, the account that called `CREATE`, and the size of the deployed bytecode. The list is everything we see onchain, which reaches far past the contracts anyone has labeled: joining [`dimensions.accounts`](/docs/catalog/accounts/registry) on `account_id` keeps the result to addresses a project has been attributed, and names them.

Every column is documented at [Contracts](/docs/catalog/contracts/registry).

## Sample queries

<Warning>
  The table is clustered on `chain_id` and `contract_address`, and those two columns are all that prunes a scan of it. 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">
    **When one Base contract was first deployed, and by whom.**

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

  <Tab title="A factory's output">
    **List the contracts one factory created.** The XEN torrent minter calls `CREATE` for every mint it batches, so `creator_address` returns its output.

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

  <Tab title="Token contracts">
    **Date the token contracts on Base.** Joining `dimensions.tokens` on `account_id` gives each token's symbol beside the day its contract first appeared.

    ```sql theme={null}
    select
        tokens.symbol,
        contracts.contract_address,
        contracts.first_deployed_at
    from `dimensions.contracts` as contracts
    join `dimensions.tokens` as tokens
        on tokens.token_id = contracts.account_id
    where contracts.chain_id = 'base'
      and contracts.first_deployed_at >= timestamp('2023-06-01')
    order by contracts.first_deployed_at desc
    limit 100
    ```
  </Tab>
</Tabs>
