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
5
votes
1answer
61 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
58 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
37 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 ...
2
votes
1answer
68 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(...
0
votes
1answer
80 views

Contracts are “instantiated” by the account creating transaction?

I read the following in a research paper: Short Paper: Formal Verification of Smart Contracts that: contracts are “instantiated” by the account creating transaction; this will allocate the ...
0
votes
2answers
368 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
175 views

what are the diffrences between <address>.call and <address>.<function name>?

contract GatekeeperOne { address public entrant; modifier gateOne() { require(msg.sender != tx.origin); _; } modifier gateTwo() { require(msg.gas % 8191 == 0); _; } ...
2
votes
1answer
2k 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?
2
votes
1answer
147 views

How does a contract's constructor work and load input values?

I set up the following contract: pragma solidity ^0.4.25; contract Simplest { uint x; constructor(bool _lucky) public { if (_lucky == true) { x = 7; } else { ...
3
votes
1answer
671 views

Understanding how a simple contract breaks into bytecode

I'm trying to understand how contracts look in terms of bytecode and struggling to do that just based on the yellow paper. In particular, consider the following empty contract: pragma solidity ^0.4....
2
votes
1answer
87 views

Out of gas error when reading from blockchain?

function getPosts(address[] subscriptions, uint[] subscriptionIndexes, uint count) public view returns (address[], bytes32[], bytes32[], uint[]) { address[] storage ...
0
votes
1answer
123 views

Opcodes PUSH, DUP and SWAP?

I studied EVM implementations and the bytecode sequences used by them. I wondered that there are three opcodes which are recognized by the EVM but actually are invalid opcodes. B0 PUSH B1 DUP B2 ...
3
votes
1answer
304 views

How do we enable smart contracts on UTXO based chains?

Smart contracts fundamentally enable change of state programmatically. (Is that a fair fundamental description?). How would one go about enabling smart contracts on UTXO based blockchain as against ...
2
votes
1answer
32 views

Assertion Rely on Balance Amounts

Is it possible in Ethereum blockchain to have two or more events simultaneously occurred? Regarding the following solidity code: function _transfer(address _from, address _to, uint _value) ...
4
votes
1answer
177 views

What Sequence Occurs 'Under the Hood' When an Ethereum Contract Function is Called?

It seems when a single function is called, the Ethereum Virtual Machine: Does 'pre-call checks' for exceptions/errors. Computes the amount of gas needed, checks that the accounts involved exist. ...
1
vote
2answers
404 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
74 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
258 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
266 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
55 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
33 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
144 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
452 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
80 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
31 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
42 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
87 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
62 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
415 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
100 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
384 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
241 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
60 views

Chain txvm vs EVM: Specified Differences

Chain txvm vs EVM: What are the specified differences between both platforms?
2
votes
1answer
44 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
26 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
71 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
53 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 ...
2
votes
1answer
35 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 ...
1
vote
1answer
38 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
45 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
89 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?
2
votes
2answers
295 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 #[...
4
votes
1answer
823 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
584 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
163 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
280 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" "...
7
votes
2answers
285 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
308 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. ...