IMulticallTarget

Git Source

Interface for a contract that supports multiple calls from the same caller. Inspired by MulticallV3: https://github.com/mds1/multicall/blob/master/src/Multicall3.sol

Functions

multicallNoResults

Executes multiple calls to this contract in a single transaction while preserving msg.sender. Return data from the calls is discarded.

This method is non-payable, so only calls with msg.value of 0 can be batched. If ignoreReverts is set to true, reverted calls will be skipped. Otherwise, the entire batch will revert with the original revert reason.

function multicallNoResults(bytes[] calldata data, bool ignoreReverts) external;

Parameters

NameTypeDescription
databytes[]List of ABI-encoded calldata for the calls to execute
ignoreRevertsboolWhether to skip calls that revert

multicallWithResults

Executes multiple calls to this contract in a single transaction while preserving msg.sender. Return data from each call is preserved.

This method is non-payable, so only calls with msg.value of 0 can be batched. If ignoreReverts is set to true, reverted calls will be skipped. Otherwise, the entire batch will revert with the original revert reason.

function multicallWithResults(bytes[] calldata data, bool ignoreReverts) external returns (Result[] memory results);

Parameters

NameTypeDescription
databytes[]List of ABI-encoded calldata for the calls to execute
ignoreRevertsboolWhether to skip calls that revert

Returns

NameTypeDescription
resultsResult[]List of results from the calls, each containing (success, returnData)

Structs

Result

struct Result {
    bool success;
    bytes returnData;
}