Guides/EVM/Precompiles

Storage query

Reference for the deployed selectorless StorageQueryPrecompile.

View as Markdown
PropertyValue
Rust implementationStorageQueryPrecompile
Solidity interfaceNone
Address0x0000000000000000000000000000000000000807
StatusDeployed · deprecation planned

This precompile has no named Solidity functions or four-byte function selector. The complete call data is interpreted as a raw Substrate storage key. It returns the stored SCALE-encoded bytes, or empty bytes when the key does not exist.

Only keys whose first 16 bytes match an authorized pallet prefix are accepted: SubtensorModule, Swap, Balances, Proxy, Scheduler, Drand, Crowdloan, Sudo, Multisig, and Timestamp.

Raw storage access is brittle because callers depend on runtime storage names, hashers, key formats, and SCALE encodings.

Planned deprecation

The planned lifecycle is:

  1. Add typed views for all storage currently authorized through this precompile.
  2. Soft-deprecate Storage Query. Existing calls continue to execute identically while the registry and documentation direct new callers to typed functions.
  3. Allow a documented migration window for existing contracts and tooling.
  4. Hard-deprecate Storage Query so calls return a descriptive precompile error.
  5. Eventually disable the precompile through the existing Root-controlled precompile switch.

No migration-window length or activation block has been assigned. The general lifecycle rules are described in Precompile design and lifecycle.

Replacement destinations

Typed coverage should be completed at existing domain addresses whenever a compatible domain already exists. A new address is proposed only when no existing precompile has a coherent responsibility for that state.

Authorized storage prefixTyped replacement
SubtensorModuleExtend Staking V2, Metagraph, Subnet, Neuron, Alpha, Leasing, UID lookup, Address mapping, and Voting power, according to the meaning of each value.
SwapExtend Alpha with typed liquidity, fee, balancer, reservoir, initialization, and migration-status views.
BalancesExtend Account balance with typed account, issuance, lock, reserve, hold, and freeze views.
ProxyExtend Proxy with typed announcement, last-call-result, and fee-payer views.
CrowdloanExtend Crowdloan with typed ID, contribution-limit, current-operation, and migration-status views.
SchedulerUse the typed Scheduler precompile.
DrandUse the typed Drand precompile.
SudoNo dedicated EVM precompile is proposed; this access must be addressed explicitly before Storage Query is deprecated.
MultisigNo dedicated EVM precompile is proposed; this access must be addressed explicitly before Storage Query is deprecated.
TimestampUse the typed Timestamp precompile; getTimestamp() is equivalent to the existing EVM block.timestamp value.

Source: storage_query.rs