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
0
votes
1answer
66 views

LLL preprocessing/optimization issue

I have written a simple nested macro in LLL, but I can't get it to reduce to the simplest expression when calling the compiler with the optimization option. My macro looks like this: (def 'mcopy (pos ...
2
votes
1answer
273 views

Formal definition of the EVM as a Turing Machine

I am trying to understand the EVM in the context of a classic Turing Machine. I have read through the yellow paper and taken what I can from the internet, but I still feel like I could use some help ...
1
vote
1answer
117 views

Is it possible to use EVM with input data not stored on the blockchain?

I am interested in computing medical data in a decentralized way where none of the computing resources nor the requester can fully access the data for the sake of privacy concerns. In this schema, ...
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 ...
1
vote
1answer
46 views

Standalone assembly contract: control flow error

I'm trying to understand why the following toy contract does not work. I can deploy it successfully, and transactions with fewer than 36 bytes of data are successful, but those containing 36 bytes or ...
0
votes
1answer
73 views

Is it possible to inspect EVM memory or stack?

I'm curious if anyone operating a node can inspect the EVM memory or stack as contract code is being executed. For example, a gambling app contract code "draws" a random card by querying a ...
1
vote
1answer
183 views

Unable to replicate short-address attack

I was reading about the short address attack and decided to replicate and test the possible solutions. What I know about short address attack is if you skip n characters of your address, you end up ...
2
votes
1answer
224 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 ...
0
votes
1answer
799 views

how does a lightweight node interact with smart contracts?

In my current understanding, (1) smart contracts are code stored in the blockchain network, and access the data in the blockchain network. (When we deploy contracts, we'll get the storage address) (2)...
4
votes
2answers
424 views

Run EVM Code outside the Blockchain

is there any way to execute functions on a smart contract (as EVM-Bytecode) in a separate program like evm (provided by go-ethereum) without having to run a test-network? I need to find a way to run ...
6
votes
1answer
751 views

What do the response values of a Parity `trace_transaction` call actually represent?

Parity implements a really useful trace module for deep diving into blocks and transactions. One particular method trace_transaction allows you to investigate the EVM execution paths of a transaction....
7
votes
1answer
305 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?
1
vote
1answer
555 views

Deploying contract byte code via assembly

I'm trying to write a smart contract which will deploy byte code using assembly op_code create. I'm following this post. But when I call deployCode function I got nothing. Ropsten etherscan tells me ...
0
votes
1answer
70 views

Output of log.memory.slice in Geth debug_traceTransaction

Has anyone else used the JavaScript-based tracer that Geth provides, as part of its debug_traceTransaction method? I want to look at segments of memory during a transaction's execution (specifically, ...
2
votes
0answers
88 views

What's the value of `this` inside a library function when called via a delegatecall?

Imagine a contract C that makes a delegatecall to a library L. C -> L What's the value of this inside L: address(C) or address(L) ? If now that L makes a normal call to another contract D. C ->...
6
votes
2answers
731 views

How does the EVM ensure perfect determinism and what does that mean?

I've read What was the reason to invent the EVM? but I feel like it didn't fully answer the question. So I have a couple of followup questions regarding the EVM: Why does the EVM ensure perfect ...
5
votes
4answers
2k views

Parity Trace Issue: TraceDB resync required

I am trying to use the trace functionality included in the parity node (https://github.com/paritytech/parity/wiki/JSONRPC-trace-module) but I am having trouble configuring my node. I have tried to ...
2
votes
1answer
1k views

VM error: invalid opcode resulting from array operations

pragma solidity ^0.4.18; contract VectorTest { /* this runs when the contract is executed */ function VectorTest() public { // initialize the variables } // returns an int ...
2
votes
3answers
478 views

How do you prevent accidentally sending Ether to an inactive address?

How does one prevent a contract from accidentally sending Ether to an inactive address? (e.g. the common error is burning ether to 0x0, or a single digit typo in an address) I've worked on medical ...
0
votes
2answers
209 views

Returning byte[64] from a function works in TestRPC not in Geth

I have a smart contract which is returning a byte[64] array. In testrpc I get the correct array but in Geth I am getting array with all "0x". Here is the smart contract code: pragma solidity ^0.4.18;...
1
vote
1answer
524 views

If Ethereum total supply is not capped, how is infinitely large integers prevented?

If using infinite token supply, how is infinitely large integers avoided?
2
votes
1answer
109 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 ...
6
votes
2answers
760 views

How does the cost of EVM memory scale?

How does the cost of EVM memory scales? I wonder how does the cost of EVM memory (not storage) scale? Indeed, having read other QA's, the cost of memory is not a linear function, but should increase ...
1
vote
1answer
105 views

Verify multiple state channel signatures in one transaction

What are some ways to verify multiple state channel signatures (using ECverify) in a single transaction?
1
vote
1answer
386 views

Assembly for array with bytes64, to bypass nested array error

Since it is not possible to pass call code with an array of bytes64, as an array with types bigger than bytes32 becomes a nested array, Why is bytes[] a nested array? How would assembly be used to ...
2
votes
1answer
492 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?
0
votes
1answer
237 views

Opcode for out of gas inside a message call

According to the Solidity documentation: A require-style exception is generated in the following situations: ... If you call a function via a message call but it does not finish properly (i.e. ...
1
vote
1answer
726 views

Smart contract to refund ETH transfer

I wanna achieve smart contract to send ETH back to the sender on some conditions: function() public payable { msg.sender.transfer(msg.value); } I am passing gasLimit equal to 4700000: web3.eth....
2
votes
1answer
69 views

Does each shard in Ethereum 2.0 have its own address space?

Sharding is planned for Ethereum 2.0, which will split the state into a few hundred shards, connected along a hypercube network topology. Does each shard have its own address space, or, is there a ...
0
votes
1answer
303 views

Revert keyword in solidity

I've deployed contract in ropsten test net with this source code: pragma solidity ^0.4.15; contract C{ function throws(){ throw; } function reverts(){ ...
8
votes
1answer
2k views

Is there any profit from using pure and view functions modifiers?

I have a function that does not read or modify contract's state: contract C { function add(uint a, uint b) public returns (uint) { uint res = a + b; return res; } } Does it ...
6
votes
1answer
336 views

How does dynamic array memory reallocating work?

Let's say I have a dynamic array of some length and I want to push a new element, but memory after last elem is already used. What would happen in such case? Compiler would find a new 'chunk' of ...
1
vote
0answers
54 views

Similar to currency-abstraction, could there be cryptography-abstraction (free market for digital signatures on a single state)?

Currency-abstraction for mining rewards was planned for Serenity, and so on, and so is out there as an idea. I thought about "signature-abstraction", so that different digital signatures could compete ...
2
votes
1answer
964 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, ...
2
votes
1answer
176 views

Range of Bytes32

What is the unsigned range of a bytes32 type in Solidity? I'm wondering the total number of unique expressible combinations. I'm assuming it is 2^8^32.
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
398 views

Why does PUSH1 0x60 PUSH1 x40 MSTORE store 0x60 at memory location 0x50 (and not 0x40)?

According to browser solidity, after executing 000 PUSH1 60 002 PUSH1 40 004 MSTORE Memory is: 0x00: 00000000000000000000000000000000 ???????????????? 0x10: 00000000000000000000000000000000 ?????...
2
votes
1answer
875 views

Using STATICCALL from Solidity

STATICCALL provides protection against reentrancy attacks. How can I use this functionality from within Solidity?
7
votes
6answers
1k views

What would happen if EVM didn't exist in Ethereum?

It's not clear to me the importance of the Ethereum Virtual Machine and why it is used. So it is natural to ask what would happen if EVM didn't exist? or Ethereum didn't use it.
2
votes
1answer
130 views

Are makeLog instruction functions opcodes or not?

The following code snippet is a constituent piece of the instructions.go file, where our lieblings opCodes all live. // make log instruction function func makeLog(size int) executionFunc { ...
1
vote
2answers
543 views

Linked list in contract storage?

I'd like to implement a linked list in contract storage Something link this: contract A { struct LinkedList { uint value; LinkedList storage next; // What goes here? Can I reference ...
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 "...
1
vote
1answer
209 views

Can't understand hashing mechanism for mappings

I have a contract with function function addToBalance () payable { userBalances[msg.sender] += msg.value ; } Debugged assembly and stumbled on the code that calculates key for store: ...
2
votes
1answer
801 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 ...
0
votes
1answer
180 views

EVM assembly level debugger

I want to examine behavior of some EVM instructions in live mode, but can't find any tools like debuggers/emulators which give nice look of stack and memory and ability to execute contract by steps.
0
votes
1answer
59 views

Can I use Events as a sort of volatile data store?

I'd like to make an application where a transaction occurs that creates a new contract, and an event is kicked of informing the listeners that this new contract has been created. After that, the ...
5
votes
1answer
938 views

why is the EVM stack limited to 1024?

Here you can see that if the EVM stack gets larger than 1024, it results in an error: Why is there this hard limit on the stack size? What is the justification for this not being parametrizable? ...
3
votes
2answers
425 views

How to install geth disasm and other dev tools

The geth disassembler seems like a really nice tool, if it can do stuff like this: To disassemble, run echo 6005600401 | disasm, which produces: 0 PUSH1 => 05 2 PUSH1 => 04 4 ...
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 ...
3
votes
1answer
573 views

does the command `evm --debug --code OPCODES` still work?

I've been trying to run this command evm --debug --code 600580600b6000396000f36005600401, and some associated permutations of it, such as: evm --debug --code ...

1
6
7
8 9 10