Skip to main content Module logs Copy item path Source use super::MAX_CONCURRENT_RPC_REQUESTS ; π use crate::args::encode_event_topic ; π use alloy_dyn_abi::EventExt; π use alloy_dyn_abi::Specifier; π use alloy_ens::NameOrAddress; π use alloy_json_abi::Event; π use alloy_json_rpc::RpcError; π use alloy_network::AnyNetwork; π use alloy_network::BlockResponse; π use alloy_network::Network; π use alloy_primitives::Address ; π use alloy_primitives::B256 ; π use alloy_primitives::TxHash ; π use alloy_provider::Provider; π use alloy_rpc_types::BlockId; π use alloy_rpc_types::BlockNumberOrTag; π use alloy_rpc_types::Filter; π use alloy_rpc_types::FilterBlockOption; π use alloy_rpc_types::Log; π use alloy_rpc_types::Topic; π use clap::Parser; π use eyre::Result ; π use foundry_cli::opts::RpcOpts ; π use foundry_cli::utils ; π use foundry_cli::utils::LoadConfig ; π use foundry_common::fmt::UIfmt ; π use foundry_common::fmt::format_token ; π use foundry_common::shell ; π use futures::FutureExt; π use futures::StreamExt; π use futures::TryStreamExt; π use futures::future::Either; π use std::fmt::Write as _; π use std::io::Write as _; π use std::str::FromStr ; π use tokio::signal::ctrl_c; π LogQueryArgs Arguments shared by commands that query logs with eth_getLogs. LogsArgs CLI arguments for cast logs. build_filter π Builds a Filter by first trying to parse the sig_or_topic as an event signature. If
successful, topics_or_args is parsed as indexed inputs and converted to topics. Otherwise,
sig_or_topic is prepended to topics_or_args and used as raw topics. convert_block_number π event_topics π Encodes args as the indexed topics of event; empty arguments match any value. Anonymous
events have no selector topic, so their indexed inputs start at the first topic. format_log π format_log_params π Formats decoded event parameters in declaration order. format_logs π get_logs_bisecting π Fetches logs for the inclusive [from, to] range, recursively bisecting on failure. get_logs_chunked π Retrieves logs, splitting the request into fixed-size block chunks when needed. get_logs_chunked_concurrent π Retrieves logs for the inclusive [from, to] range using concurrent chunked requests. is_range_limit_error π Returns true if err is a provider range/result-size limit that retrying over a smaller
range can fix. Network, auth, rate-limit, and malformed-response errors return false. raw_topics π Parses raw topic hashes; empty topics match any value. resolve_block_range π Resolves the filterβs block range to concrete block numbers. resolve_block_tag π Resolves a [BlockNumberOrTag] to a concrete block number, querying the provider for tags.