Multicall
Code
Overview
Bundler3 is a call dispatcher that enables atomic execution of arbitrary calls with enhanced features for authorization management and callback handling.
-
The core
Bundler3contract implementsmulticall(Call[] calldata bundle), where each call is defined by:to: Target addressdata: Calldatavalue: Native currency amountskipRevert: Flag to skip reverting if this particular call failscallbackHash: Specifies the hash used for controlling reentrancy callbacks
-
Adapters all inherit from
CoreAdapter, which provides access to the initiator (the original caller) via transient storage. This mechanism allows adapters to enforce strict permission checks (e.g. only acting on behalf of the initiator). -
Chain-specific adapters, such as
EthereumGeneralAdapter1, extend the baseGeneralAdapter1to support network-specific features (e.g. stETH on Ethereum). -
Specialized adapters target specific integrations:
ParaswapAdapterfor DEX aggregation (buy/sell/swaps)- Migration adapters for moving user positions between protocols (Aave, Compound, Morpho, etc.)
