Overview
- Dataset ID:
0121 - Contracts
- Description: Smart contracts discovered via CREATE/CREATE2 internal transactions. Uses
contract_id (26 bytes = address + creation_block + tx_index) as primary key to support metamorphic contracts (e.g. CREATE–SELFDESTRUCT–CREATE2 in the same block).
- Sample: Hugging Face Sample
Parameters
Target EVM network. See the Chain enumeration for supported values.
Range Filters (mutually exclusive with direct selectors)
Starting block number (inclusive) for the query. Use with to_block.
Ending block number (inclusive) for the query. Use with from_block.
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used. Use with to_timestamp.
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used. Use with from_timestamp.
Validation rule:
You must provide either a block range, a time range, block_numbers, or contract_addresses.
Providing both range selectors and explicit selectors results in HTTP 400.
Providing none also results in HTTP 400.
Direct Selectors
Filter by specific deployed contract addresses (hex string, 20 bytes, no 0x prefix). Up to 256 addresses per request.
Explicit list of block heights to fetch contract deployments from. Mutually exclusive with the range filters.
Recommended default 250; maximum 1000 to stay under ~10 MB responses.
Opaque pagination cursor supplied by a previous response.
Response Fields
Echo of request metadata applied to the response.
EVM chain ID echoed from the request.
Block/timestamp bounds derived from the request.
Filters echoed from the request (contract addresses, block numbers, limit).
Data
Each element mirrors the table columns (chain implied by meta.chain_id).
EVM Chain ID for the record.
Unique contract incarnation ID (hex string, 26 bytes, no 0x prefix): 20 bytes address + 4 bytes creation block + 2 bytes tx_index. Use for metamorphic disambiguation and to join with function-results.
Deployed contract address (hex string, 20 bytes, no 0x prefix). Use for address-based lookups.
Block height containing the contract creation.
ISO-8601 UTC timestamp of the creation block, joined from the blocks dataset.
Zero-based index of the deployment transaction within the block.
Position in the call tree (e.g., "0", "0.0", "0.1.2").
Address that deployed the contract (msg.sender of CREATE/CREATE2). Hex string, 20 bytes, no 0x prefix.
Type of creation: CREATE or CREATE2.
Internal tracing identifier for lineage tracking (hex string, no 0x prefix).
Timestamp when BlockDB materialized the record.
Timestamp of the latest update to the record.
Envelope Fields
Pagination cursor to continue the query.
Number of records in the current page.
Use Cases
- Look up the canonical creation block for a contract address before hydrating additional metadata.
- Backfill on-chain analyses that require the deployment timestamp or transaction location.
- Seed lineage exploration using
_tracing_id to pivot into /evm/logs and /evm/transactions.
curl -X POST "https://api.blockdb.io/v1/evm/raw/contracts" \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 1,
"contract_addresses": [
"1234567890abcdef1234567890abcdef12345678"
],
"block_numbers": [
18934001,
18934222
],
"from_block": 18933000,
"to_block": 18936000,
"from_timestamp": null,
"to_timestamp": null,
"limit": 200,
"cursor": null
}'
{
"meta": {
"chain_id": 1,
"request_window": {
"from_block": 18933000,
"to_block": 18936000,
"from_timestamp": null,
"to_timestamp": null
},
"filters": {
"contract_addresses": [
"1234567890abcdef1234567890abcdef12345678"
],
"block_numbers": [
18934001,
18934222
]
}
},
"data": [
{
"chain_id": 1,
"contract_id": "1234567890abcdef1234567890abcdef1234567800121a0700",
"contract_address": "1234567890abcdef1234567890abcdef12345678",
"block_number": 18934221,
"block_time": "2024-04-01T12:34:56Z",
"tx_index": 7,
"trace_address": "0",
"creator_address": "0000000000000000000000000000000000000000",
"creation_call_type": "CREATE2",
"_tracing_id": "0121000000000000000000000000000000000001",
"_created_at": "2025-11-11T18:42:15.123Z",
"_updated_at": "2025-11-11T18:42:15.123Z"
}
],
"cursor": null,
"count": 1
}