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

# starknet.events

> StarkNet contract events — event data emitted by Cairo smart contracts during execution.

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

## Table description

The `starknet.events` table captures the events that are emitted by smart contracts on the Starknet blockchain. Events are used to log significant actions and changes in smart contracts, such as token transfers or updates to contract states. Each event is linked to the transaction that triggered it, providing a detailed audit trail of contract interactions.

## Table Schema

| Column                           | Type               | Description                                              |
| -------------------------------- | ------------------ | -------------------------------------------------------- |
| `block_date`                     | `DATE`             | The date of the block containing this event (UTC)        |
| `block_time`                     | `TIMESTAMP`        | The timestamp of the block containing this event         |
| `block_number`                   | `BIGINT`           | The sequential number of the block containing this event |
| `block_l1_da_mode`               | `VARCHAR`          | Layer 1 data availability mode (`BLOB` or `CALLDATA`)    |
| `block_l1_data_gas_price_in_fri` | `UINT256`          | L1 data gas price in fri (STRK) for the block            |
| `block_l1_data_gas_price_in_wei` | `UINT256`          | L1 data gas price in wei (ETH) for the block             |
| `block_l1_gas_price_in_fri`      | `UINT256`          | L1 gas price in fri (STRK) for the block                 |
| `block_l1_gas_price_in_wei`      | `UINT256`          | L1 gas price in wei (ETH) for the block                  |
| `block_l2_gas_price_in_fri`      | `UINT256`          | L2 gas price in fri (STRK) for the block                 |
| `block_l2_gas_price_in_wei`      | `UINT256`          | L2 gas price in wei (ETH) for the block                  |
| `block_starknet_version`         | `VARCHAR`          | The Starknet protocol version of the block               |
| `event_index`                    | `INTEGER`          | Sequential index of this event within the transaction    |
| `block_hash`                     | `VARBINARY`        | Hash of the block containing this event                  |
| `block_new_root`                 | `VARBINARY`        | New global state root after the block                    |
| `block_parent_hash`              | `VARBINARY`        | Hash of the preceding block                              |
| `block_sequencer_address`        | `VARBINARY`        | Address of the sequencer that produced the block         |
| `transaction_hash`               | `VARBINARY`        | Hash of the transaction that emitted this event          |
| `data`                           | `ARRAY(VARBINARY)` | The data payload associated with this event              |
| `keys`                           | `ARRAY(VARBINARY)` | The indexed keys associated with this event              |
| `from_address`                   | `VARBINARY`        | Address of the L2 contract that emitted this event       |
| `class_hash`                     | `VARBINARY`        | Class hash of the contract that emitted this event       |

<Note>
  * Prior to [v3 transactions upgrade](https://www.starknet.io/developers/roadmap/v3-transactions/), fees are denominated in `wei` as users pay gas with ETH. For transactions v3 and later, fees are denominated in `fri` as users pay gas with STRK. Hence here you can see two gas types of gas fields, one for `wei` and one for `fri`.
  * Starting with Starknet v0.13.1, Starknet distinguishes between blocks whose state diffs are sent to L1 as calldata and blocks whose state diffs are sent to L1 as blobs. The `l1_da_mode` property in the Starknet block header contains this information. Values possible are `BLOB` or `CALLDATA`.
  * The `block_status` has possible values `ACCEPTED_ON_L1` or `ACCEPTED_ON_L2`. Read here to learn more about [different transaction status](https://docs.starknet.io/architecture-and-concepts/network-architecture/transaction-life-cycle/#transaction_status).
  * `from_address`: The address of the L2 contract sending the message
  * `keys`: The keys associated with the event
  * `data`: The data associated with the event
  * Visit this [Starknet doc on events](https://docs.starknet.io/architecture-and-concepts/smart-contracts/starknet-events/) to learn more.
</Note>

## Table Sample

<TableSample tableSchema="starknet" tableName="events" />
