Skip to main content

Module multicall

Module multicall 

Source
Expand description

Multicall3 batching support for EvmCache.

This module provides utilities to batch multiple view calls into a single EVM execution using the Multicall3 contract. This significantly reduces the number of RPC round-trips needed when loading related contract state.

Multicall3 is deployed at the same address on all EVM chains: 0xcA11bde05977b3631167028862bE2a173976CA11

Modules§

IMulticall3
Multicall3 contract interface. See: https://github.com/mds1/multicall

Structs§

MulticallBatch
A batch of calls to execute in a single aggregate3 invocation via Multicall3.

Constants§

MAX_BATCH_SIZE
Maximum number of calls to batch in a single aggregate3 invocation.
MULTICALL3_ADDRESS
Multicall3 contract address (same on all EVM chains).

Functions§

decode_result
Decode a single multicall IMulticall3::Result into the call’s typed return.
execute_batched
Execute multiple calls in batches using Multicall3.
try_decode_result
Like decode_result, but returns None instead of an Err when the call did not succeed or its return data fails to decode.