AccountCodes

Storage Map v210 → v411

Maps EVM addresses to their deployed contract bytecode.

Explore chain
Queried by: developersanalytics

The Big Picture

Every deployed contract's bytecode is stored here. If an address has code, it's a contract; if not, it's an externally owned account (EOA). This is how the EVM knows what to execute.

Use Cases

  • Verify contract deployment
  • Distinguish contracts from EOAs
  • Build contract explorers
  • Debug contract interactions

Purpose & Usage

Purpose

Stores the executable code for each deployed smart contract.

Common Query Patterns

  • Query by H160 address
  • Check if address has code (is contract)

Query Keys

#NameTypeDescription
1
evmAddress
raw: key1
[u8; 20] [20] key1 ([u8; 20])

Stored Value

Vec<u8> Vec

value (Vec<u8>)

Relationships

Modified By

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query AccountCodes storage
const key1 = "0x0000000000000000000000000000000000000000";

const result = await api.query.EVM.AccountCodes.getValue(key1);
console.log("AccountCodes:", result);

Version History

v210 block 4,345,556 Added
v213–v215 · runtime versions skipped on chain (never deployed)
v216 block 4,510,996 Internal re-bind
v235–v237 · runtime versions skipped on chain (never deployed)
v238 block 4,936,550 Internal re-bind
v259–v260 · runtime versions skipped on chain (never deployed)
v261 block 5,328,895 Internal re-bind
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind
v327–v333 · runtime versions skipped on chain (never deployed)
v334 block 6,811,690 Internal re-bind Current

Runtime Info

Pallet
EVM
Storage Kind
Map
First Version
v210
Current Version
v411