Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
12 views

Why the same contract has more bytecode size in solidity 0.5 in compare to 0.4.24?

My earlier contract was compatible with solc@0.4.24. Now I am upgrading my contract to make it compatible with solidity 0.5 but it leads to an increase in bytecode size. AFAICT There is no change in ...
1
vote
2answers
16 views

How could Solidity 0.5.0 dynamic sized parameters be declared as storage?

As I understand it 'memory' in the EVM is a byte array and cannot be dynamically resized, whereas 'storage' is able to be resized. What is happening when a parameter is declared as storage. Where is ...
0
votes
1answer
24 views

Understand an online contract with no EVM bytecode avaliable

Could anyone shed some lights on the following contract? https://etherscan.io/address/0x27d6c4cb2551799a143e1a3291ae002b8c8aa078#code I am quite confused about what's going on here. Why doesn't the ...
0
votes
1answer
31 views

Get all the identical contracts for a given contract

I am aware of the "find similar contract" function on etherscan.io; however, it seems to only print out the top 500 identical contracts, with the time ascending order. For instance, https://etherscan....
1
vote
0answers
19 views

How to let parity EVM execute just some blocks from a state?

I want to do an experiment using mainchain data. The experiment aims to test EVM performance. So, I want to let EVM execute some blocks and measure the performance. Are there some tools that can be ...
0
votes
1answer
46 views

Why will the new Ethereum 2.0 virtual machine run smart contracts compiled to WebAssembly instead of LLVM IR?

LLVM seems to be a compile target with more mature implementations around it, so I figured LLVM would be a better assembly for the next generation EVM to run natively compared to WebAssembly which is ...
1
vote
2answers
43 views

Understand a smart contract semantics

