Monitoring API Reference
The below reference informs you on what features are available in our Schema in order to enable you to write optimal TSQL.
Functions:
block_timestamp
<network>.block_timestamp(block_number bigint)
Returns the timestamp of a block.
Example Usage:
select ethereum.block_timestamp(1)
| BLOCK_TIMESTAMP |
|---|
| 2015-07-30T15:26:28+00:00 |
get_storage
<network>.get_storage(address text, position text)
Returns the hex representation of the value stored at a specific storage slot of a contract at the latest block.
Example Usage:
select * from ethereum.get_storage('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', '0x0') s
| s |
|---|
| 0x577261707065642045746865720000000000000000000000000000000000001a |
get_chain_id
<network>.get_chain_id()
Returns the chain id of the current network.
Example Usage:
select ethereum.get_chain_id()
| GET_CHAIN_ID |
|---|
| 1 |
Note: This was run with Ethereum selected
get_historical_block_number(bigint interval timestamp with time zone)
<network>.get_historical_block_number(start bigint, inter interval, _now timestamp with time zone default now()) returns bigint
Returns the block number given an interval of time in the past and the start block.
Example Usage:
select ethereum.get_historical_block_number(1700000, interval '1 days')
| GET_HISTORICAL_BLOCK_NUMBER |
|---|
| 1692846 |
get_historical_block_number(interval timestamp with time zone)
<network>.get_historical_block_number(inter interval, _now timestamp with time zone default now()) returns bigint
Returns the block number given an interval of time in the past.
Example Usage:
select ethereum.get_historical_block_number(interval '1 day')
| GET_HISTORICAL_BLOCK_NUMBER |
|---|
| 18534695 |
get_schema_name
<network>.get_schema_name() returns character varying
Returns the currently used blockchain network for monitoring.
Example Usage:
select ethereum.get_schema_name()
| GET_SCHEMA_NAME |
|---|
| ethereum |
last_block_number
<network>.last_block_number() returns bigint
Returns the last block number in the network.
Example Usage:
select ethereum.last_block_number()
| LAST_BLOCK_NUMBER |
|---|
| 18534695 |
safe_block_timestamp
<network>.safe_block_timestamp(block_num bigint) returns bigint
Returns the unix timestamp of a block.
Example Usage:
select ethereum.safe_block_timestamp(1)
| SAFE_BLOCK_TIMESTAMP |
|---|
| 1438269988 |
to_usd_value
<network>.to_usd_value(amount numeric, token_address bytea) returns numeric
Returns the USD value of an amount of token.
Example Usage:
select ethereum.to_usd_value(1e18, '\x6b175474e89094c44da98b954eedeac495271d0f')
| TO_USD_VALUE |
|---|
| 1 |
tx_hash
<network>.tx_hash(block_number bigint, tx_index integer) returns bytea
Returns the transaction hash given a block number and transaction index.
Example Usage:
select ethereum.tx_hash(1500000, 0)
| TX_HASH |
|---|
| be03790872e51ef0ffe1b5d741bdaa09b4e158a579f721da0725ace53b55b87f |
address_to_bytea
address_to_bytea(address varchar) returns common.ethaddress
Transforms an eth address represented as text to an equivalent byte array.
Example Usage:
select address_to_bytea('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
| address_to_bytea |
|---|
| 0xD8DA6BF26964AF9D7EED9E03E53415D37AA96045 |
address_to_varchar
address_to_varchar(address common.ethaddress) returns varchar
Transforms an eth address represented as a byte array to an equivalent varchar address.
Example Usage:
select address_to_varchar('\xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
| address_to_varchar |
|---|
| 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 |
RPC fetch functions
You can send HTTP GET, POST or PUT requests to a remote REST service.
http_get
http_get(url text, params jsonb DEFAULT NULL::jsonb, headers jsonb DEFAULT NULL::jsonb) returns varchar
It will send an HTTP GET request. The result will be a varchar that can be further processed
Example Usage:
SELECT http_get(
url=>'https://api.geckoterminal.com/api/v2/tokens/info_recently_updated',
params=>'{"include":"network","network":"eth"}',
headers=>'{"Content-Type": "application/json"}');
| http_get |
|---|
{"data":[{"id":"solana_5Nu2hLo3ffU4fs2yVtsCvAT7ymysuYs5NSFRpvLMVSBi"...}]} |
http_get_json
http_get_json(url text, params jsonb DEFAULT NULL::jsonb, headers jsonb DEFAULT NULL::jsonb) returns jsonb
It will send an HTTP GET request. It assumes that the response to the GET request is a json string
Example Usage:
SELECT http_get_json(
url=>'https://api.geckoterminal.com/api/v2/tokens/info_recently_updated',
params=>'{"include":"network","network":"eth"}',
headers=>'{"Content-Type": "application/json"}');
| http_get_json |
|---|
{"data":[{"id":"solana_5Nu2hLo3ffU4fs2yVtsCvAT7ymysuYs5NSFRpvLMVSBi"... |
http_get_json_array
http_get_json_array(url text, params jsonb DEFAULT NULL::jsonb, headers jsonb DEFAULT NULL::jsonb) returns setof jsonb
It will send an HTTP GET request. It assumes that the response to the request is a json array
Example Usage:
SELECT common.http_get_json_array('https://api.dedaub.com/api/contracts/ethereum/trending');
| http_get_json_array |
|---|
{"name": "Wrapped Ether", "nonce": 0, "address": ... |
{"name": "Tether USD", "nonce": 0, "address": ... |
{"name": "FiatTokenV2_2", "nonce": 0, "address": ... |
http_post
http_post(url text, params jsonb DEFAULT NULL::jsonb, headers JSONB DEFAULT NULL::jsonb, body jsonb DEFAULT NULL::jsonb) returns varchar
It will send an HTTP POST request. It returns a varchar representing the response
Example Usage:
SELECT http_post(
url=>'https://docs-demo.quiknode.pro',
body=>'{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'::jsonb,
headers=>'{"Content-Type": "application/json"}'::jsonb);
| http_post |
|---|
{"jsonrpc":"2.0","id":1,"result":"0x1"} |
http_put
http_put(url text, params jsonb DEFAULT NULL::jsonb, headers JSONB DEFAULT NULL::jsonb, body jsonb DEFAULT NULL::jsonb) returns varchar
It will send an HTTP PUT request. It returns a varchar representing the response
Example Usage:
SELECT http_put(
'https://jsonplaceholder.typicode.com/posts/1',
body=>'{"id": 1, "title": "foo", "body": "bar", "userId": 1}',
headers=>'{"Content-Type": "application/json; charset=UTF-8"}');
| http_put |
|---|
{"id": 1, "body": "bar","title": "foo","userId": 1} |
Gadgets:
block
{{ <network>.block(duration: Optional['5m', '1h', '24h', '3d'] = '24h', start_time: Optional['YYYY-MM-DDTHH:MM:SS'] = 'now()') }}
Returns an interval of blocks from block.
Example Usage:
select block_number from {{ ethereum.block(duration='5m') }} _
| BLOCK_NUMBER |
|---|
| 18542144 |
| 18542145 |
| 18542146 |
| 18542147 |
| ... |
contracts
{{ <network>.contracts(protocols: Optional[list[str]] = None) }}
Returns a list of contracts from contracts.
Example Usage:
select address from {{ ethereum.contracts(protocols=['Maker']) }} _
| ADDRESS |
|---|
| 004b750a71f1aa80150b18ecd510e6abf7e25480 |
| 00efe35880071c16832b3ad135885e7746adf889 |
| 010df1cd88f927c8a77f39265c3eac634ec072c0 |
| ... |
contract_list
{{ contract_list(name:str, owner: str = query_creator) }}
Returns a contracts present in a contract list with the same name and owner. If no owner is provided, it defaults to the user creating the query.
Example Usage:
select address
from {{contract_list('Alchemist','contract_list_user')}} _
| ADDRESS |
|---|
| 004b750a71f1aa80150b18ecd510e6abf7e25480 |
| 00efe35880071c16832b3ad135885e7746adf889 |
| 010df1cd88f927c8a77f39265c3eac634ec072c0 |
| ... |
eth_call
{{ <network>.eth_call('address.function(args...)', outputs='types...') }}
Call any function on the currently active network, returns the outputs as defined by the user.
Example Usage:
select * from {{ethereum.eth_call('0x6B175474E89094C44Da98b954EedeAC495271d0F.name( )', outputs='(string a)')}} _
| Result |
|---|
| Dai Stablecoin |
Example Usage with args:
WITH a(x) AS (
SELECT '0x0000000000000000000000000000000000000000'
)
select {{ethereum.eth_call('0x6B175474E89094C44Da98b954EedeAC495271d0F.balanceOf(address x)', outputs='uint256 out')}} as out
from a
| OUT |
|---|
| 9.236207899175045e+21 |
logs
{{ <network>.logs(inputs: Optional[str] = None, duration: Optional['5m', '1h', '24h', '3d'] = '24h', only_committed: Optional[boolean] = true)) }}
Returns a list of logs from logs.
Example Usage:
select address from {{ ethereum.logs(inputs="Transfer(address indexed from,address indexed to,uint256 value)") }} _ limit 1
| ADDRESS |
|---|
| a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 |
outer_transaction
{{ <network>.outer_transaction(duration: Optional['5m', '1h', '24h', '3d'] = '24h', , start_time: Optional['YYYY-MM-DDTHH:MM:SS'] = 'now()') }}
Returns a list of transactions from outer_transaction.
Example Usage:
select tx_hash from {{ ethereum.outer_transaction(duration='5m') }} _
| TX_HASH |
|---|
| ae7eece7472193a630676e513d73dfac5fb4c38ff1c62141ac7ea3a04a40ee83 |
| b61f251d9497d312503e8036cb737f8ee47d8b011a6a0494b66523243ec2a902 |
| c168b67816c2da913b628693b65ca71ea4d839c810bf9759c94d4820d5e07a25 |
| ... |
token_ledger
{{ <network>.token_ledger(duration: Optional['5m', '1h', '24h', '3d'] = '24h', start_time: Optional['YYYY-MM-DDTHH:MM:SS'] = 'now()') }}
Returns a list of token_ledger entries from token_ledger.
Example Usage:
select token_address from {{ ethereum.token_ledger(duration='5m') }} _
| TOKEN_ADDRESS |
|---|
| eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| dac17f958d2ee523a2206206994597c13d831ec7 |
| ... |
token_transfers
{{ <network>.token_transfers(duration: Optional['5m', '1h', '24h', '3d'] = '24h', start_time: Optional['YYYY-MM-DDTHH:MM:SS'] = 'now()') }}
Returns a list of token_transfers from token_transfers.
Example Usage:
select token_address from {{ ethereum.token_transfers(duration='5m') }} _
| TOKEN_ADDRESS |
|---|
| eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| dac17f958d2ee523a2206206994597c13d831ec7 |
| ... |
transaction_detail
{{ <network>.transaction_detail(inputs: Optional[str] = None, outputs: Optional[str] = None, duration: Optional['5m', '1h', '24h', '3d'] = '24h', only_committed: Optional[boolean] = true)) }}
Returns a list of transaction_detail entries from transaction_detail.
Example Usage:
select gas_used from {{ ethereum.transaction_detail('transmit(bytes,bytes32[],bytes32[],bytes32)', duration='5m') }} _
| GAS_USED |
|---|
| 144515 |
| 144515 |
| 144427 |
| ... |
is_ancestor
{{ is_ancestor(ancestor_tx: transaction_detail, descendant_tx: transaction_detail) }}
returns all a list of all transactions that are descendants of the ancestor_tx including the ancestor_tx.
Example Usage:
select td1.block_number, td1.tx_index, td1.vm_step_start from {{ ethereum.transaction_detail() }} td1
join {{ ethereum.transaction_detail() }} td2 on {{ is_ancestor("td1", "td2") }} order by td1.block_number desc, td1.tx_index desc, td1.vm_step_start desc
| BLOCK_NUMBER | TX_INDEX | VM_STEP_START |
|---|---|---|
| 18563576 | 109 | 2724 |
| 18563576 | 109 | 0 |
| 18563576 | 101 | 3441 |
| ... |
is_parent
{{ is_parent(parent_tx: transaction_detail, child_tx: transaction_detail) }}
is_parent is a strict subset of is_ancestor, that can be considered as is_caller for the stack frame. transaction_detail.
Example Usage:
select td1.block_number, td1.tx_index, td1.vm_step_start from {{ ethereum.transaction_detail() }} td1
join {{ ethereum.transaction_detail() }} td2 on {{ is_parent("td1", "td2") }} order by td1.block_number desc, td1.tx_index desc, td1.vm_step_start desc
| BLOCK_NUMBER | TX_INDEX | VM_STEP_START |
|---|---|---|
| 18563576 | 109 | 2724 |
| 18563576 | 109 | 0 |
| 18563576 | 101 | 3441 |
| ... |
Tables:
Keyword reference:
Address: '\x' + 40 hex charactersSignature: Textual format of the function signatureSelector: '\x' + 8 hex characters
Table types:
Addresses
- key data type:
Address - Involved Tables
Blocks
- Unique key:
block_number - Involved Tables:
Contracts
- Unique key:
md5_bytecode - Involved Tables:
Selectors
- Key data type:
Selector - Involved Tables:
Tokens
- Unique key:
token_address - Involved Tables:
Transactions
- Unique key:
block_number,tx_index - Involved Tables:
Network Tables:
block
select * from <network>.block
Contains information about the blocks in a network.
Columns
gas_used::numeric- The amount of gas used by the block.ts::timestamp with time zone- Timestamp of when the block was mined.coinbase::bytea- The address of the miner of the block.transactions::bytea[]- Transactions included in the block.base_fee_per_gas::numeric- The base fee per gas in the block.gas_limit::numeric- The gas limit of the block.parent_hash::bytea- The hash of the parent block.block_number::bigint- The number of the block.block_hash::bytea- The hash of the block._ts::timestamp with time zone- Timestamp of the block data entry.extra_data::bytea- Extra data included in the block.size::integer- The size of the block in bytes.nonce::numeric- The nonce that was used to mine the block.difficulty::numeric- The difficulty of the block.
Primary Key: block_number
Table type: blocks
bytecode
select * from <network>.bytecode
Contains information about the bytecode of contracts.
Columns
md5_bytecode::bytea- Used as unique key_ts- Timestamp of when the bytecode was first seenbytecode::bytea- The bytecode of the contractcodehash::bytea- keccak256 hash of the bytecode
Primary Key: md5_bytecode
Table type: Contracts
contracts
select * from <network>.contracts
Contains information about the contracts in a network.
Columns
tx_index_destroyed::integer- Transaction index where the contract was destroyed.block_number_destroyed::bigint- Block number where the contract was destroyed.tx_index::integer- Transaction index where the contract was created.block_number::bigint- Block number where the contract was created.deployer::bytea- Address of the account that deployed the contract._ts::timestamp with time zone- Timestamp of when the contract was deployed.md5_bytecode::bytea- MD5 hash of the contract's bytecode.address::bytea- Address of the contract.
Primary Key: address
Table type: Contracts, Addresses
decompiled_code
select * from <network>.decompiled_code
Contains decompiled solidity-like code of contracts.
Columns
_ts::timestamp with time zone- Timestamp of the decompiled code entry.disassembled_level::text- Disassembled level of the code.tac_level::text- Three Address Code level of the code.yul_level::text- Yul level representation of the code.source_level::text- High-level source code representation.contract_name::text- Name of the contract.md5_bytecode::bytea- MD5 hash of the bytecode.array_function_selectors::bytea[]- Array of function selectors.array_error_selectors::bytea[]- Array of error selectors.array_event_selectors::bytea[]- Array of event selectors.- Primary Key:
md5_bytecode - Table type: Contracts
outer_transaction
select * from <network>.outer_transaction
Contains overall details of each transaction in a network. Full details can be found in the transaction_detail table.
Columns
max_fee_per_gas::numeric- Maximum fee per gas willing to be paid.tx_type::smallint- Type of the transaction. ()nonce::integer- Transaction nonce.callvalue::numeric- Value being called in the transaction.status::boolean- Status of the transaction success or failure.addresses_selectors_involved::bytea- Addresses and selectors involved in the transaction.gas_refund::numeric- Gas refunded after the transaction.intrinsic_gas::numeric- Gas used by the transaction itself.gas_price::numeric- Price of gas for the transaction.gas_used::numeric- Total gas used by the transaction.max_priority_fee::numeric- Maximum priority fee per gas.to_a::bytea- Address of the recipient.gas::numeric- Gas limit for the transaction.from_a::bytea- Address of the sender.tx_hash::bytea- Hash of the transaction.tx_index::integer- Index of the transaction in the block.block_number::bigint- Block number of the transaction.contract_address::bytea- Address of the contract created by the transaction, if any.
Primary Key: block_number, tx_index
Table type: Transactions, Addresses
transaction_detail
select * from <network>.transaction_detail
Contains information about each call in a transaction.
Columns
block_number::bigint- Block number of the transaction.tx_index::integer- Index of the transaction in the block.callvalue::numeric- Value called in the transaction.committed::boolean- Whether the transaction was committed.vm_step_start::integer- VM step number when the transaction started.caller_vm_step_stack::integer[]- Stack of VM steps of the caller.sender_vm_step_ptr::smallint- Pointer to VM step of the sender.vm_steps::integer- Number of VM steps involved in the transaction.caller_pc::integer- Program counter of the caller.error::transaction_error- Error occurred during the transaction, if any. ('ErrInvalidSubroutineEntry', 'ErrOutOfGas', 'ErrCodeStoreOutOfGas', 'ErrDepth', 'ErrInsufficientBalance', 'ErrContractAddressCollision', 'ErrExecutionReverted', 'ErrMaxCodeSizeExceeded', 'ErrInvalidJump', 'ErrWriteProtection', 'ErrReturnDataOutOfBounds', 'ErrGasUintOverflow', 'ErrInvalidRetsub', 'ErrReturnStackExceeded', 'ErrInvalidCode', 'Unknown')gas::numeric- Gas limit for the transaction.gas_used::numeric- Total gas used by the transaction.from_a::bytea- Address of the sender.to_a::bytea- Address of the recipient.calldata::bytea- Data sent along with the transaction.returndata::bytea- Data returned by the transaction.call_opcode::opcode- Opcode of the call. ('CALL', 'CALLCODE', 'DELEGATECALL', 'STATICCALL', 'CREATE', 'CREATE2')
Primary Key: block_number, tx_index
Table type: Transactions, Address
logs
select * from <network>.logs
Contains information about the logs emitted by contracts.
Columns
block_number::bigint- Block number where the log was emitted.topic0::bytea- Main topic of the log entry. Often containing the event signature.topic1::bytea- First topic of the log entry.topic2::bytea- Second topic of the log entry.topic3::bytea- Third topic of the log entry.data::bytea- Data contained in the log.address::bytea- Address of the contract that emitted the log.committed::boolean- Whether the log was committed.log_index::integer- Index of the log entry in the block.vm_step_start::integer- VM step when the log was started.vm_step::integer- VM step when the log was emitted.tx_index::integer- Index of the transaction in the block.
Primary Key: block_number, tx_index, log_index
Table type: Transactions, Selectors
token_ledger
select * from <network>.token_ledger
Contains information about the transfers of tokens across addresses.
Columns
tx_index::integer- Index of the transaction in the block.block_number::bigint- Block number of the transaction.vm_step::integer- VM step number where transfer occurred.address::bytea- Address involved in the transaction.token_address::bytea- Address of the token contract.value_delta::numeric- Change in the amount of tokens due to the transaction.counterparty_address::bytea- Address of the counterparty in the transaction.type::text- Type of the ledger entry. (NATIVE | ERC20)vm_step_start::integer- VM step number when the transaction started.
Table type: Transactions, Tokens, Addresses
token_balance
select * from <network>.token_balance
Contains realtime information of all address token balances.
Columns
block_number::bigint- Block number at which the balance was last updated.token_address::bytea- Address of the token contract.owner_address::bytea- Address of the token owner.value::numeric- Amount of tokens owned.
Primary Key: token_address, owner_address
Table type: Addresses, Tokens
network_token_info
select * from <network>.network_token_info
Contains information about the tokens in a network.
Columns
logo_medium::character varying- URL to the medium-sized logo of the token.logo_small::character varying- URL to the small-sized logo of the token.token_info_ts::timestamp without time zone- Timestamp of the token information entry.ts::timestamp without time zone- Timestamp when the token info was updated.last_total_supply::numeric- Last known total supply of the token.last_cap::double precision- Last known market cap of the token.last_price::double precision- Last known price of the token.presentation_symbol::character varying- Presentation symbol of the token.symbol::character varying- Symbol of the token.token_name::character varying- Name of the token.token_address::bytea- Address of the token contract.decimals::smallint- Number of decimals for the token.logo_large::character varying- URL to the large-sized logo of the token.
Primary Key: token_address
Table type: Tokens
token_transfers
select * from <network>.token_transfers
Similar to token_ledger but instead of address and counterparty, it contains from and to addresses with an absolute value.
Columns
vm_step_start::integer- VM step number when the transfer started.block_number::bigint- Block number of the transfer.type::text- Type of the transfer.value::numeric- Amount of tokens transferred.to_a::bytea- Address of the recipient.from_a::bytea- Address of the sender.token_address::bytea- Address of the token contract.vm_step::integer- VM step number when the transfer occurred.tx_index::integer- Index of the transaction in the block.
Table type: Transactions, Tokens, Addresses
token_allowance
select * from <network>.token_allowance
Contains information about the allowances of tokens across addresses.
Columns
value::numeric- Amount of tokens allowed to be spent.token_address::bytea- Address of the token contract.owner_address::bytea- Address of the token owner.spender_address::bytea- Address of the spender.block_number::bigint- Block number at which the allowance is set.
Primary Key: token_address, owner_address, spender_address
Table type: Tokens, Addresses, Blocks
proxy_implementation
select * from <network>.proxy_implementation
Contains information about which implementation a proxy is pointing to.
Columns
_ts::timestamp with time zone- Timestamp of the proxy implementation entry.proxy_address::bytea- Address of the proxy.implementation_address::bytea- Address of the implementation contract.proxy_type::proxy_type- Type of the proxy. (MINIMAL, IMPLEMENTATION, FORWARDING, UPGRADEABLE, EIP1967, UUPS, BEACON, UNKNOWN, ADMIN_UPGRADEABLE, DIAMOND)transitive_address::bytea- Address of the transitive implementation, if applicable.
Table type: Addresses
protocol_contract
select * from <network>.protocol_contract
Contains information on which protocol a contract makes part of.
Columns
protocol_id::integer- Identifier for the protocol.user_id::integer- Identifier for the user.address::bytea- Address of the protocol contract.
Table type: Addresses
vulnerability
select * from <network>.vulnerability
Contains information about vulnerabilities found in contracts.
Columns
confidence::confidence- Confidence level of the vulnerability. (Highest, High, Medium+, Medium, Low)visibility::visibility- Visibility of the vulnerability. (Watchdog)code_location_type::text- Type of code location of the vulnerability. (bytecode)reachable_from::bytea[]- Array of points from which the vulnerability is reachable.code_location::integer[]- Array of code locations of the vulnerability.callstacks::jsonb- Callstacks associated with the vulnerability.debug_messages::text[]- Debug messages associated with the vulnerability.md5_bytecode::bytea- MD5 hash of the bytecode.vulnerability_type::character varying- Type of the vulnerability.vulnerability_owner::integer- Owner identifier of the vulnerability. (-1)_ts::timestamp with time zone- Timestamp of the vulnerability entry.
Primary Key: md5_bytecode, vulnerability_type, vulnerability_owner
Table type: Contracts
Common Tables:
alternative_token_address
select * from alternative_token_address
Contains information about alternative addresses of tokens.
Columns
token_address::bytea- Address of the token contract.chain_id::integer- Identifier for the blockchain._ts::timestamp without time zone- Timestamp of the token address entry.main_chain_id::integer- Identifier for the main chain of the token.main_token_address::bytea- Address of the main token contract.
Table type: Tokens
code
select * from code
Contains all source information attributed to a specific md5_bytecode
Columns
array_error_signatures::text[]- Array of error signatures.md5_bytecode::bytea- MD5 hash of the bytecode.contract_name::text- Name of the contract.json_abi::jsonb- JSON representation of the contract's ABI.source_map::text- Source map for the contract code.json_storage_layout::jsonb- JSON representation of the contract's storage layout.compiler::text- Compiler used to compile the contract.json_settings::jsonb- JSON representation of the compiler settings.array_function_selectors::bytea[]- Array of function selectors.array_event_selectors::bytea[]- Array of event selectors.array_error_selectors::bytea[]- Array of error selectors.array_function_signatures::text[]- Array of function signatures.array_event_signatures::text[]- Array of event signatures.yul_level::text- Yul level representation of the code.visibility::visibility- Visibility of the contract code. ('PUBLIC', 'WATCHDOG', 'USER', 'PRIVATE')_ts::timestamp with time zone- Timestamp of the code entry.json_function_debug_info::jsonb- JSON representation of the function debug information.json_immutable_references::jsonb- JSON representation of the contract's immutable references.
Table type: Contracts
Note: The actual source code is in the source table which can be joined on
source_idfrom the codes_sources table.
codes_sources
select * from codes_sources
Contains all source information attributed to a specific md5_bytecode
Columns
file_id::integer- Identifier for the source file.filename::text- Name of the source file.source_id::bytea- Identifier for the source entry.md5_bytecode::bytea- MD5 hash of the bytecode.referenced::boolean- Whether the source is referenced.main::boolean- Whether the source is the main file.
Table type: Contracts
contract_name_apis
select * from contract_name_apis
Contains information about the function selectors of a contract.
Columns
array_selectors::bytea[]- Array of selectors related to the contract's API.contract_name::text- Name of the contract.
error_selector_signature
select * from error_selector_signature
Contains information about the error selectors of a contract.
Columns
name::text- Name of the error.type::text- Type of the error. (error)inputs::jsonb- JSON representation of the error inputs.selector::bytea- Selector for the error.signature::text- Signature of the error.
Table type: Selectors
event_selector_signature
select * from event_selector_signature
Contains information about the event selectors of a contract.
Columns
inputs::jsonb- JSON representation of the event inputs.indexes::jsonb- JSON representation of the event indexes.type::text- Type of the event.signature::text- Signature of the event.selector::bytea- Selector for the event.name::text- Name of the event.
Table type: Selectors
function_selector_signature
select * from function_selector_signature
Contains information about all the known function signatures in the database.
Columns
outputs::jsonb- JSON representation of the function outputs.inputs::jsonb- JSON representation of the function inputs.type::text- Type of the function.payable::boolean- Whether the function is payable.name::text- Name of the function.signature::text- Signature of the function.constant::boolean- Whether the function is constant.selector::bytea- Selector for the function.stateMutability::text- State mutability of the function.
Table type: Selectors
historical_token_price
select * from historical_token_price
Contains historical price data of tokens.
Columns
price::double precision- Historical price of the token.chain_id::integer- Blockchain identifier where the token exists.token_address::bytea- Address of the token contract.total_supply::numeric- Total supply of the token at the time.cap::double precision- Market cap of the token at the time.ts::timestamp with time zone- Timestamp of the historical price data.
Table type: Tokens
inspected_vulns_code
select * from inspected_vulns_code
Contains information about inspections done by human auditors.
Columns
md5_bytecode::bytea- MD5 hash of the bytecode.vulnerability_state::vulnerability_state_code- State of the vulnerability. ('FP', 'UNKNOWN', 'TP')recommendations::text- Recommendations for addressing the vulnerability.inspection_details::text- Details of the inspection.inspector_id::integer- Identifier of the inspector.vulnerability_type::character varying- Type of the vulnerability._ts::timestamp with time zone- Timestamp of the vulnerability inspection entry.
Table type: Contracts
inspected_vulns_environment
select * from inspected_vulns_environment
Contains information about the environment of an inspection on a vuln done by human auditors.
Columns
inspection_details::text- Details of the environment inspection.vulnerability_type::character varying- Type of the vulnerability.address::bytea- Address related to the vulnerability.chain_id::integer- Blockchain identifier._ts::timestamp with time zone- Timestamp of the environmental vulnerability inspection.vulnerability_state::vulnerability_state_environment- State of the environmental vulnerability. ('SAFE/STATE', 'SAFE/TEMPORAL', 'UNKNOWN', 'UNSAFE', 'EXPLOITED')recommendations::text- Recommendations for the environmental vulnerability.inspector_id::integer- Identifier of the inspector.
Table type: Addresses
network
select * from network
Contains information about each network
Columns
_ts::timestamp with time zone- Timestamp of the network entry.native_token_address::bytea- Address of the native token of the network.visibility::visibility- Visibility state of the network. ('PUBLIC', 'WATCHDOG', 'USER', 'PRIVATE')is_poa_chain::boolean- Indicates if the network is a Proof of Authority chain.is_mainnet::boolean- Indicates if the network is the mainnet.json_token_info::jsonb- JSON representation of the network's token information.json_db_connection::jsonb- JSON representation of the network's database connection details.json_web3_rpc_endpoints::jsonb- JSON representation of the network's web3 RPC endpoints.block_explorer_transactions_url::text- URL of the network's block explorer transactions page.block_explorer_contracts_url::text- URL of the network's block explorer contracts page.etherscan_host_url::text- Etherscan host URL for the network.logo_small::text- Small-sized logo URL of the network.long_network_name::text- Full name of the network.network_name::text- Common name of the network.chain_id::integer- Identifier for the blockchain network.
protocol
select * from protocol
Contains information about each protocol.
Columns
logo_large::text- Large-sized logo URL of the protocol.protocol_id::integer- Identifier for the protocol.logo_medium::text- Medium-sized logo URL of the protocol.logo_small::text- Small-sized logo URL of the protocol.website::text- Website URL of the protocol.user_created::integer- User identifier who created the protocol entry.protocol_name::text- Name of the protocol.
sha3_pre_images
select * from sha3_pre_images
Contains preimages of SHA3 hashes.
Columns
preimage::bytea- Original data before the SHA3 hash.hash::bytea- SHA3 hash of the preimage.
source
select * from source
Contains the source code for each source_id
Columns
source_id::bytea- Identifier for the source entry.generated::boolean- Indicates if the source was generated.source::text- The actual source code text.
token_info
select * from token_info
Columns
token_name::character varying- Name of the token.chain_id::integer- Identifier for the blockchain where the token exists._ts::timestamp without time zone- Timestamp of the token information entry.explorer_links::character varying[]- Array of explorer links for the token.logo_large::character varying- URL for the large-sized logo of the token.description::character varying- Description of the token.logo_medium::character varying- URL for the medium-sized logo of the token.logo_small::character varying- URL for the small-sized logo of the token.decimals::smallint- The number of decimals the token uses.symbol::character varying- The ticker symbol of the token.presentation_symbol::character varying- The symbol presented for the token.token_address::bytea- The blockchain address of the token contract.
Table type: Tokens
vulnerability_metadata
select * from vulnerability_metadata
Contains metadata about vulnerabilities.
Columns
kind::text- The kind of the vulnerability.cwe::text- Always Empty.further_resources_urls::text[]- Array of URLs for further resources on the vulnerability.severity::severity- The severity level of the vulnerability. ('ADVISORY', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL')description::text- A text description of the vulnerability.vulnerability_type::text- The type of the vulnerability.