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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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 ...

0
votes
0answers
11 views

How are arithmetic operations performed on strings within EVM bytecode?

for eample, I have this following bytecode: 60A060020a which translate into: PUSH1 0xA0 PUSH1 0x2 EXP How would an exponentiation operation be performed on the 2 items pushed into the stack, when ...
0
votes
1answer
20 views

Who is paying for a transaction within a contract?

Let's assume I do a transaction to a contract function with my external account, then I have to pay gas for this transaction. If the function within the contracts makes now a transaction on his own ...
1
vote
1answer
15 views

It is possible to get bytecode from the evm in golang?

Imagine this scenario, I have a contract that has a function where I call with runtime.Call(). But this function returns an address of a newly created contract, but not the bytecode as runtime.Create ...
0
votes
1answer
31 views

Geth evm not executing contracts on main net but runs fine on ropsten

I built geth from a fairly new release 1.8.12, when running on testnet (ropsten) it is executing contracts, however when running on the real net it is not, any idea why this is happening? I am using ...
3
votes
3answers
42 views

EVM - How is it connected to the Blockchain? [duplicate]

I have a few problems understanding the software architecture of the Blockchain. For me Blockchain is the database where all transactions, receipts, balances, etc are stored. But how is the connection ...
0
votes
0answers
26 views

What's the difference of contract.call and call by interface

ERC20 TOKEN's ApproveAndCall has two type of implementations. what's the difference? method 1: contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 _amount, address ...
0
votes
0answers
13 views

Unable to use go-ethereum evm utility

I am unable to use evm tool, e.g. leads to a crash: $./evm --code 60ff60ff --debug run panic: runtime error: invalid memory address or nil pointer dereference Is this tool still supported ?
0
votes
1answer
11 views

invalid state after miner rejects transaction

I refer to the transaction flow in the following link: https://web3j.readthedocs.io/en/latest/_images/web3j_transaction.png What happens if the transaction is propagated to other ethereum client (...
1
vote
1answer
50 views

Solidity airdrop exiting with REVERT opcode

I work on solidity airdrop contract. I tested the contract in ropsten testnet https://ropsten.etherscan.io/address/0xc91cc586a0f4b08df677b0b0ef3e1e96cea9a1b2#tokentxns Our goal is working multisend ...
0
votes
0answers
7 views

Chain txvm vs EVM: Specified Differences

Chain txvm vs EVM: What are the specified differences between both platforms?
2
votes
1answer
21 views

could you tell me how to use the Executables evm?

i use a contract as follows : pragma solidity ^0.4.0; contract TestContract { function multiply(uint a, uint b) returns (uint) { return a * b; } } and solc --bin-runtime TestContract....
0
votes
1answer
14 views

How does the network / EVM handle same contract call within same block with same gas?

