Multicall
Inherits: IMulticall
Title: Multicall
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Multicall.sol)
Thin Diamond facet that enables batched calls in a single transaction.
All logic lives in MulticallLib. This contract is stateless and has no initializer. Inherit this in your Diamond facet to enable multicall functionality.
Notes:
- lattice-version: 0.1.0
- lattice-source: OpenZeppelin v5.1.0
Functions
multicall
Batch multiple calls to this contract in a single transaction.
Each call is executed via delegatecall so it runs in the context of the calling contract.
If any call reverts, the entire batch reverts with the same revert data.
function multicall(bytes[] calldata data) public virtual returns (bytes[] memory results);Parameters
| Name | Type | Description |
|---|---|---|
| data | bytes[] | An array of calldata payloads to execute. |
Returns
| Name | Type | Description |
|---|---|---|
| results | bytes[] | An array of return data from each call, in the same order as data. |
exportSelectors
ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).
Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches
forge inspect Multicall methodIdentifiers (alphabetical by signature); kept in exact parity by
ExportSelectorsParityTest. Chunks:
multicall(bytes[]) 0xac9650d8
function exportSelectors() external pure virtual returns (bytes memory selectors);Returns
| Name | Type | Description |
|---|---|---|
| selectors | bytes |