---
eip: 6357
label: ERC-6357
title: Single-contract Multi-delegatecall
status: Last Call
type: Standards Track
category: ERC
created: 2023-01-18
official: https://eips.ethereum.org/EIPS/eip-6357
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6357.md
canonical: https://eips.huatuo.xyz/eip-6357/
lang: en
tldr: "Standardizes a multicall(bytes[]) function that lets an EOA run several functions of one contract in a single, all-or-nothing transaction."
tags: [multicall, batching, delegatecall, ux, interface]
---

# ERC-6357: Single-contract Multi-delegatecall

> Allows an EOA to call multiple functions of a smart contract in a single transaction

**TL;DR:** Standardizes a multicall(bytes[]) function that lets an EOA run several functions of one contract in a single, all-or-nothing transaction.

## What problem does it solve?

An externally owned account can only make one call per transaction. Sending five NFTs or paying three people from a token contract means five or three transactions, each paying the 21,000 base gas cost and each needing a separate signature. If one fails halfway, you are left in a partial state.

Many contracts (Uniswap's routers, OpenZeppelin's `Multicall`) already solved this with a `multicall` function. ERC-6357 standardizes that function so wallets and tools can rely on a single shape.

## How it works

The contract exposes:

```solidity
function multicall(bytes[] calldata data) external returns (bytes[] memory results);
```

Each element of `data` is ABI-encoded calldata for one of the contract's own functions. The contract `delegatecall`s itself with each item in order. Because it is a delegatecall to itself, `msg.sender` stays the original caller, so `transfer` and similar functions behave as if you had called them directly. The return data of each call is collected into `results`. If any call reverts, the whole multicall reverts.

An optional `multicallPayable(bytes[] data, uint256[] values)` assigns a share of `msg.value` to each call (the values must add up to at most `msg.value`). It is optional because splitting ETH safely is hard to get right.

It only batches calls to **the same contract**. Batching across contracts is the job of smart accounts or wallet APIs such as [EIP-5792](/eip-5792/).

## Sample code

Reference-style implementation (derived from OpenZeppelin):

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

abstract contract Multicall {
    function multicall(bytes[] calldata data) external returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            (bool ok, bytes memory ret) = address(this).delegatecall(data[i]);
            require(ok, "multicall: call failed");
            results[i] = ret;
        }
    }
}
```

Two [ERC-20](/eip-20/) transfers in one transaction (ethers v6):

```ts
const calls = [
  token.interface.encodeFunctionData("transfer", [addressA, amt]),
  token.interface.encodeFunctionData("transfer", [addressB, amt]),
];
await (await token.multicall(calls)).wait(); // both succeed or both revert
```

## Things to know

- **Status: Last Call** (deadline listed in the spec: 2023-11-10). It has not been marked Final.
- A naive `multicallPayable`, or a payable `multicall` that delegatecalls payable functions, lets each sub-call see the full `msg.value`, so an attacker could "spend" the same ETH several times. Don't make `multicall` payable unless you handle this.
- Many existing contracts already have a compatible `multicall(bytes[])`, so the selector is widely recognized.
- Like any delegatecall-based helper, it should only be used for the contract calling itself, never with user-supplied target addresses.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-6357
