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.

1
vote
2answers
323 views

Smart contract interaction (with another contract) example for solidity version 0.4.24 that works on Remix

I was going through this code and I decided to test it on RemixIDE... Creating a function that calls another contract I kept getting "VM Exception while processing transaction: revert" when I ran a ...
1
vote
1answer
67 views

Why are timestamps stored in a uint (256 bit) when they would fit in a uint64?

A (signed) 64 bit timestamp can store a date much larger than the age of the universe. On many platforms this would be a micro-optimization, but in the context of Ethereum, we want to squeeze every ...
0
votes
1answer
222 views

callvalue opcode, for what?

someone know what the opcode CALLVALUE is for? I would like to understand it well. Have you an example on which I can easily understand it?
2
votes
1answer
215 views

how are conditional JUMPI opcodes valid?

I've been reading this example from https://github.com/comaeio/porosity/wiki/Ethereum-Internals And I am wondering how some of these JUMPI operations are valid: loc_00000000: 0x00000000 60 60 ...
2
votes
1answer
49 views

how are negative numbers stored within the EVM stack?

for example, I have these opcodes: PUSH60 PUSH40 SUB for sub operations, I believe that the second stack item is subtracted from the first stack item (60 - 40) which would equal to -20 being the new ...
1
vote
0answers
32 views

Code scope in evm

Short question, how is code scope defined/determined by the compiler when looking at EVM opcodes (or rather bitcode)? Is it simply by looking out for jump calls or return statements? Or does it define ...
2
votes
2answers
117 views

EVM Contract Testing with JS issue - ReferenceError: artifact is not defined

There is a problem i have with a new DAPP tutorial i'm looking at from this YouTube video: I have an issue from for testing of my contract. when i run the "truffle test": it returns the following ...
1
vote
1answer
428 views

VM error: The constructor should be payable if you send value

I have used the Token Contract from https://www.ethereum.org/token#the-code . I have set the buy/sell price as 1000000000000000000 wei, but when i try to buy token from another account by sending 1 ...
1
vote
1answer
70 views

How to get notify if transaction got failed, dropped, or successes [closed]

I am new in dapps world and I want to deduct balance/points when a user buys an item currently I am unable to update balance because sometimes transaction got failed, dropped, or successes after 30 ...
0
votes
1answer
29 views

Progamming contracts in Ethereum, is it safe?

I am completely new to Ethereum. I read a lot of articles and have a question. As far as I understood, one can develop smart contracts in Ethereum that are like executable programs. In these ...
0
votes
1answer
37 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
78 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
57 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
352 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
1answer
95 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
23 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 (...
3
votes
2answers
336 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 ...
1
vote
1answer
212 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 ...
1
vote
0answers
50 views

Chain txvm vs EVM: Specified Differences

Chain txvm vs EVM: What are the specified differences between both platforms?
2
votes
1answer
41 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
25 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
67 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
48 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
29 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
30 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
37 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
41 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
1answer
70 views

Is it still possible to reach call stack depth 1024?

In the past it was possible to reach call stack depth 1024 in EVM. However I heard that now it is impossible due to gas costs. Is this true?
1
vote
2answers
266 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
34 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 #[...
3
votes
1answer
732 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
532 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 ...
1
vote
1answer
147 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
244 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
2answers
249 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
2
votes
2answers
268 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
140 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
63 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
147 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
112 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
57 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
149 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
1answer
90 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
82 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 ...
5
votes
4answers
374 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
419 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
127 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 ...
1
vote
1answer
58 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
223 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
3answers
127 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 ...