Skip to main content

Module logs

Module logs 

Source

Re-exportsΒ§

use super::MAX_CONCURRENT_RPC_REQUESTS; πŸ”’
use crate::args::encode_event_topic; πŸ”’
use alloy_consensus::BlockHeader; πŸ”’
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; πŸ”’

StructsΒ§

LogQueryArgs
Arguments shared by commands that query logs with eth_getLogs.
LogsArgs
CLI arguments for cast logs.

FunctionsΒ§

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.