Questions tagged [evm]

EVM is the Ethereum Virtual Machine, the protected, distributed "sandbox area" (virtual machine) where contract execution occurs, replicated on every node in the network. EVM is also the name of the bytecode that runs on the virtual machine -- what Solidity, Serpent and LL get compiled down to before deployment.

Filter by
Sorted by
Tagged with
5
votes
1answer
4k views

Max/min values of standard data types

Where can I find the maximum and minimum values that various types can store? And an epsilon value for floats? I'm looking for something like C's limits.h, but for Solidity / EVM.
3
votes
1answer
536 views

Why doesn't bytecode match the opcodes on Etherscan?

I'm just going through the first few opcodes on this contract: https://etherscan.io/address/0xab7c74abc0c4d48d1bdad5dcb26153fc8780f83e#code. Which are (according to the opcodes view): PUSH1 0x60 ...
2
votes
1answer
736 views

Where does ABI decoding take place?

I'm trying to understand the winning contract from the Underhanded Solidity Contest. That contract apparently caused an overflow in the ABI decoder, but I'm having a hard time understanding where in ...
12
votes
1answer
326 views

How growing contract storage increases the gas spending?

I have some further questions about this and this threads. For simplicity, let's imagine that I want to create a cryptocurrency on top of ethereum. The contract that "handles" this cryptocurrency ...
11
votes
2answers
3k views

Is it possible to call the constructor function of an existing contract?

In theory, a constructor is just a function like any other function, but only gets called once at construction time. Because the EVM doesn't know the notion of a constructor, in theory, a constructor ...
7
votes
1answer
913 views

How to map EVM trace to contract source?

