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
1
vote
0answers
26 views

Preserve msg.sender but not storage

In this particular scheme, we pass the address of the Attacker contract in Victim.foo. By using delegatecall, we maintain the msg.sender field, but we are not using the storage of Storage but Attacker'...
0
votes
0answers
43 views

Infura-Like caching layer to store all Events in local nodes for fast retrieve

Anyone who has tried to use a local Ethereum node to run any complex DApp will have realized that it is impossible to do so because there is a huge problem of slowness in the retrievement of large ...
0
votes
0answers
26 views

How to pass a non-deployed Smart Contract to a deployed contract and call a function on it?

I'm currently trying to pass a Smart Contract (which is NOT deployed) in byte code format as an argument to another Smart Contract (which is deployed). From within the deployed contract I want to run ...
0
votes
0answers
3 views

Transaction Gas limit vs gas used vs start gas

I was inspecting one of my transactions on ropsten and I noticed something was off. The gas limit and gas spent as shown on etherscan and in metamask are 45666 and 29034 respectively so far so good. ...
3
votes
3answers
112 views

Does an SSTORE where the new value is the same as the existing value cost gas?

For example (in Vyper): @external def foo(bar: uint256): self.baz = bar foo(3) foo(3) # Is the gas cost here still 5000? Is it better to do this instead? def foo(bar: uint256): if self.baz != ...
0
votes
1answer
13 views

Do different clients use different amounts of gas?

I'm trying to understand clients/nodes a bit can someone help clarify the below for me. My understanding is that each client implements the EVM in their own way. Smart contracts are written in ...
0
votes
1answer
15 views

Is it possible to get the current transaction's transactionIndex from within a Solidity function call?

Is it somehow possible to get the current transaction's index in the block from within Solidity? or to derive this in some indirect way?
0
votes
0answers
15 views

Comparing EVM execution times

My understanding is that there are several different implementations of EVMs (geth, parity etc.). Do the different implementations effect the execution times of smart contracts? I wanted to test the ...
3
votes
0answers
30 views

Geth, how to revert back to certain EVM state/block

I am trying to fuzz a smart contract on Geth, which involves contract state exploration. In order to explore a contract state S1, different contract functions with different inputs will be executed on ...
2
votes
0answers
17 views

What other blockchains support the EVM execution model?

In essence I'm interested in which other chains (mostly Layer 1) I can deploy Solidity smart contracts to? I know of TRON. And I also know Cosmos, Polkadot and NEAR have at least some support. But ...
1
vote
1answer
43 views

Storage Address of Smart Contract Variables

I need to know storage address of solidity smart contract variables before its deployment. how can I get this?
0
votes
1answer
27 views

How to encode data for low level call? (Compound/Uniswap governence)

I can't get the transaction to execute no matter how much I play with it. I know that it reverts during the secondary call because I always get this revert message: Timelock::executeTransaction: ...
1
vote
0answers
17 views

About Buidler Evm

1.How can I execute payable functions, like this putting the Value in the Builder console? 2.Can someone tell me the way to be able to change the address on the Buidler evm console? To execute ...
1
vote
1answer
32 views

How does the EVM identify a dynamic type in the function calldata?

So as per the ABI encoding specifications mentioned in Solidity Docs, for a dynamic array, the data location (in bytes from start, for the data part) is specified at first, followed by the length of ...
0
votes
0answers
16 views

Clarification on how Calldata persists on the blockchain and how Optimistic Rollups use it

So I see that a lot of optimistic rollup solutions say that they store the chain's transaction data on Ethereum via "calldata" which is way cheaper in gas costs than contract storage (I ...
0
votes
0answers
16 views

How does ecrecover get compiled?

How does ecrecover() in solidity work? Looking at ethervm.io there doesn't seem to be an opcode for ecrecover? To what bytes is a ecrecover() call compiled?
0
votes
0answers
17 views

Does the EVM have an opcode to check private key signatures?

