MulticallTarget
Inherits: IMulticallTarget
Abstract contract template that supports batched calls while preserving msg.sender. Only calls with msg.value of 0 can be batched.
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
Name | Type | Description |
---|---|---|
data | bytes[] | List of ABI-encoded calldata for the calls to execute |
ignoreReverts | bool | Whether 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
Name | Type | Description |
---|---|---|
data | bytes[] | List of ABI-encoded calldata for the calls to execute |
ignoreReverts | bool | Whether to skip calls that revert |
Returns
Name | Type | Description |
---|---|---|
results | Result[] | List of results from the calls, each containing (success, returnData) |
_bubbleRevert
Bubbles the revert message from the underlying call. Note: preserves the same custom error or revert string, if one was used. Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.2/contracts/utils/Address.sol#L143-L158
function _bubbleRevert(bytes memory returnData) internal pure;
Errors
MulticallTarget__UndeterminedRevert
error MulticallTarget__UndeterminedRevert();