> ## 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 Fraxtal, with the account that created it.

`dimensions.contracts` holds one row per contract deployed on Fraxtal, 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`](https://tokenterminal.com/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](https://tokenterminal.com/docs/catalog/contracts/registry.md).

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

> [tab] Look up a contract
>
> **When one Fraxtal 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 = 'fraxtal'
>   and contract_address = '0x99b8e50ca5c266a23773c90ddaf054098a0d4316'
> ```

> [tab] A factory's output
>
> **List the contracts one factory created.** This factory deploys contracts in bulk, so `creator_address` returns its output.
>
> ```sql theme={null}
> select
>     contract_address,
>     first_deployed_at,
>     contract_size
> from `dimensions.contracts`
> where chain_id = 'fraxtal'
>   and creator_address = '0x642635ce9ed5d50d9d94d07c406e92142e71d6cb'
> order by first_deployed_at
> limit 100
> ```

> [tab] Token contracts
>
> **Date the token contracts on Fraxtal.** 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 = 'fraxtal'
>   and contracts.first_deployed_at >= timestamp('2024-02-01')
> order by contracts.first_deployed_at desc
> limit 100
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.