L0vdL0vd

eth_getStorageAt

Returns the raw value of a contract storage slot at a given block.

归档 · 可查询任意历史区块

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getStorageAt","params":["0xdAC17F958D2ee523a2206206994597C13D831ec7","0x0","0x1208a5f"]}'

响应示例

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828"
}
参数与您的端点

参数

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".

相关方法