As an example take the following test contract: pragma solidity ^0.4.24; contract DoubleCall { address public superHero; uint256 public price = 1 ether; function becomeSuperHero() ...
1
vote
1answer
28 views

Multi node replication

In a multi node network, if one node is down (and a majority of nodes are up and running) for a period of time - say its down at block 100 block and rejoins when the network is at block 200. Q1: ...
1
vote
1answer
31 views

“Difficulty” opcode pushes always 0x0 to stack

Currently, I do some experiments with Geth-EVM and opcode execution. During the experiments, I observed that the DIFFICULTY opcode always pushs 0x0 to the EVM stack regardless of how I set the ...
1
vote
1answer
20 views

Two legal questions on Ethereum and Smart Contracts

1- Who answers before the judicial instances by any problem in the platform of Ethereum? 2- How does the decentralized platform of Ethereum to annul and render ineffective any smart contracts on ...
0
votes
0answers
12 views

Enterprise Ethereum Quorum - Smart Contract Abstraction? Business Logic / Application Tier

Understand that in Ethereum the Smart Contract lives on the EVM -- which holds both the state (data) and business logic. It is a somewhat collapse architecture where the data tier and business logic/...
1
vote
1answer
18 views

Numerical Value of Bools in Solidity

What is the numerical value of true and false? Presumably one is 0x0000000000000000 and one is 0x0000000000000001
1
vote
1answer
17 views

Pushing bytes to EVM stack

I am sorry if this question seems to be somewhat bad, but I am trying to work out the stack representation of the following opcodes: PUSH1 60 PUSH2 40 would the stack representation of this be: [...
0
votes
2answers
68 views

How can we implement a new opcode in the Ethereum Virtual Machine.

How can we implement a new opcode in the Ethereum Virtual Machine. For eg : I want to implement an opcode logic such that the opcode number of this operation is 0x21. The EVM-implementation I am using ...
0
votes
0answers
25 views

What does #[$] or [$] mean in remix?

Can someone tell me what the #[$] or [$] in the remix assembly output means? I assume it's a placeholder for something yet to be determined but am unable to confirm if and what. For example: PUSH #[...
2
votes
1answer
183 views

Does a function call that does not change a contract's state cost gas

I have read multiple times that everything costs gas on ethereum. But when I write and use a function that does not change the state of a contract (i.e sum up two parameters and return the sum) that ...
0
votes
2answers
86 views

How to preserve msg.sender==B when user A calls contract B which calls contract C which calls contract library D?

I have user A which calls contract B which calls contract C which calls contract D. How to call external library D from contract C while preserving msg.sender==B ? Of course, I cannot use tx.origin ...
0
votes
1answer
21 views

How does Ethereum differentiate between 0x0 and null during contract creation?

According to the EVM documentation, all values are initialized. This means to will contain the 0 address, as null is not a recognized state. The 0 address links to an external account (which we all ...
1
vote
1answer
61 views

How to run local VM from golang?

I am going to run the virtual ethereum machine from the code, pass to it a compiled smart contract code. But I do not know how to do it. It's my code: package main import ( "context" "...
6
votes
1answer
179 views

Is there any efficient way to compute the exponentiation of an fractional base and fractional exponent?

First off - not the same question as this (which is great). I need the exponent to be fractional as well. Something like 2.5^0.75
1
vote
1answer
83 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
1
vote
0answers
59 views

Why string is expensive?

Sometimes we need to use string instead of byte32 only because of one byte (or one character) and this increases the gas and the cost of transaction. For example, I want to store the assets state of ...
0
votes
0answers
28 views

How to call another contract via create and call in EVM?

I am reading the source code of EVM. And want to imitate a contract remote call. I made two contracts as below: callee: contract Called{ uint public myuint; function set(uint _var) { ...
1
vote
1answer
33 views

What’s the opcode chain for sending ethereum from a smart contract?

Simple question, but I couldn’t find the answer anywhere. I know CALL is used and sometimes CALLER, but I don’t have any idea on how msg.sender.call.value(100) would be performed.
1
vote
1answer
56 views

Will the introduction of sharding have an effect on the functionality of currently deployed smart contracts or the EVM?

Is there any risk the the hard fork required for sharding or Plasma to take effect on the Ethereum network will cause compatibility issues for contracts already deployed? Will the protocol in place ...
1
vote
1answer
34 views

What happens when transaction is sent from smart contract?

If during smart contract execution it decides to send a transaction, then transaction would be created, validated and broadcasted to the network from all the nodes executing this smart contract. ...
0
votes
1answer
61 views

Solidity unit tests for contracts with a dynamic array return type

I am writing a simple smart contract for storing an array of bytes32, pushing to it, and retrieving it: contract SimpleStorage { bytes32[] public items; event ItemAdded(bytes32 contents); ...
1
vote
0answers
40 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. ...
3
votes
2answers
43 views

Wouldn't a 64bit-based EVM be more efficient on the Ethereum Ecosystem?

As the Ethereum Rationale design says: 32 byte word size - the alternative is 4 or 8 byte words, as in most other architectures, or unlimited, as in Bitcoin. 4 or 8 byte words are too restrictive ...
4
votes
4answers
140 views

Why do you want to use different implementations of EVM?

Currently there are many implementations of EVM (Java, C++, Python, Go, etc). For example: I will be using Solidity to write DApp on the top of EVM-Java and EVM-Python, why would I want to use EVM-...
1
vote
3answers
65 views

Reading storage from another contract [duplicate]

Is it possible to read any storage spot in a contract from another contract in EVM? I don't care if it is hackish or not. My guts say that's not possible because it makes it possible to read internal ...
1
vote
0answers
34 views

Gas cost of a Message Call

I was trying to calculate the cost of a message call (CALL, DELEGATECALL, CALLCODE) following the yellow paper but I've not been able to fully understand it. It seems that Ccallgas is an isolated ...
0
votes
0answers
17 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'...
3
votes
1answer
104 views

How do the ethereum components work together

hy i have been reading about the ethereum project and its components, i understand that there are 3 major components (EVM, swarm, whisper) Swarm is a peer to peer data sharing network in which ...
2
votes
2answers
37 views

Are Ethereum Contracts Vulnerable to Hash Table Poisoning Attacks?

Does anybody know something about this? I know that in general terms we will say not, but looking on the internet I found that isn't sure the answer to the question: Can the EVM’s Internal ...
1
vote
0answers
59 views

Why Remix JavaScript VM and Web3 Provider show different behavior at the time CALL is made?

I'm using Geth evm version 1.8.4-stable to run private network and I see different behavior on CALL between the Remix environment of Javascript VM and Web3 Provider. On this example, using callHi() ...
0
votes
0answers
16 views

What is the FP in the EVM?

what is the FP in the EVM and what is it used for? Is the FP in the EVM similar to a frame pointer in other processors?
3
votes
1answer
240 views

How to receive revert() reason for past transactions?

I run a geth/parity nodes for broadcasting user's transactions to Ethereum blockchain. Some of contract functions provide reasons for revert (see examble below): contract Example { function test (...
2
votes
1answer
54 views

Assign metadata to a transaction

How can I append some (extra) data to a transaction that calls a contract method (with given parameters)? The transaction has only one 'data' field which is used to serialize the method call. If I ...
2
votes
1answer
45 views

How are storage pointers implemented in the EVM layer?

I'm trying to understand how storage pointers work. From looking at the ethereumjs-vm implementation it seems that the actual value is returned from SLOAD. Does the compiler handle the 'pointer' ...
0
votes
1answer
48 views

How does message call send gas?

contract Sample{ event Data(uint test) ; function test2() { Data(msg.gas) ; } } contract Sample2{ function try(address addr){ Sample(addr).test2() ; addr.call(...
2
votes
2answers
63 views

Why do we need to use “view” or “pure”?

I know when to use view and pure, but I dont know why we use it. Does EVM optimize anything When I use them?
2
votes
2answers
46 views

Given the current trend of Ethereum Network growth, is smart contract practical for long term usage/storage?

My question is actually three parts, (yes I know about the upcoming sharding development in progress): It's free to access Ethereum Network data (we don't normally need the rest of the blockchain but ...
0
votes
1answer
43 views

Writing to blockchain using Solidity

So I have been looking at solidity recently and got a hold of the voting app. Pretty simple to get a hold of. But here is what I am confused about (coming from the background of developing for the web/...
1
vote
1answer
28 views

What is the difference between sealing and mining a block?

I have seen numerous sites referring to sealing a block and mining a block. I understand a miner seals a block but I do not really understand what sealing actually involves. On that point, how does ...