Questions tagged [evm]

For questions about the Ethereum Virtual Machine programming language, the programming language of smart contracts on the Ethereum blockchain.

173 questions
8
votes
1 answer

Can I use the block height to measure the passage of a year based on the average block time in RSK and Ethereum?

I want to build a Solidity smart contract in RSK and Ethereum that pays dividends every year. Should I use the block time or can I rely on the block number, assuming a the current average inter-block time in RSK and Ethereum?
Sergio Lerner
  • 216
  • 1
  • 4
5
votes
2 answers

Do you need SafeMath in Solidity version 0.8+ , and if not, can you still import it?

I have a solidity smart contract like this pragma solidity >=0.7.0 <0.9.0; can I still import SafeMath even if it's not needed for 0.8+ ? Since SafeMath is working with 0.7, but my contract specifies it accepts 0.7.0 up to lower than 0.9.0 what will…
msa720
  • 115
  • 2
  • 7
5
votes
1 answer

I tried use cmake to make project, but it called an error ld: library not found for -levmc::loader

I git clone a project called evmc in github. I try to build the example folder in this project by cmake. But here are some errors called: With cmake . -- Configuring done CMake Error at CMakeLists.txt:23 (add_executable): Target "evmc-example"…
张品戈
  • 89
  • 1
  • 4
4
votes
0 answers

How to implement multiple inheritance with OpenZeppelin upgradeable contracts?

I'm trying to convert an existing non-upgradeable contract that has multiple inheritance into an upgradeable one. I'm following the tutorial at https://docs.openzeppelin.com/contracts/4.x/upgradeable and the only thing I've found in docs is the…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
4
votes
1 answer

How Events in solidity are stored on ethereum blockchain?

I was reading Event's documentation. I encountered this paragraph. Can someone explains it in simple words? You can add the attribute indexed to up to three parameters which adds them to a special data structure known as “topics” instead of the…
Naman Vyas
  • 99
  • 5
4
votes
1 answer

What is a gas lane in chainlink and blockchain?

I do understand the concept of gas in the ethereum blockchain and why gas is needed to compensate miners for providing computing power to the network. However, when I was reading up on the chainlink vrf get a random number documentation it says that…
4
votes
2 answers

TransactionError when using Brownie on Optimism - Tx dropped without known replacement

I have a Python script using Brownie that occasionally triggers a swap on Uniswap by sending a transaction to Optimism Network. It worked well for a few days (did multiple transactions successfully), but now each time it triggers a transaction, I…
tseror
  • 41
  • 3
4
votes
2 answers

Why assertion is used on this Smart Contract?

contract Sharer { function sendHalf(address payable addr) public payable returns (uint balance) { require(msg.value % 2 == 0, "Even value required."); uint balanceBeforeTransfer = address(this).balance; …
Cengo
  • 93
  • 5
4
votes
1 answer

How does EVM memory data location of the first two 32-bytes slot be used?

solidity doc says: 0x00 - 0x3f (64 bytes): scratch space for hashing methods how can i understand "scratch space for hashing methods" ?
jayphbee
  • 41
  • 1
4
votes
1 answer

Go-Ethereum | How to connect to public Ropsten(testnet) running on local

Basically I want to connect to the public Ropsten testnet. I run geth on local with several options. (--testnet, --rpc, --rpcapi, console). I thought I can get my (ropsten) account and check how much 'ether' or 'erc20 tokens' that I have on ropsten…
rachel_hong
  • 471
  • 2
  • 6
  • 15
3
votes
1 answer

Extracting emitted events (logs) from geth transaction trace (debug_traceCall)

When using debug_traceCall, I get a low-level EVM trace of all opcodes and state changes during the execution. This is excessively detailed. When I use default callTracer, I can get a much nicer call tree. However, neither way I cannot seem to be…
pokrovskyy
  • 437
  • 5
  • 8
3
votes
0 answers

How are blocks processed while syncing Ethereum blockchain in full sync mode?

I am syncing a Geth client in full sync mode and also have made some changes in the client to log the execution time , time stamp and block number of all the opcodes executed in the Ethereum virtual…
Proton
  • 343
  • 4
  • 18
3
votes
1 answer

What flavor of underlying EVM is Substrate Frontier using (the EVM-compatible client)?

I was able to successfully build my own Ethereum-compatible Substrate by basically following the Substrate Dev Frontier Workshop tutorial ( which uses SputnikVM as the underlying EVM engine, as per the Frontier Evm Documentation ). I am aware of the…
Andy B.
  • 181
  • 2
  • 9
3
votes
0 answers

trying to understand EVM bytecode emitted by solc

I'm trying to understand the bytecode emitted by solc. My source program is the following; the assignments dummy = 0x1234567890 and z = 0xdeadbeef are to make it easier to recognize the start of the function in the generated bytecode. pragma…
debray
  • 131
  • 2
3
votes
1 answer

How to implement the EVM Trait for a Substrate Runtime?

Following the adding a module to your runtime, I'm trying to implement the Parity Substrate paint-evm trait for the Dothereum Runtime. The EVM module trait is defined as follows: pub trait Trait: Trait + Trait { type FeeCalculator:…
q9f
  • 11,293
  • 8
  • 57
  • 96
1
2 3
11 12