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
30 views

How to get the return value of a contract from a contract call?

If a contract does returns something, (whether a string or return true/return false) how to get it’s return value ? I mean where does the return value is stored ? Is necessary to use RETURNDATACOPY or ...
2
votes
1answer
402 views

EVM opcodes-prices

1) Why are opcodes in Ethereum priced the way they are priced and why is the EVM so expensive? 2) Right upfront, I do not say that it is too expensive to perform a tx on Ethereum, I just say that ...
0
votes
3answers
32 views

Is it possible to find out dynamic array size looking at a smart contract?

This question already answers that in order to get the size of an array programmaticaly, a getter should be defined. However, assuming that there isn't a getter, is there a way to find out size of a ...
1
vote
1answer
44 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 ...
2
votes
1answer
27 views

Can Array.push Fail?

Is it possible that Array.push to fail? I noticed we never check whether it fails or not and thought it can be a vulnerability if an adversary makes it fail.
1
vote
2answers
320 views

Is it possible to retrieve an event log from a reverted transaction?

I know there is an upcoming change to solidity which will allow the returning of require() calls with a string error message. But I'm wondering if it's possible to do something like this now. Since ...
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 ...
2
votes
1answer
55 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 ...
1
vote
1answer
121 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?
3
votes
1answer
82 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(...
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) ...
88
votes
7answers
37k views

What is an ABI and why is it needed to interact with contracts?

ABI is referenced in many places including the official Ethereum website. What is an ABI and why is it necessary to use?
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 ...
1
vote
1answer
107 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 ...
0
votes
0answers
17 views

address.call(abi.encodeWithSignature(“func(<param>)”, _params) doesnot work

contract C1 { uint public num; address public sender; function callSetNum(address c2, uint256 _num) public { (bool res,) = c2.call(abi.encodeWithSignature("setNum(uint256)",_num)); ...
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
2
votes
1answer
22 views

Why does function GetEVM set the balance of from address to MaxBig256?

As you can see in this line, func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) { state.SetBalance(...
0
votes
1answer
45 views

Are state changes reversed if the contract “crashes” during execution?

Are state changes reversed if the contract "crashes" during execution? I know that state changes are reversed, if the contract runs out of gas during execution. However, are state changes also ...
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 ...
2
votes
1answer
75 views

Using 'call' from a constant function

I am trying to determine the behavior of call when executed from a constant function. Of course, the compiler issues a warning on that: Warning: Function declared as view, but this expression (...
1
vote
1answer
51 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 ...
0
votes
1answer
55 views

Why is eth.coinbase node based and not blockchain based?

I have tested with geth using --datadir and found that if I have more than one node created using personal.newAccount then the account data is not shared. This seems confusing to me. I believed ...
1
vote
1answer
50 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
1answer
109 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 ...
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
19 views

Which software is considered as an EVM Interpreter?

I am reading an article which talks about EVM interpreter but does not provide the name of interpreter. Is solc an EVM interpreter? Zulfi.
1
vote
1answer
93 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. ...
5
votes
1answer
68 views

Ethereum client implementation

I think to better my understanding of the EVM and underlying file system, I want to read through one or more ethereum client implementations and potentially build a client myself. So far I've been ...
3
votes
2answers
62 views

In Casper, what is the incentive to store the entire chain?

Do the validators need information from the blockchain to produce blocks, or is it enough just to store a few recent blocks? What is the incentive to use large amounts of storage to store the complete ...
0
votes
2answers
356 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: ...
0
votes
2answers
200 views

Smart Contract with web3j - Stored SHA hash returned is not the same as input

I have a contract that stores sha-256 hashes of documents (stored as bytes32). I also have a method to retrieve a hash that is mapped to a unique id for the document. However, when I retrieve and ...
0
votes
1answer
102 views

How to tell the contract deployed size? (Error: The contract code couldn't be stored, please check your gas amount.)

I get Error: The contract code couldn't be stored, please check your gas amount. whenever I deploy to any test network (rinkeby, ropsten) or the live network. Deploy to a local Ganache works perfect. ...
19
votes
1answer
2k views

Are events permanently stored and reliably available to contracts in the future?

I've seen this forum post about using Ethereum as an event store: Events in Solidity, using blockchain as eventstore. However, it doesn't seem conclusive. For instance it says: I confirmed with ...
52
votes
5answers
13k views

How can you decompile a smart contract?

On the blockchain I can inspect the code of a contract, and see the EVM opcodes. Is there a way to decompile this and convert it back to (Solidity) source code?
1
vote
1answer
97 views

Verify multiple state channel signatures in one transaction

What are some ways to verify multiple state channel signatures (using ECverify) in a single transaction?
1
vote
1answer
113 views

How does the EVM connect to all the blockchain nodes?

Someone recently told me that Ethereum does not use IP addresses to work out the node connections. I know networkid is used in the connection but how does networkid translate into the EVM finding the ...
0
votes
0answers
40 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 ...
0
votes
1answer
58 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
1answer
136 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 ...
1
vote
1answer
64 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 ...
2
votes
1answer
64 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?
3
votes
1answer
14 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
1answer
21 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 ...
0
votes
1answer
237 views

Threat Model Question - Code Injection / ROP possible in Ethereum Smart Contracts?

I am trying to understand a basic threat model for Ethereum Smart Contracts, to perform some research on how existing attacks techniques may be applied here as well. Is there a risk of a contract with ...
2
votes
2answers
190 views

Does the EVM process transactions or is it used solely to execute contract code?

Does the EVM process transactions or is it used solely to execute contract code? I wonder whether the EVM is used to process transactions? I know it is used to execute (or interpret) the bytecode of ...
3
votes
1answer
223 views

How to use evm compile?

I have been testing with evm and I am not getting any output. Code - pragma solidity ^0.4.18; contract d8 { function myBalance() pure public returns (uint) { return 880; } } My ...
2
votes
1answer
303 views

Why can't the return value of a transaction be included in the transaction receipt?

Shouldn't this be possible as the return value will be known when the receipt is created?
2
votes
2answers
296 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. ...
2
votes
1answer
239 views

Formal definition of the EVM as a Turing Machine

I am trying to understand the EVM in the context of a classic Turing Machine. I have read through the yellow paper and taken what I can from the internet, but I still feel like I could use some help ...
1
vote
3answers
69 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 ...