Linked Questions

1
vote
0answers
53 views

Data Storage in Ethereum [duplicate]

How does data storage work in Ethereum? Do variables of a Smart Contract map to columns of a table? And an update to those variables creates a new record with their latest values? So if 100 employees ...
35
votes
1answer
16k views

What does the keyword “memory” do exactly?

I've been looking through the code of Etherdice and noticed that some variables are declared like ParserResult memory result; and I haven't found the keyword "memory" in any documentation. What I ...
18
votes
3answers
3k views

What are the limits to gas refunds?

Gas refunds are provided when clearing storage or calling SELFDESTRUCT on contracts. The Yellow Paper mentions that refunds are "being capped up to a maximum of half...". What exactly is this "half" ...
16
votes
1answer
5k views

Usage of memory, storage and stack areas in EVM

In solidity contracts, I can understand that based on variable usage and expensiveness, I can determine that which one should use (memory, storage or stack). But I faced some situations where only ...
11
votes
3answers
4k 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?
17
votes
2answers
2k views

Why are local variables allocated to storage instead of memory?

Local variables (i.e. variables declared inside functions) are held in persistent storage by default instead of non-persistent memory (source). The value of a local variable can not persist in ...
8
votes
1answer
644 views

Is the cost of updating storage different than the cost of adding to storage?

Do these have a separate cost? sstore(1, 10) # first time adding a value to storage with this key sstore(1, 20) # changing the value in storage. I looked for a list of gas costs / opcodes, and the ...
2
votes
1answer
3k views

Error encountered during contract execution [Bad jump destination]

When calling to start() function in a Smart Contract, transaction fails with this message: Warning! Error encountered during contract execution [Bad jump destination] According to Error During ...
1
vote
2answers
1k views

Why cryptokitties uses storage instead of memory?

There are a lot of explainations of storage and memory out there like this question or this question. But I'm wondering why cryptokitties for example uses storage instead of memory in many functions. ...
4
votes
1answer
261 views

How does a client interact with a contract already in the blockchain?

I am looking for someone to help clarify the 'stacktrace' of interactions that occur when a client interacts with a smart contract. Clearly, one has to submit a transaction to a miner, who then has ...
3
votes
1answer
179 views

Switching from 'storage' to 'memory' increases the gas-cost

I've read several related answers and blog posts, all of them suggesting that for the sake of reading complex state variables (i.e., arrays and structures), one should always prefer declaring the ...
1
vote
1answer
186 views

Where can I find the block that contains most recent state of contract's memory/storage?

I am considering trying to use or implementing some form of light Ethereum node that only needs access the most recent version of data stored in smart contract storage on the blockchain and trying to ...
2
votes
1answer
104 views

Why is the cost of memory non-linear, while the cost of storage is linear?

Why is the cost of memory non-linear, while the cost of storage is linear? I wonder why the cost function of memory vs. storage differ? While storage is associated with a constant cost, this is not ...
0
votes
2answers
35 views

The cost of using Ethereum as a reference database

As stated in the documentation there are 3 types of storage in the Ethereum VM (EVM) The storage, the memory, and the stack Each account has a data area called storage, which is persistent ...