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
51 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? ...
1
vote
1answer
39 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 ...
2
votes
1answer
152 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
309 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
123 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
34 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
46 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
122 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
58 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
98 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 ...
2
votes
1answer
83 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: ...
2
votes
1answer
61 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
229 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
93 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
99 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 ...
1
vote
1answer
117 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
66 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
107 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
105 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
56 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
75 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
80 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
152 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
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
88 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 ...
1
vote
2answers
405 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
214 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); _; } ...
3
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
171 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
691 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
97 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
135 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
323 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
33 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
184 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
457 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
79 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 ...
1
vote
1answer
281 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
333 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
58 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
158 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
477 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
92 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
88 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 ...