Skip to main content

Module selectors

Module selectors 

Source
Expand description

Support for handling/identifying selectors.

Re-exportsΒ§

use crate::abi::abi_decode_calldata; πŸ”’
use crate::provider::runtime_transport::RuntimeTransportBuilder; πŸ”’
use alloy_json_abi::JsonAbi; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::Selector; πŸ”’
use alloy_primitives::map::HashMap; πŸ”’
use eyre::Context; πŸ”’
use itertools::Itertools; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Serialize; πŸ”’
use serde::Serialize; πŸ”’
use serde::de::DeserializeOwned; πŸ”’
use std::fmt; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::atomic::AtomicBool; πŸ”’
use std::sync::atomic::AtomicUsize; πŸ”’
use std::sync::atomic::Ordering; πŸ”’
use std::time::Duration; πŸ”’

StructsΒ§

Artifact πŸ”’
OpenChainClient
A client that can request API data from OpenChain.
ParsedSignatures
PossibleSigs
RawSelectorImportData
SelectorImportEffect πŸ”’
SelectorImportRequest πŸ”’
SelectorImportResponse
SelectorImportResult πŸ”’
Signature πŸ”’
SignatureResponse πŸ”’
SELECTOR_LOOKUP_URL response.
SignatureResult πŸ”’

EnumsΒ§

SelectorImportData
SelectorKind
The kind of selector to fetch from OpenChain.
SelectorOrSig

ConstantsΒ§

BASE_URL πŸ”’
MAX_TIMEDOUT_REQ πŸ”’
How many request can time out before we decide this is a spurious connection.
REQ_TIMEOUT πŸ”’
The standard request timeout for API requests.
SELECTOR_IMPORT_BODY_LIMIT πŸ”’
The selector registry uses Express’s default 100 KiB JSON body limit.
SELECTOR_IMPORT_SIGNATURE_LIMIT πŸ”’
The selector registry accepts at most this many signatures of each kind per database insert.
SELECTOR_IMPORT_URL πŸ”’
SELECTOR_LOOKUP_URL πŸ”’

FunctionsΒ§

decode_calldata
Fetches all possible signatures and attempts to abi decode the calldata using OpenChain.
decode_event_topic
Fetches an event signature given the 32 byte topic using OpenChain.
decode_function_selector
Fetches a function signature given the selector using OpenChain.
decode_selector
Decodes the given function or event selector using OpenChain.
decode_selectors
Decodes the given function or event selectors using OpenChain.
import_selectors
uploads selectors to OpenChain using the given data
parse_signatures
Parses a list of tokens into function, event, and error signatures. Also handles JSON artifact files Ignores invalid tokens
pretty_calldata
Pretty print calldata and if available, fetch possible function signatures.

Type AliasesΒ§

OpenChainSignatures
List of signatures for a given SelectorKind.