Guides/EVM/Precompiles
Storage query
Reference for the deployed selectorless StorageQueryPrecompile.
| Property | Value |
|---|---|
| Rust implementation | StorageQueryPrecompile |
| Solidity interface | None |
| Address | 0x0000000000000000000000000000000000000807 |
| Status | Deployed · 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:
- Add typed views for all storage currently authorized through this precompile.
- Soft-deprecate Storage Query. Existing calls continue to execute identically while the registry and documentation direct new callers to typed functions.
- Allow a documented migration window for existing contracts and tooling.
- Hard-deprecate Storage Query so calls return a descriptive precompile error.
- 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 prefix | Typed replacement |
|---|---|
SubtensorModule | Extend Staking V2, Metagraph, Subnet, Neuron, Alpha, Leasing, UID lookup, Address mapping, and Voting power, according to the meaning of each value. |
Swap | Extend Alpha with typed liquidity, fee, balancer, reservoir, initialization, and migration-status views. |
Balances | Extend Account balance with typed account, issuance, lock, reserve, hold, and freeze views. |
Proxy | Extend Proxy with typed announcement, last-call-result, and fee-payer views. |
Crowdloan | Extend Crowdloan with typed ID, contribution-limit, current-operation, and migration-status views. |
Scheduler | Use the typed Scheduler precompile. |
Drand | Use the typed Drand precompile. |
Sudo | No dedicated EVM precompile is proposed; this access must be addressed explicitly before Storage Query is deprecated. |
Multisig | No dedicated EVM precompile is proposed; this access must be addressed explicitly before Storage Query is deprecated. |
Timestamp | Use the typed Timestamp precompile; getTimestamp() is equivalent to the existing EVM block.timestamp value. |
Source: storage_query.rs