Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
1answer
23 views

What is the non-transactional behavior of the EVM?

This question is about Solidity code that reads the state of a deployed contract on a Geth node using web3.js. When I call claimsProcessed() with a different account than admin, I expected it to throw ...
0
votes
0answers
12 views

get error code of “uint64 overflow” when create contract

when create contract in statedb, i get error code the error is gas uint64 overflow, the code data is not much and i just give it little gasprice, the code is following: func NewContext() vm.Context { ...
1
vote
1answer
20 views

Method to verify an address nonce within a contract?

Hey I'm looking for a simple way to verify that a certain address has executed x number of transactions? I noticed that this can be accomplished by having them deploy some contract and verifying ...
1
vote
1answer
31 views

Why EVM and Solidity and not JVM and Java?

Why wasn't JVM and Java used for Ethereum? But instead, EVM and Solidity was invented for the express purpose for Ethereum?
1
vote
0answers
38 views

Can solidity bytecode has unreachable code

I've compiled contract from https://theethereum.wiki/w/index.php/ERC20_Token_Standard (Sample Fixed Supply Token Contract: contract FixedSupplyToken version:0.5.1+commit.c8a2cb62) I try to make ...
2
votes
0answers
14 views

What is the methodID for SafeMath function when SafeMath library is referenced internally?

For the contract below contract Example { using SafeMath for uint256; uint256 internal _amount; function example(uint256 amount) external { _amount = _amount.add(amount);...
1
vote
1answer
40 views

Debugging a VM error in solidity

I'm getting the following error while running a test in truffle: Error: Returned error: VM Exception while processing transaction: revert Now, the code is simply to big and complicated to run ...
1
vote
1answer
44 views

Must precompiled contracts be natively implemented?

Instead of just having special native code for each precompiled contract, a client could have special gas metering for those (as it is their main purpose) but keep the logic as EVM instructions. ...
0
votes
2answers
48 views

Mine transaction but do not broadcast

I have four transactions which I would like to include in the same block, T1, T2, T3, T4. There is a race condition so I do not want to broadcast these transactions unless I can be sure they will ...
2
votes
1answer
39 views

Where can I learn to read a flow of opcodes and learn how to debug transactions?

There are many tools and visualizers to use to read through a transaction, but where can I go to learn how to understand this? Fore example, that first link has a series of opcodes (and their ...
1
vote
0answers
18 views

Passing constructor arguments in the NewContractCreation in go-ethereum

I am trying to create a transaction to deploy a contract using the types.NewContractCreation() method in the core folder of go-ethereum. However I don’t understand how to pass the parameters of the ...
5
votes
1answer
49 views

How to jump to any arbitrary location in already deployed contracts

I’d like to know what is preventing me to write an assembly code who knows the contract address and call some arbitrary functions, even if declared “internal” via a simple JUMP. In theory I can: 1) ...
1
vote
1answer
59 views

What are the differences between Monax/Hyperledger Burrow and Quorum?

Are there any significant differences between these protocols? Thank you for answering.
1
vote
3answers
59 views

Calldata with too many parameters

While reading https://solidity.readthedocs.io/en/v0.4.21/abi-spec.html#abi I was just thinking what happens when calldata contains more parameters/data than the function expects (I know first ...
0
votes
1answer
38 views

Is it possible to send Ether using delegatecall?

I tested this in Remix and it seems that the ether remains in the delegator contract and doesn't get forwarded. Using the code below to test: contract SomeContract { address public sender; ...
4
votes
1answer
213 views

Why does solidity check only the first 4 bytes of the calldata to determine the method?

I was doing research on EVM and solidity and I came across this fact that the calldata/input data is created using RLP encoding and stuff. I know the process and I don't want to elaborate on that. My ...
0
votes
0answers
20 views

How to call a function automatically when some condition gets false?

I am having a bidding session where every time a person Bids on some product it checks the condition if the bidding session is valid or not, I want to trigger a finalize bid function which will ...
0
votes
0answers
29 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
39 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
26 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
32 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
21 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
102 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
48 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
40 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
45 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
54 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
54 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
18 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
45 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
59 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
45 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
115 views

Gas costs of the following contract

I'm calculating the gas costs of the following contract: 0x6001600190016007026005016002900460049060016021900560150160030260059007600303600960110a60005260086000f3. Disassembled versions: contract ...
2
votes
0answers
93 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
101 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
50 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
95 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
46 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
71 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
28 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
27 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
71 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
133 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
77 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
28 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
30 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
49 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
42 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
42 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 ...