I have plain and simple desire. I want my dapp users to be able to generate some data payload, sign it with their private key, and send it using any external channel (eg JSON between apps) to a ...
4
votes
1answer
26 views

Copy and deploy a smart contract from opcodes without source code

I extracted opcodes from an already existing and deployed smart contract and I would like to know if it is possible to deploy an exact copy of this contract from its opcodes? My extracted opcodes ...
0
votes
1answer
15 views

Why is my view function running out of gas when reading from mapping/HashMap?

I have the following vyper code: address_to_addresses: public(HashMap[address, address[2]) Vyper auto generates a view function called address_to_addresses(arg0: address, arg1: uint256) -> address ...
0
votes
1answer
30 views

Why uint foo = 5, foo/=6 work, but not foo = 5/6?

I'm writing a contract that evaluates (foo/x)*x to give equivalent of math.floor(foo/x)*x. It works, but if I hard code numbers instead (I don't need to do that, just interested), (5/6)*5, it is not ...
1
vote
1answer
35 views

How to find value of non-public state variable

I understand that public state variables automatically creates a getter function when deployed, its value can be accessed via the getter function. However, if a state variable is not public, how can ...
1
vote
0answers
17 views

Trying to understand the ethereum stack

I've been trying to understand the limits of the stack and how it works. It seems like the "Stack too deep" error only happens if there is an assembly block in the function. Without an ...
0
votes
1answer
24 views

Interacting with Bytecode

Is it possible to interact with a smart contract with bytecode only (without ABI)? If yes, how can I do this?
0
votes
1answer
44 views

Running a local development evm virtual machine

Is there a way to compile, run and debug a solidity class on my developpment computer. I do not want to connect to an ethereum network. I just want to debug my class Thanks
0
votes
1answer
20 views

How to determine the return address when we use CALL opcode?

I'm try to understand each opcode defined in Ethereum Virtual Machine. As for the opcode 'CALL' I find that it needs 7 arguments from the stack: gas, addr, value, argument addr, argument offset, ...
1
vote
1answer
39 views

Parameters on evm opcode create

