Ethereum
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Ethereum
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getStorageAt reads one raw 32-byte word straight out of a contract's storage on Ethereum mainnet (chain ID 1, the EVM network whose gas is paid in ETH). Every contract keeps its state in a flat key-value store of 256-bit slots, and this method returns the value at the slot you name — no ABI, no getter function required. You give it a contract address, a slot index, and a block, and it answers with the 32-byte value left-padded with zeros. Pass a historical block and you read the slot as it stood at that height, not just at the head. The endpoint is https://ethereum.therpc.io/YOUR_API_KEY. It's the unfiltered counterpart to calling a public view function: closer to the metal, and it works even when no getter is exposed.
0x360894...bbc) when the contract exposes no getter for it.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | address | string (hex) | نعم | The contract whose storage to read. |
| 2 | storageSlot | string (hex) | نعم | Storage position to read. For mappings, this is the keccak256-derived slot. |
| 3 | blockTag | string | لا | Block at which to read.الافتراضي: latest |
| النوع | الوصف |
|---|---|
| string (hex) | 32-byte hex-encoded value stored at the slot, left-padded with zeros. |
Try it live in the Ethereum playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Address or slot index is malformed. |
-32000 | Missing trie node | Historical block pruned on a non-archive node. |
uint8/bool/address fields can share one 32-byte slot. Reading that slot gives you all of them at once, and you mask and shift to pull out the field you want.k lives at keccak256(abi.encode(k, baseSlot)), so you compute that hash first, then read it — the base slot itself is empty.المعاملات
0x-prefixed 20-byte contract address
0x-prefixed 32-byte slot index (e.g. "0x0")
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"