Expand description
Commonly used contract types and functions.
Re-exportsΒ§
use crate::compile::PathOrContractInfo;πuse crate::find_metadata_start;πuse crate::strip_bytecode_placeholders;πuse alloy_dyn_abi::JsonAbiExt;πuse alloy_json_abi::Event;πuse alloy_json_abi::Function;πuse alloy_json_abi::JsonAbi;πuse alloy_primitives::Address;πuse alloy_primitives::B256;πuse alloy_primitives::Bytes;πuse alloy_primitives::Selector;πuse alloy_primitives::address;πuse alloy_primitives::hex;πuse alloy_primitives::hex;πuse eyre::OptionExt;πuse eyre::Result;πuse foundry_compilers::ArtifactId;πuse foundry_compilers::Project;πuse foundry_compilers::ProjectCompileOutput;πuse foundry_compilers::artifacts::BytecodeObject;πuse foundry_compilers::artifacts::CompactBytecode;πuse foundry_compilers::artifacts::CompactContractBytecode;πuse foundry_compilers::artifacts::CompactContractBytecodeCow;πuse foundry_compilers::artifacts::CompactDeployedBytecode;πuse foundry_compilers::artifacts::ConfigurableContractArtifact;πuse foundry_compilers::artifacts::ContractBytecodeSome;πuse foundry_compilers::artifacts::Offsets;πuse foundry_compilers::artifacts::StorageLayout;πuse foundry_compilers::utils::canonicalized;πuse std::collections::BTreeMap;πuse std::ops::Deref;πuse std::path::Path;πuse std::path::PathBuf;πuse std::str::FromStr;πuse std::sync::Arc;π
StructsΒ§
- Bytecode
Data - Subset of [CompactBytecode] excluding sourcemaps.
- Contract
Data - Container for commonly used contract data.
- Contracts
ByArtifact - Wrapper type that maps an artifact to a contract ABI and bytecode.
- Contracts
ByArtifact Builder - Builder for creating a
ContractsByArtifactinstance, optionally including storage layouts from project compile output.
ConstantsΒ§
- CALL_
PROTECTION_ πBYTECODE_ PREFIX - Librariesβ runtime code always starts with the following instruction:
PUSH20 0x0000000000000000000000000000000000000000 - LIBRARY_
DEPLOYER - Isolated account used to deploy libraries needed only while executing locally.
FunctionsΒ§
- bytecode_
diff_ score - compact_
to_ contract - Helper function to convert CompactContractBytecode ~> ContractBytecodeSome
- count_
different_ π βbytes - Returns the amount of different bytes between two slices.
- find_
matching_ contract_ artifact - Returns the target artifact given the path and name.
- find_
target_ path - Returns the canonicalized target path for the given identifier.
- get_
contract_ name - Returns contract name for a given contract identifier.
- get_
file_ name - This returns the
file namepart, Seeget_contract_name - matches_
contract_ creation - Very simple fuzzy matching of contract bytecode.
- normalize_
offsets π - Sorts and merges overlapping or adjacent byte ranges.
Type AliasesΒ§
- Artifact
With πContract Ref - Contracts
ByAddress - Wrapper type that maps an address to a contract identifier and contract ABI.