---
eip: 8349
label: ERC-8349
title: Index-Based Multi-Facet Proxy
status: Draft
type: Standards Track
category: ERC
created: 2026-07-25
requires: 165
official: https://eips.ethereum.org/EIPS/eip-8349
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8349.md
canonical: https://eips.huatuo.xyz/eip-8349/
lang: en
tldr: "A multi-facet proxy design ('Cento') that routes calls by a one-byte facet index appended to calldata instead of by function selector, so routing data scales with modules rather than functions."
tags: [proxy, upgradeability, modular, delegatecall, standard]
---

# ERC-8349: Index-Based Multi-Facet Proxy

> A modular proxy architecture that uses compact facet indices for protocol routing while preserving function selectors for compatibility.

**TL;DR:** A multi-facet proxy design ('Cento') that routes calls by a one-byte facet index appended to calldata instead of by function selector, so routing data scales with modules rather than functions.

## What problem does it solve?

Multi-facet proxies such as [ERC-2535](/eip-2535/) Diamonds (and the simpler [ERC-8167](/eip-8167/)) keep one contract address but split logic across many "facets". They decide which facet runs by looking up the 4-byte **function selector**. That means:

- the routing table grows with every exported function, not with the number of modules;
- every upgrade has to update entries selector by selector, even when a whole facet is swapped;
- independently written facets must never expose the same selector.

ERC-8349 argues that "which module runs" and "which function is called" are separate concerns, and gives facets an explicit identity of their own.

## How it works

The proposal calls its routing model **Cento**. The proxy ("router") supports two paths:

- **Protocol Routing.** The caller appends **one byte**, a routing index from 0 to 255, to the end of the calldata. The router reads it, looks up the facet in its routing table, strips the byte and `delegatecall`s the facet with the original calldata. The facet sees a normal call, so existing Solidity code works unchanged, and selectors only need to be unique *within* a facet.
- **Compatibility Routing.** Standard interfaces that wallets and tools call without an index (for example [ERC-165](/eip-165/) `supportsInterface` or [ERC-173](/eip-173/) `owner`) are recognised by selector and mapped to the right index. How the router tells the two paths apart is implementation-specific; the spec's example uses odd vs. even calldata length.

Management and introspection:

- `atomicUpdate(setF, addI, remI, migrator, data)` installs, replaces or removes facets, registers or unregisters ERC-165 interface IDs and optionally runs a storage migration via `delegatecall`, all or nothing, and emits `AtomicUpdate`.
- `IObservability` exposes `getFacets`, `getFacetEntries`, `getFacetAt`, `getFacetCount` and `getFirstFreeSlot`.
- Routers start with three core facets: index 0 facet manager, index 1 ownership, index 2 ERC-165 plus observability.

## Sample code

Calling a protocol function through the router by appending the facet index (ethers v6):

```ts
import { Interface, concat, toBeHex, Contract } from "ethers";

const vaultFacet = new Interface(["function deposit(uint256 amount)"]);
const VAULT_INDEX = 3; // routing index assigned to this facet

const data = concat([
  vaultFacet.encodeFunctionData("deposit", [1_000n]),
  toBeHex(VAULT_INDEX, 1),               // one trailing routing byte
]);
await signer.sendTransaction({ to: ROUTER, data });

// Compatibility path: no index byte, plain selector call
const router = new Contract(ROUTER, ["function getFacetAt(uint8) view returns (address)"], provider);
console.log(await router.getFacetAt(VAULT_INDEX));
```

## Things to know

- **Status: Draft.**
- Calls through Protocol Routing need the extra byte, so generic tooling that only knows the facet ABI will not reach those functions unless it appends the index.
- Routers should reject EOAs, code-less addresses and [EIP-7702](/eip-7702/) delegated EOAs as facets (the reference implementation checks for the `0xef0100` prefix), and must never delegate to `address(0)` or themselves.
- Empty calldata must not reach the fallback; stripping an index from zero bytes can underflow and burn all gas. Provide a `receive()` or an explicit length check.
- Gate `atomicUpdate` with strong access control, consider time-locks, and use namespaced storage such as [ERC-7201](/eip-7201/) to avoid facet storage collisions.
- It is not compatible with selector-based Diamonds; both models are intended to coexist.


---

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