Skip to main content

fetch_transaction_contracts_bytecode_via_rpc

Function fetch_transaction_contracts_bytecode_via_rpc 

Source
async fn fetch_transaction_contracts_bytecode_via_rpc<N: Network, P: Provider<N>>(
    provider: &P,
    result: &TraceResult,
    tx_hash: B256,
    block: BlockId,
) -> Result<AddressHashMap<Bytes>>
Expand description

Fetches bytecode for a mined transaction at its exact transaction index.

The prestate tracer provides the code that existed immediately before the transaction, which avoids reading end-of-block state for contracts changed or removed by later transactions. Any address absent from the prestate (for example, a contract created by this transaction) falls back to eth_getCode at the transaction’s block.