> For the complete documentation index, see [llms.txt](https://docs.delegate.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delegate.xyz/upgrade-to-v2/batching.md).

# Batching

The `multicall()` method in V2 registry lets users queue up multiple delegations and submit them all in a single transaction. This is more gas-efficient and saves user time.

The function is simple, use a frontend library to pack each method call into its bytes representation then submit an array of byte function calls. This can be used for both writes and reads.

```
function multicall(bytes[] calldata data) external payable override returns (bytes[] memory results) {
    results = new bytes[](data.length);
    bool success;
    unchecked {
        for (uint256 i = 0; i < data.length; ++i) {
            //slither-disable-next-line calls-loop,delegatecall-loop
            (success, results[i]) = address(this).delegatecall(data[i]);
            if (!success) revert MulticallFailed();
        }
    }
}
```
