AccountCodesMetadata
Storage Map v210 → currentMetadata about contract code (size, hash).
Explore chainQueried by: developers
The Big Picture
Metadata allows checking code properties without loading potentially large bytecode.
Use Cases
- Check code hash
- Verify contract version
- Efficient code existence checks
Purpose & Usage
Purpose
Stores metadata for contract code without retrieving full bytecode.
Common Query Patterns
- Query by H160 address for code metadata
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | H160 | key1 (H160) |
Stored Value
value (CodeMetadata)
Relationships
Related Events
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query AccountCodesMetadata storage
const key1 = 0 as any /* H160 */;
const result = await api.query
[stringCamelCase("EVM")]
[stringCamelCase("AccountCodesMetadata")](
key1
);
console.log("AccountCodesMetadata:", result.toHuman());Runtime Info
- Pallet
- EVM
- Storage Kind
- Map
- First Version
- v210
- Current Version
- v393