In other words, how to get "classic stacktrace" of failed transaction? E.g. we have a trace (don't look at "Missing opcode 0xfd" - its the revert instruction) and the contract solidity source. How ...
7
votes
1answer
287 views

Tracing back tripped require() to a source code line

What would be the process to map failed transactions (require, throw, etc.) back to the source code line where they occurred? Any examples of such yet?
5
votes
3answers
369 views

Are smart contracts unique to Ethereum?

Is that why ethereum is considered to have a lot of potential? In other words, what does ethereum offer that other blockchain technologies can't replicate.
5
votes
2answers
465 views

What’s the role of the EVM in a plain ether transfer between Externally Owned Accounts?

In a plain ether transfer from one Externally Owned Account to another, for which the base fee of 21000 gas has been provided, how is the EVM involved if at all? I realize that the signature needs to ...
7
votes
2answers
4k views

What is the Ethereum Virtual Machine?

What is the Ethereum Virtual Machine? How does it contrast to the Ethereum World Computer? The description of the EVM tag says: EVM is the Ethereum Virtual Machine, the protected, distributed "...
5
votes
1answer
61 views

Historical state in mainnet EVM

I would like to get a snapshot of EVM state on a certain block and then execute smart contract call actions against this state. Do Go Ethereum, Parity or any of other Ethereum clients provide ...
5
votes
1answer
955 views

Is refunded gas for “freed” storage given to the contract, the “allocator”, or the “deleter”?

Is refunded gas for "freed" storage given to the contract, the "allocator", or the "deleter"? Suppose a contract allocates some storage. This storage is paid for by the sender of the transaction that ...
3
votes
2answers
383 views

How to separate functions in evm bytecode?

I want to build the control-flow-graph (CFG) from the bytecode of a smart-contract (assuming it is obtained by compiling a Solidity source file). This CFG should also distinguish the different methods ...
2
votes
1answer
2k views

What does this error “invalid opcode 0xfd” mean?

I found an error message, 'invalid opcode 0xfd'. What does this mean? I googled, and found just one result here. Quote: "I the invalid opcode 0xfd is never hit (Some compilers encode safety ...
1
vote
1answer
868 views

Working around the 16 local variable limit?

I have a function which negotiates an agreement between two parties using a state channel, to accomplish this I need two signatures bytes32 e, uint8 v, bytes32 r, bytes32 sx2 for the state channel, ...
1
vote
1answer
589 views

Why does Solidity use an invalid jump instead of an invalid opcode for throws?

In Solidity's 0.4.9 release: Internal exceptions are now thrown by using an invalid opcode (0xfe), manual exceptions still use an invalid jump. and Code generator: Internal errors (array out ...
1
vote
1answer
39 views

Is it possible to jump to an arbitrary location in a contract's bytecode?

The assembly for a smart contract looks like there is a single entry point and a series of if/thens or a switch to jump to the entry point of each function. Is it possible to skip the lookup and jump ...
1
vote
1answer
194 views

Does the EVM always allocate new memory or can it reuse already allocated, but unused, memory?

Does the EVM always allocate new memory or can it reuse already allocated, but unused, memory? Reading the docs for delete (http://solidity.readthedocs.io/en/develop/types.html), it is mentioned ...
1
vote
1answer
1k views

Subscribe to all token transfers for entire blockchain

I am looking how to subscribe to all token transfer events within entire blockchain. I wonder how is this is implemented on etherscan.io https://ropsten.etherscan.io/tokentxns I searched thought ...
5
votes
3answers
2k views

Issues getting a simple oraclize example to work, callback never executed

I have been trying to deploy and test the basic "SimpleDice" smart contract provided as an example from Oraclize. I have had to adjust it to work with solidity 0.4.2 a bit, but maybe I am missing ...
3
votes
0answers
138 views

Solidity benchmarking metrics [duplicate]

I am trying to figure out the best ways of benchmarking Solidity contracts. As with normal benchmarking, I presume one would basically want to measure computational effort and storage overhead: gas ...
3
votes
2answers
446 views

Can the CALL opcode be used to create a contract?

The Yellow Paper Appendix H defines the CREATE and CALL opcodes. For CALL: the operand order is: gas, to, value, in offset, in size, out offset, out size. By setting the second operand (the "to"...
3
votes
1answer
256 views

evaluation of execution speeds for various opcodes in EVM

Using traceTransaction we can get the following data: debug.traceTransaction("0x0cec118d22fbd572bf25c7e4143919e608989bec7da08512f2a6f3171df3b3b8") { gas: 104030, returnValue: "...
2
votes
1answer
2k views

What is the maximum value an int and uint can store

I need to understand a couple of things: What is the maximum value an int and uint can store? Are the maximum values stored in int and uint the same?
2
votes
1answer
73 views

After EIP 198 introduction, how much gas is required for RSA signature verification in solidity?

Thanks to the introduction of EIP 198, RSA signature verification is now feasible in Ethereum. How much gas is required for such a verification?
2
votes
1answer
473 views

Why is bytes[] a nested array?

Using bytes[] foo as a function argument contract b { function c(bytes[] foo) { } } in https://remix.ethereum.org gives error UnimplementedFeatureError: Nested arrays not yet implemented. Why?
2
votes
2answers
244 views

Storage trie - are trie nodes reused for two contract instances with the same storage content?

Reading geth code and various posts here, I think I have now a good understanding of how the data is stored in Ethereum (please correct me if I am wrong at some point). At the lowest level we have a ...
1
vote
1answer
528 views

Using EVM or Swarm for datastore

I want to maintain a datastore of key value pairs. For example, I have users of my dapp input their favorite food. I would like to map their account to the food name. It is my understanding that I can ...
1
vote
1answer
363 views

Are contracts able to send messages to EOA's?

I know that EOA's can send transactions between each other, but also to contracts. However, contracts can only send so-called messages, i.e. data without signature (authentication). I'm confused, ...
1
vote
1answer
71 views

why are return values only True or False

Return values from functions which create transactions, can only be true or false, at least when you check them post transaction (e.g., with web3 through receipt). However, when functions call each ...
1
vote
1answer
70 views

Execution environment variables Iw and Ie

According to the yellow paper, one of the Execution Environment variables is: Iw, the permission to make modifications to the state. I can't find further information about it, for example how it'...
1
vote
2answers
329 views

Is it possible to retrieve an event log from a reverted transaction?

I know there is an upcoming change to solidity which will allow the returning of require() calls with a string error message. But I'm wondering if it's possible to do something like this now. Since ...
1
vote
1answer
101 views

What happens in CALL when gas is set to 0?

Reading the documentation on the CALL opcode : "call contract at address a with input mem[in..(in+insize)) providing g gas and v wei and output area mem[out..(out+outsize)) returning 0 on error (eg. ...