Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [get-storage-at]

Questions about web3.eth.getStorageAt which allows reading a contract's storage

2
votes
0answers
11 views

Most efficient way to get all non-zero storage locations for a smart contract?

I'm looking at a mainnet smart contract and want to figure out all storage positions/slots where the storage has a non-zero value. Is there a way to do this other than replaying and tracing all ...
1
vote
0answers
30 views

Finding the memory position of a mapping [duplicate]

I want to read data from an internal mapping variable using getStorageAt(), but this requires knowledge of the index where that variable is stored in memory. The documentation says: Due to their ...
0
votes
0answers
23 views

Getting storage variable state by name

What do I need to make script, which given the variable name and db with storage tree, will read account storage to check the value of the variable. Can I do this only having code of contract, code ...
0
votes
1answer
207 views

Web3 behaves different on the client and server with different providers

I'm trying to read a mapping storage variable from blockchain. Below, are my attempts, from client and server. Testing on Rinkeby network. From client: Metamask is installed and I'm trying from the ...
0
votes
0answers
158 views

How is getStorageAt() used?

I have tested with eth.getStorageAt() and it shows what I think is 32 bytes of storage. But what is the point of this function? Are we meant to see unused space with it? This is what I have: > ...
1
vote
0answers
48 views

Where in the compile process do storage indexes get assigned to variable names and where can I sniff that data?

I have found the articles explaining how storage works and I understand that if I have a mapping that I need to know the key. What I'm trying to do is figure out how given, solidity code, abi, and ...
1
vote
0answers
45 views

All variables in the Storage

I am a newbie at Ethereum, could you clarify one question. Is it possible to see all variables within Storage of the Contract? If I don't know how many variables it has and want to see the list of ...
2
votes
1answer
459 views

How can I query data from contract storage?

If I have a contract like below: contract wallet{ mapping (address => uint) balances function send(){...} ...... } and I deploy this contract on the ethereum. When I want to query the ...
10
votes
1answer
1k views

How to read a private variable from a contract?

Given a contract, how can I find out the current value of one of its variables (as a dev, not from the context of another contract), if it's not public?
6
votes
1answer
589 views

Accessing to a dynamically sized array value in a contract

I'm trying I have this contract: pragma solidity ^0.4.2; contract ArrayContract { address _owner; uint256[] array; function ArrayContract (){ _owner = msg.sender; array....
3
votes
1answer
222 views

What should be the input for getStorageAt function in web3 js?

I am trying to trace history of transactions in ethereum. I am using a function called getStorageAt(). Now what should be the input to this function, a contract address or account address(account no)?
1
vote
1answer
68 views

how to access multiple values using getStorageAt?

I have a small smart contract that has 2 functions, one to set 3 numbers and another function returning these 3 numbers. return(a,b,c) samplecont.setnumbers(100,250,250) samplecont.getnumbers() ...
3
votes
1answer
446 views

Need help understanding — web3.eth.getStorageAt

Let's say I have three state variables in my contract contract A { uint private x = 255; uint[] y; uint z; } As I understand it, x will have index 0, y index 1 and z index 2? Is it ...
4
votes
1answer
399 views

getStorageAt: What if two transactions in the same block?

I use web3.getStorageAt to access historical information. I can specify a block to see the content of a variable in a given block. But one block can contain several transactions, each modifying this ...
13
votes
1answer
1k views

How do I get the storage indices/keys?

I would like to explore the storage data of a contract. I have geth fully synched and I interact with it over RPC. There is the function "eth.getStorageAt(addr, index, block)" provided, but you need ...
9
votes
3answers
3k views

What does web3.eth.getStorageAt() return?

I want to know how this works: web3.eth.getStorageAt(addressHexString, position [, defaultBlock] [, callback]) What data we can store at any address and how? And what will this eth API return?
8
votes
4answers
2k views

web3.eth.getStorageAt for mapping

How can I get contract mapping storage? Considering this simple contract contract Currency{ mapping(address=>uint) public balances; function deposit(){ balances[tx.origin]++; } } ...