I am writing to understand a smart contract which seems quite "meaningless" to me. The contract is at (https://etherscan.io/address/0xd4fa166d5ffe8f78230fc05e6850881dc08b2da2#code) but indeed over ...
1
vote
1answer
36 views

How to extract “runtime” bin from a EVM bin found on etherscan.io

I would like to extract the runtime bin from the EVM bin that can be found in the etherscan.io. For instance for this famous contract (https://etherscan.io/address/...
0
votes
2answers
24 views

Why doesn't the EVM revert on integer overflow/underflow?

After writing a few contracts in Solidity, I've noticed a reoccurring theme of always having to think about possible integer overflow/underflow attacks. It seems to me that Solidity should be as ...
1
vote
1answer
26 views

How State variable are stored and updated?

The Smart contract and the state variables are stored in the blockchain, let us say during deployment of a smart contract the state variable and smart contracts are stored in the block 1, and in ...
1
vote
2answers
52 views

Is there any kind of locking protocol in Ethereum?

Is there any kind of locking protocol in ethereum, like can two transaction update the state variable same time ?, If yes then how would you avoid that ? Smart Contract XYZ is deployed and two people ...
0
votes
1answer
24 views

What tools exist for reading non-public storage?

What tools or methods exist for querying arbitrary contract storage? The problem at hand is having to inspect smart contract state variables that have been marked as internal. Block explorers, Remix, ...
2
votes
1answer
16 views

Which semantics are used for old contracts executed now?

Suppose an old contract is called now that contains an opcode that was invalid then but has some meaning now. What happens when this opcode is executed during a recent transaction: Will execution fail ...
1
vote
1answer
33 views

How does Transactions work in Ethereum Virtual Machine?

While reading the transactions sections of EVM documentation many questions raised in my head: If the target account is not set (the transaction does not have a recipient or the recipient is set ...
0
votes
1answer
35 views

Difference between Binary of the Contracts in Hex and contract bytecode?

I use the command "solcjs --bin mycontract.sol" to get the "Binary of the contracts in hex" and it looks like: It can be used as a parameter of evm in geth after the command "evm --code". When I use ...
1
vote
0answers
36 views

Ethereum state database persistence

Is there a way to reinstantiate a stateDB after saving the output of state.Dump()? My problem is the following : I create a new StateDB object using : db := ethdb.NewMemDatabase() state, _ := state....
3
votes
1answer
110 views

Gas costs of the following contract

I'm calculating the gas costs of the following contract: 0x6001600190016007026005016002900460049060016021900560150160030260059007600303600960110a60005260086000f3. Disassembled versions: contract ...
1
vote
0answers
58 views

eWASM vs PWASM: Are they complete independent? If so, in what ways are they different?

Understanding that eWASM is more like EVM 2.0 by replacing EVM with a subset of WASM instructions set.. What is the motivation of the PWASM project from Parity? Notes: https://medium.com/paritytech/...
1
vote
1answer
86 views

Understand an EVM call instruction with gas as 0x00

I am trying to understand the following EVM call instruction generated from here: https://ethervm.io/decompile memory[temp3:temp3 + 0x00] = address(msg.sender).call.gas(0x00).value(var1)(memory[...
1
vote
0answers
38 views

How can I run smart contract locally on my computer?

We all know that Ethereum nodes can run smart contract. But I'm wondering whether can I setup contract run-time environment from Ethereum source code locally so I can run smart contract without ...
3
votes
2answers
68 views

EVM SIGNEXTEND Opcode explanation

I am trying to develop my own small EVM. That is a good way for me to learn more about the bytelevel. I hadn't had any problems with most of the instructions, but there are a few, which I just don't ...
1
vote
2answers
35 views

Solidity: Info on How it works on the low level

I'm looking for information on how Solidity works on the low level and how exactly it gets executed or run on the EVM? Do you have any documentation or Papers that describe that? Thank you!
1
vote
1answer
56 views

Are constant state variables cached in the EVM?

From the docs: constant for state variables: Disallows assignment (except initialisation), does not occupy storage slot. Does this mean that the EVM caches constants across all contracts using ...
0
votes
1answer
23 views

is it possible to add whitelist of contract in self mainnet node?

I am working in a company write games on eth mainnet and maintenance a eth node(geth) not using infura.io. My boss require me our eth node just can deal with our contract, so is it possible to do it? ...
0
votes
1answer
20 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
50 views

Is Ganache GUI real EVM?

I was wondering whether Ganache GUI is real EVM or just a replica of it. Because its throughput and latency are way better than Geth client. Any comments on it?
1
vote
1answer
74 views

Smart Contracts without ETH Transactions

Maybe I'm wrong, but I understand that Smart Contract Transactions must always contain a "VALUE" field, that's to say, the amount of Ether Alice will transfer to Bob in case certain condition ...
1
vote
1answer
66 views

What happens to a transaction after you clicked 'send' in Ethereum network?[Transaction life cycle at the EVM and P2P networking level]?

Ref: What happens when you type in an URL in the browser So in a web browser, it's kinda easy to reason the life cycle of an HTTP request, how it moves down the network stack, reach the server, get ...
1
vote
0answers
26 views

Finding the memory position of a mapping [duplicate]

I want to read data from an internal mapping variable using getStorageAt(), but this requires knowledge of the index where that variable is stored in memory. The documentation says: Due to their ...
0
votes
1answer
29 views

Can storage be referenced without being copied?

With for example struct Foo { mapping(address => uint) b; } Foo[] foo; if a function only deals with foo[4], can it reference it from storage without copying it? is that what function c() { ...
0
votes
1answer
24 views

Use same argument name in modifier and function

If I have a function function b(address _foo) verifySomeClause { } and a modifier that can take different addresses as an argument, so that msg.sender can be one of those, modifier c(address _foo) {...
1
vote
1answer
33 views

Stack too deep, difference between memory variables local variables

Got a "stack too deep" error, and saw on stack exchange that I could try and use memory variables instead of local variables, and moved 8 uint into a uint[8], no error anymore. Why does that work ...
1
vote
3answers
38 views

updating variable inside and outside struct, different results, why?

With this, bool p does not update, contract b { bool p; mapping(uint => bool) public t; function setValue() { bool b = t[1]; b = true; } function ...
1
vote
1answer
28 views

How can I increase EVM time in web3.py?

When working with web3.js, Truffle and Ganache, I can do this: web3.currentProvider.send({method: "evm_increaseTime", params: [numOfSeconds]}); How can I do the equivalent in web3.py? When I do: ...
1
vote
1answer
24 views

Extra incentives for miners in smart contracts

I am thinking to create a smart contract where miners are not only incetivized by gas price but where basically the miner can get other assets like erc20 tokens if he/she mine my transaction in the ...
0
votes
2answers
46 views

How to let evm execute one function from a smart contract and receive outputs in a handy way?

I am a newbie to this field so I apologize in advance if this seems trivial. Say I have written some code in Solidity, for instance something like the quick sort code (https://gist.github.com/subhodi/...
0
votes
1answer
40 views

Run solidity bytecode with ethereumj

I am a newbie to Ethereum and I would like to run some simple smart contract code written in Solidity locally with my ethereumj virtual machine. I am aware of how to use EVM and aleth-vm to run some ...
2
votes
1answer
92 views

Instrumenting GETH

I'm working on instrumenting VM of GETH in order to index interesting data from the blockchain. I did manage to intercept the call and see internal transactions, but I want to go a little deeper, and ...
0
votes
1answer
39 views

How to understand output of debug.trace

I have created a Private Ethereum network and I have deployed a contract in it.. Now I am trying to post a transaction in that contract but I m getting error that transaction has been reverted by EVM ...
2
votes
1answer
52 views

Isolating the EVM and calling contracts functions

For a project of mine I would like to run a standalone new EVM with precise specifications. After having instantiated and set up the vm, I have a deployed a test contract using the vm « Create » ...
1
vote
2answers
64 views

What is the size of byte code stored in the EVM?

Generally, what is the size of the bytecode stored in the EVM. I mean the approx average value of it or bytecode of a simple hello world program (setting and getting a string). On what factors this ...
0
votes
1answer
44 views

Solidity SafeMath support for uint64

So commonly used snippet for safeMath in solidity is the following: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/64c324e37c17c5e0501bb746975040d1ae020806/contracts/math/SafeMath.sol ...
0
votes
1answer
26 views

Instrumenting GETH: breakpoints on evm never hits

I'm trying to instrument the GETH virtual machine, and in order to do so I'm studying the geth code running it on debug. I expected that, during syncing, EVM is used to compute state of each single ...
1
vote
1answer
44 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 ...
3
votes
1answer
50 views

What is the purpose of extcodecopy?

I am wondering, what is the purpose of the EXTCODECOPY bytecode instruction? I don't see any advantage in copying the code of another contract in memory. I am a little bit confused, because of the ...
1
vote
1answer
77 views

Concatenating byte strings in assembly for call input data

I have the following piece of code in my contract. It's supposed to take in a byte string composed of a uint flag that is followed by a variable list of uint numbers and contruct a call using those ...
5
votes
1answer
43 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
55 views

What is this evm code produced by solc in this public array checking, and why?

When solc creates code for arrays when they are declared public. In particular, it contains a check on the length of the array. For example, this: contract OutOfBoundsException { uint256[8] ...
1
vote
0answers
21 views

Gas cost of adding an item to a class-level (storage) array

I would like to make sure that the gas cost of adding an item to a (storage) array is constant, i.e., not dependent on the length of the array. To my understanding, the relevant EVM operation is ...
1
vote
1answer
37 views

invalidJumpLabel no longer available?

I am trying to compile the create op code example in here Create new contract via .call(). But it fails: execute.sol:17:19: Error: Identifier not found. jumpi(invalidJumpLabel,iszero(...