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.

0
votes
0answers
16 views

Instantiation of an EVM on goLang

I'm dealing with goLang on an go-ethereum fork. In order to query a contract endpoint I need to get a fresh EVM reference for properly call the contract. I've found there is a NewEVM function that ...
1
vote
1answer
40 views

After EIP 198 introduction, how much gas is required for RSA signature verification in solidity?

Thanks to the introduction of EIP 198, RSA signature verification is now feasible in Ethereum. How much gas is required for such a verification?
0
votes
1answer
16 views

What does it mean that Solidity can encode arbitrary state transition functions?

From Ethereum White Paper: "What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create "contracts" that can ...
3
votes
1answer
79 views

How to get an evm reference inside go-ethereum GetBalance function?

In order to modify GetBalance function to fork go-ethereum, I find difficulties to get a reference of the running evm. The function has a reference for self *StateDB: func (self *StateDB) GetBalance(...
0
votes
1answer
19 views

Multiply small rational number to obtain integer piece

I'm trying to make some advanced calculations in Solidity. I was able to successfully implement the algorithm on my contract, but its results are way below zero, and whenever I try to get it with ...
1
vote
1answer
56 views

how execute smart contract step by step?

I have a few problems understanding the step of execution of transaction in smart contract. 1-When a user send a transaction to smart contract, this smart contract is not executed immediately instead ...
0
votes
1answer
43 views

Unhandled promise rejection (rejection id: 1): Error: Transaction has been reverted by the EVM:

I don't know where i'm doing mistake. I have deployed my contract through remix and truffle and it was deployed without any mistake but now i'm deploying it from web3 solc@0.4.24 version and EVM is ...
1
vote
2answers
36 views

Get values from stack when certain Opcode is called

I am currently trying to use genetic algorithms to automatically generate test cases that for ethereum smart contracts similar to https://ieeexplore.ieee.org/abstract/document/7840029>this paper. In ...
5
votes
1answer
91 views

Why does gas cost explode with more than 7 variables in a struct

I'm assuming this has to do with Ethereum's 7 variable stack limit but in the following code test struct TestStruct5 { uint8 m_nOther1; uint8 m_nOther2; uint8 m_nOther3; uint8 ...
0
votes
1answer
24 views

What are the differences between Hyperledger Burrow and Ethereum?

What are the main differences for these two platforms (I know that Burrow runs EVM style smart contracts in a permissioned environment. Does that mean Burrow supports all the different smart contract ...
0
votes
0answers
29 views

Gas is 0 when executing CALL opcode?

I wrote a very simple smart contract like this: contract Test{ function test1(address payable addr, uint256 value) payable public { addr.transfer(value); } } And I compiled it using ...
0
votes
1answer
37 views

What's the root cause “contract error - Gas estimation failed Gas estimation errored with the following message (see below)”?

Rest of the error: The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. I got that message on several cases, usually on different mistakes. What'...
1
vote
1answer
42 views

EVM bytecode debugging jumps

How can i determine forehand the destination of JUMP for which there is no PUSH instruction thst preceeds it and the entries in the code where they where set, when analysing the bytecode? I looked ...
0
votes
0answers
40 views

How does UTXO fit into this schema?

I have been rather confused by the eponymous web3 stack introduced by the Web3 Foundation. https://wiki.web3.foundation/en/latest/tech_stack/Layer-0/platform_neutral_computation_description_language/ ...
0
votes
1answer
12 views

Unstructured storage proxies. Variables not being overwritten?

When using delegate call I was under the impression that storage slots declared in the proxy will be overwritten by the implementation. Unstructured storage implementations declare bytes32 variables ...
0
votes
1answer
25 views

Are current ethereum opcodes prices in pyethereum updated?

I am not an expert in opcodes for Ethereum, but I am wondering if their prices here [https://github.com/ethereum/pyethereum/blob/develop/ethereum/opcodes.py] are updated as the latest version used by ...
3
votes
1answer
13 views

Create a slightly customized version of ethereum and run it as a node on a public ethereum blockchain

I might need a small modification to ethereum virtual machine but I still want to run it as a node on the public blockchain not private, if that makes sense. I assume its doable? Since I will not be ...
0
votes
0answers
15 views

Delegatecall not changing state

I was trying the code in https://gist.github.com/sogoiii/f0ced0a4e569b5f38d302e7072d78b43 to observe the difference between call and delegatecall. pragma solidity ^0.4.18; contract D { uint public ...
0
votes
1answer
50 views

Can Ethereum verify zk-SNARK proofs?

I am wondering if the Ethereum Virtual Machine can verify a proof generated from a certain statement? Are there any precompiled contracts for verifying a proof?
0
votes
1answer
23 views

Which `EVM` bytecode is actually used to “deposit” the transferred Ether?

A quick question. Which EVM opcode is actually used to "deposit" the transferred Ether into the contract? From the EVM opcode list, there are only two opcodes related to the fund transfer: balance and ...
1
vote
0answers
26 views

How to use the 'evm' command of go-ethereum?

I'm just engaging in geth development and was trying to put some changes into evm opcode implementation(functions like opAdd) for debugging. After compilation done, I found that there is a command '...
0
votes
0answers
25 views

Strange behavior of solidity program

After a long debugging I found that I had two following problems in a private ethereum network using geth: If I have a require statement then the code is not executed on the EVM. The solution I found ...
2
votes
1answer
27 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
25 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
34 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
85 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
43 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
20 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
87 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 ...
2
votes
1answer
81 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
94 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
64 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
21 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
68 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
111 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
99 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
89 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
237 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
28 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
39 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
62 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
31 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
36 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
24 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
169 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
3answers
64 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
48 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
60 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
123 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
55 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 ...