Параметры
addressstringобязательный- 20-byte address, hex encoded.
slotstringобязательный- Storage slot index, hex encoded.
blockstringобязательный- Block number in hex (e.g. "0x1208a5f") or a tag: "latest", "safe", "finalized", "earliest" or "pending". L0vd endpoints run archive nodes, so any historical block works.
Возвращает
string 32-byte slot value, hex encoded.
Когда использовать
Read a raw 32-byte storage slot of a contract at a block, without an ABI or getter.
Typical uses: proxy implementation and admin slots, owner variables, packed config values, and reconstructing state that has no public view function.
Как читать ответ
The result is always 32 bytes. Small types are right-aligned and may share a slot with other variables (packing).
Mapping and array entries live at keccak256-derived slots: for mapping(address => uint) at slot p, the key k is at keccak256(pad32(k) ++ pad32(p)).
Советы
- Use solc --storage-layout or forge inspect <Contract> storage-layout to find slot numbers.
- Slot indexes are hex: slot 10 is "0xa".