Table Description
Thelogs table represents the logs generated by the Tron Virtual Machine (TVM) when a contract is executed. Logs are a way to store data on the blockchain. Logs originate from events that occur during the execution of a smart contract. A log consists of:
- topic list: a list of 0 to 4 32-byte data topics.
Topic0is the hash of the signature of the event (indexed), and the remaining topics are indexed parameters of the event. - data: contains non-indexed data.
Table Schema
| Column | Type | Description |
|---|---|---|
| block_time | timestamp(3) | The exact UTC timestamp when the block containing this log was added to the chain |
| block_number | bigint | The sequential number of the block containing this log |
| block_hash | varbinary | Unique identifier (hash) of the block containing this log |
| contract_address | varbinary | Address of the smart contract that emitted this log |
| topic0 | varbinary | First 32-byte topic, typically the keccak256 hash of the event signature |
| topic1 | varbinary | Second 32-byte topic, containing the first indexed event parameter |
| topic2 | varbinary | Third 32-byte topic, containing the second indexed event parameter |
| topic3 | varbinary | Fourth 32-byte topic, containing the third indexed event parameter |
| data | varbinary | ABI-encoded data containing non-indexed event parameters |
| tx_hash | varbinary | Unique identifier (hash) of the transaction that generated this log |
| index | integer | Position of this log within the block |
| tx_index | integer | Position of the parent transaction within its containing block |
| block_date | date | The UTC date of the block in which this log was included |
| tx_from | varbinary | Address of the account that initiated the transaction containing this log |
| tx_to | varbinary | Address of the recipient account or contract for the transaction containing this log |