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
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 ...
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
562 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
818 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
340 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 ...
8
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 ...
7
votes
1answer
313 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
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
3answers
399 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
491 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 ...
2
votes
1answer
982 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
65 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 ...
4
votes
1answer
5k 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?
3
votes
1answer
33 views

Why does function GetEVM set the balance of from address to MaxBig256?

As you can see in this line, func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) { state.SetBalance(...
3
votes
2answers
567 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
231 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 ...
2
votes
1answer
652 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
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 ...
1
vote
1answer
52 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 ...
0
votes
1answer
32 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
275 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
2answers
472 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
0answers
181 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
1answer
494 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
411 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
278 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
30 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 ...
2
votes
1answer
132 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?
1
vote
1answer
75 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
112 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
400 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
135 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. ...
1
vote
2answers
475 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
545 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 ...
0
votes
1answer
50 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
86 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