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
9
votes
1answer
234 views

Extra byte in the TheDAO v1 bytecode

I tried decompiling the TheDAO v1 bytecode with disasm and it seems to fail for me. I entered the TheDAO bytecode here and found that the last instruction was : [10836] PUSH16 ...
8
votes
1answer
4k views

Rationale behind 256-bit words in EVM

What were the design factors driving having EVM native words as 256-bit? It feels excessive, especially if one needs to process as large data set as blockchain.
3
votes
1answer
1k views

How are the arguments of the constructor encoded in the contract creation transaction?

The Ethereum ABI defines how arguments are encoded and passed when a method is called. But how are the arguments to the constructor encoded in the contract creation transaction which creates the smart ...
9
votes
1answer
1k 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 ...
6
votes
2answers
5k 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
594 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
878 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
356 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 ...
7
votes
1answer
325 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?
6
votes
1answer
1k 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 ...
5
votes
2answers
508 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 ...
5
votes
3answers
432 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.
4
votes
2answers
657 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
1k 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, ...
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
6k 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?
5
votes
1answer
73 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 ...
2
votes
1answer
683 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 ...
2
votes
1answer
244 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 ...
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
61 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
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 ...
0
votes
1answer
51 views

How to setup ethereum to work on gpus for complex smart contract execution?

Basically the question is to apply some gpu intensive tasks like machine learning algorithms etc using smart contracts, is this possible using any of the available ethereum clients like geth or parity ...
5
votes
4answers
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
1answer
188 views

Calculate transaction costs for storing data

I'm trying to figure out how the transaction costs are calculated for a transaction that is storing data on the Ethereum Blockchain. It seems I'm always off. Here is my way of calculating (I'm using ...
3
votes
1answer
167 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?
3
votes
2answers
488 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
284 views

evaluation of execution speeds for various opcodes in EVM

Using traceTransaction we can get the following data: debug.traceTransaction("0x0cec118d22fbd572bf25c7e4143919e608989bec7da08512f2a6f3171df3b3b8") { gas: 104030, returnValue: "...
3
votes
0answers
185 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 ...
2
votes
2answers
477 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 ...
2
votes
2answers
300 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 ...
2
votes
1answer
501 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?
1
vote
1answer
126 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
2answers
527 views

How calldata is stored in memory?

When I execute this: bytes8 h = 0x000008dfe2f440000733c; t.call.gas(0x7e0b0)(bytes4(keccak256("enter(bytes8)")),0x8dfe2f440000733c0000000,h); the calldata is : 0: ...
1
vote
1answer
79 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
1answer
418 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
554 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
172 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. ...
0
votes
1answer
64 views

Can we extend ethereum client or smart contract to use external libraries?

Basically the question is to extend the ethereum clients to bring some capabilities of external libraries on the blockchain either by extending the ethereum client or by using inside smart contracts ...
0
votes
1answer
138 views

Gas is 0 when executing CALL opcode?

I wrote a very simple smart contract like this: contract Test{ function test1(address payable addr, uint256 value) payable public { addr.transfer(value); } } And I compiled it using ...

1
2