---
eip: 8317
label: EIP-8317
title: Contract Storage Layout Descriptor Format
status: Draft
type: Standards Track
category: Interface
created: 2026-06-25
requires: 7201, 7730, 8042
official: https://eips.ethereum.org/EIPS/eip-8317
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8317.md
canonical: https://eips.huatuo.xyz/eip-8317/
lang: en
tldr: "A language-neutral JSON format describing where each contract variable lives in storage, including namespaced and diamond layouts, so wallets and explorers can turn raw slot changes into 'Balance of Alice went from 10 to 5'."
tags: [storage, tooling, wallets, clear-signing, json]
---

# EIP-8317: Contract Storage Layout Descriptor Format

> Defines a language-neutral, extensible JSON format for describing the storage layout of EVM contracts

**TL;DR:** A language-neutral JSON format describing where each contract variable lives in storage, including namespaced and diamond layouts, so wallets and explorers can turn raw slot changes into 'Balance of Alice went from 10 to 5'.

## What problem does it solve?

A transaction simulation tells you which raw storage slots changed: `(contract, slot, old, new)`. To show a user something meaningful, a wallet must know which variable each slot belongs to. Today tools lean on Solidity's `storageLayout` compiler output, which has problems:

- It is Solidity-specific (type IDs like `t_uint256`), and other languages do not emit it.
- Solidity documents it as experimental and subject to change.
- It cannot describe layouts the compiler does not know about, such as [ERC-7201](/eip-7201/) namespaced storage or [ERC-8042](/eip-8042/) diamond storage, nor hand-written assembly contracts.

This EIP defines one stable schema for storage layouts so wallets, explorers, debuggers and security tools can share descriptors, for example to explain the effect of a transaction or of [EIP-7906](/eip-7906/) transaction assertions.

## How it works

A layout file is JSON with three required parts:

- `compiler`: `language` (`"Solidity"`, `"Vyper"` or `"manual"` for Huff/Yul/assembly) and optional version and settings.
- `storage`: ordered entries, each with `label`, `slot` (decimal string), byte `offset`, `type`, and optionally `path`, `source` (`"compiler"` or `"manual"`), `baseSlotDerivation` and `display`.
- `types`: type definitions with an `encoding` (`inplace`, `inplace_struct`, `mapping`, `dynamic_array`, `bytes`), a source-level `label` and `numberOfBytes`.

Key ideas:

- **Verifiable base slots.** `baseSlotDerivation` names the scheme (`erc7201`, `erc8042` or `custom`) and the namespace ID, so a consumer can recompute the slot instead of trusting it.
- **Normative derivation formulas** per language and encoding, for example Solidity mappings at `keccak256(abi.encode(key, baseSlot))`, and Vyper's differences (inline `bytes`, reversed key order before Vyper 0.3.0).
- **Packed variables** are extracted using `offset` and `numberOfBytes`.
- **Display annotations** reuse the [ERC-7730](/eip-7730/) vocabulary: labels with `{key[N]}`/`{index[N]}` placeholders, value formatters such as `tokenAmount`, and templates with JSON Logic conditions.
- Transient storage is out of scope since it does not outlive the transaction.

## Sample code

A minimal descriptor for an ERC-20 balance mapping:

```json
{
  "compiler": { "language": "Solidity", "version": "0.8.24" },
  "storage": [
    {
      "label": "_balances",
      "slot": "0",
      "offset": 0,
      "type": "t_mapping(t_address,t_uint256)",
      "display": {
        "label": "Balance of {key[0]}",
        "keyFormats": [{ "format": "addressName" }],
        "template": "{label} changed from {oldValue} to {newValue}"
      }
    }
  ],
  "types": {
    "t_address": { "encoding": "inplace", "label": "address", "numberOfBytes": "20" },
    "t_uint256": { "encoding": "inplace", "label": "uint256", "numberOfBytes": "32" },
    "t_mapping(t_address,t_uint256)": {
      "encoding": "mapping", "label": "mapping(address => uint256)",
      "numberOfBytes": "32", "key": "t_address", "value": "t_uint256"
    }
  }
}
```

## Things to know

- Status is **Draft**; the schema and supported languages may change. New languages must be added by updating this ERC.
- The file format defines no trust model. A malicious descriptor could mislabel a real storage change, so standards that use it (such as ERC-7730) must establish authenticity before wallets rely on it.
- `display.description` is informative only and must not drive security decisions.
- Descriptors can mix compiler-emitted and hand-authored entries, which matters for proxies, diamonds and EIP-7702 delegates.


---

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