Why the usual way to create a contract with evm opcodes use add and mload, for example: bytes memory bytecode = hex"600580600c6000396000b800602a600052b8"; ... assembly { _address := ...
0
votes
0answers
21 views

Error: CompileError: InternalCompilerError: Stack too deep, try removing local variables

Hello everyone please kindly help me out. I have researched on the error above associated with this block of code. But please is there a way to revise this code so that i can get all the data of a ...
0
votes
0answers
48 views

require Statement returns Transaction Revert Error instead of provided custom error message

For example, i have this piece of code here require(keys[_address].purpose != _purpose, "Key Already Exists"); in a Smart Contract. Upon executing a function and failing a requirement, ...
1
vote
1answer
86 views

derivation path for ethereum?

how are you doing! I would like to know what happens if from a ethereum seed I derive a wallet using BIP49, BIP84 derivation path and then send ethereum from another wallet which is BIP32 or BIP44, ...
0
votes
1answer
30 views

How to call sha256 in assembly

I wanna compute sha256 in Solidity Assembly for hash of getting bytes slice.
0
votes
0answers
14 views

importing a big standard contract

I am following a tutorial to use oracle from Provable, so I have to import "https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol". I notice that the contract is very big but ...
0
votes
1answer
26 views

How to reverse byte order in uint256 or bytes32?

Need to convert BigEndian to LittleEndian or vice versa.
0
votes
0answers
26 views

How does EVM search in the storage?

I am reading this article to understand the storage in Solidity/EVM https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/ It says that each smart contract ...
2
votes
1answer
30 views

Why can I call contract methods containing a selfdestruct multiple times?

The following code is part of a Smart Contract I'm working with: [...] function noComplain() allowed(receiver, stage.keyRevealed) public { selfdestruct(sender); } // function ...
2
votes
1answer
32 views

What are the changes to EVM from Constantinople fork and later forks? [duplicate]

What are the changes to EVM from Constantinople fork and later forks? Could you tell me which commit in git? Or Could you provide a list? Thank you!
0
votes
0answers
12 views

Geth Node stalled at EVM layer when sending higher txs to it

Hello in my private clique network with 2 Nodes I have a genesis with block period 2. Block gas limit: 500000000 I also set my miner gas limit and gas target as 500000000 to ensure a linear block ...
3
votes
1answer
190 views

Calculate transaction costs for storing data

I'm trying to figure out how the transaction costs are calculated for a transaction that is storing data on the Ethereum Blockchain. It seems I'm always off. Here is my way of calculating (I'm using ...
0
votes
0answers
21 views

which client produced the gasUsed on Etherscan?

There are many EVM implementations, such as js-EVM, Py-EVM and geth. So I was wondering which EVM implementation generated the gasUsed on Etherscan (i.e., the gasUsed got by using web3) ?
0
votes
1answer
50 views

How do exchanges work internally?

Because EVM cannot watch events, we cannot send a token to an exchange and immediately get back some other token (EVM just does not "know" when it was send a token). As far as I understand, this is ...
2
votes
1answer
116 views

How to perform delegate call inside of view call (staticall)?

Inside view method it's not possible to do delegatecall due to compilation errors. Is there any way to delegate view calls?
2
votes
1answer
95 views

Why is there a SHA256 pre-compiled contract when SHA256 is also an opcode?

The question is in the title :). Trying to understand why there is both an opcode and pre-compiled contract for SHA256. To execute the computation, would people canonically "CALL" into the pre-...
0
votes
1answer
80 views

Gnosis multisig wallet, Error in call method

This is an external function which will be called when a transaction have enough number of confirmations. function external_call(address destination, uint value, uint dataLength, bytes data) ...
3
votes
0answers
25 views

What is the purpose of DUP1 at the beginning of contact creation bytecode?

I am trying to analyse the bytecode of creating a contract and I can't figure out why there is a need for the 006 DUP1 opcode in the snippet below. 000 PUSH1 80 002 PUSH1 40 004 MSTORE 005 CALLVALUE ...
1
vote
0answers
60 views

Gas cost for ether transfer < 9000

According to the Yellow Paper, creating a transaction costs 21000 gas (regardless if it contains value) and creating a message call with non-zero call value costs at at least 9000 gas. Yet when I call ...
4
votes
2answers
206 views

Function to execute raw bytecode in EVM

Suppose, I have the following bytecode (0x610101610102016000526001601ff3) that pushes two numbers to the stack, adds them and returns the value. Now I want to write a function in Solidity that will ...
1
vote
0answers
211 views

get event logs and debug trace from eth_call

I am looking for a way to execute a transaction locally (using local geth/parity node) for simulation only, before actually submitting it to blockchain. I know that I can use 'eth_call' RPC call and ...
1
vote
1answer
31 views

Validating equality between two address variables

I'm testing the challengeOpponent function in my Connect4 contract in remix. The function creates a new Escrow contract instance so that each player in the game has a place to hold their funds until ...
1
vote
1answer
90 views

Using assembly to create a fallback function with a return value?

Is it possible to use Solidity assembly to create a fallback function that makes a DELEGATECALL to another contract, and then uses assembly to correctly store the return value of the DELEGATECALL in ...
0
votes
2answers
88 views

Costs of storing an empty dynamic array of length 2**256-1 vs length 4

If the array is completely empty, is it more expensive to store uint[] of length 2**256-1 vs of length 4?
0
votes
0answers
19 views

Where's a contract storage stored exactly and how does it interact with the blockchain? [duplicate]

From what I've understood a contract is a special account that gets initialized with a 256 bit array and this array is stored as the root hash of a merkle tree, is that correct? But where is this ...

1
2 3 4 5
11