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

# Contract Code

> Reference documentation for the Contract Code table in Hubble's Bronze data dictionary.

## Table Metadata

| Property | Configuration |
| - | - |
| Natural Key(s) | contract\_code\_hash, closed\_at |
| Partition Field(s) | closed\_at (MONTH partition) |
| Clustered Field(s) | last\_modified\_ledger, contract\_code\_hash |
| Documentation | [dbt docs](http://www.stellar-dbt-docs.com/#!/source/source.stellar_dbt_public.crypto_stellar.contract_code) |

## Column Details

| Name | Description | Data Type | Domain Values | Required? | Notes |
| - | - | - | - | - | - |
| contract\_code\_hash | Soroban contract code hash | string | | Yes | |
| contract\_code\_ext\_v | Contract code extension version | integer | | | |
| last\_modified\_ledger | The ledger sequence number when the ledger entry (this unique signer for the account) was modified. Deletions do not count as a modification and will report the prior modification sequence number | integer | | Yes | |
| ledger\_entry\_change | Code that describes the ledger entry change type that was applied to the ledger entry. | integer | | Yes | |
| deleted | Indicates whether the ledger entry (balance id) has been deleted or not. Once an entry is deleted, it cannot be recovered. | boolean | | Yes | |
| batch\_id | String representation of the run id for a given DAG in Airflow. Takes the form of `scheduled__<batch_end_date>-<dag_alias>`. Batch ids are unique to the batch and help with monitoring and rerun capabilities | string | | Yes | |
| batch\_run\_date | The start date for the batch interval. When taken with the date in the batch\_id, the date represents the interval of ledgers processed. The batch run date can be seen as a proxy of closed\_at for a ledger. | datetime | | Yes | |
| batch\_insert\_ts | The timestamp in UTC when a batch of records was inserted into the database. This field can help identify if a batch executed in real time or as part of a backfill | timestamp | | Yes | |
| closed\_at | Timestamp in UTC when this ledger closed and committed to the network. Ledgers are expected to close \~every 5 seconds | timestamp | | Yes | |
| ledger\_sequence | The sequence number of this ledger. It represents the order of the ledger within the Stellar blockchain. Each ledger has a unique sequence number that increments with every new ledger, ensuring that ledgers are processed in the correct order. | integer | | Yes | |
| ledger\_key\_hash | Ledger key hash used to identify expiring contract data or contract code ledger entries | string | | Yes | |
| n\_instructions | Number of instructions in contract code | integer | | | |
| n\_functions | Number of functions in contract code | integer | | | |
| n\_globals | Number of global variables in contract code | integer | | | |
| n\_table\_entries | Number of table entries in contract code | integer | | | |
| n\_types | Number of types in contract code | integer | | | |
| n\_data\_segments | Number of data segments in contract code | integer | | | |
| n\_elem\_segments | Number of element segments in contract code | integer | | | |
| n\_imports | Number of imports in contract code | integer | | | |
| n\_exports | Number of exports in contract code | integer | | | |
| n\_data\_segment\_bytes | Number of data segment bytes in contract code | integer | | | |
| ledger\_key\_hash\_base\_64 | The base64-encoded representation of the ledger key hash for this contract code entry. | string | | No | Same value as `ledger_key_hash`, encoded in base64 instead of hex. |
