For questions about the Ethereum Virtual Machine programming language, the programming language of smart contracts on the Ethereum blockchain.
Questions tagged [evm]
173 questions
0
votes
1 answer
Solidity getting different selector
I was playing around with selectors and particularly how they are computed (I am using Foundry for the test). I have the following example contract:
contract Token2 {
uint a = 1;
function foo2(uint b) external {
for (uint i = 0; i…

user3102158
- 173
- 9
0
votes
1 answer
How Threshold Signatures have the same Address / Public Key
I am learning about threshold signatures and their use cases on EVM Blockchains.
I am trying to understand how they are able to always have the same address.
Is the following correct? It is my understanding of how it works
A smart contract exists…

Anters Bear
- 1,816
- 1
- 15
- 41
0
votes
0 answers
What is the correct approach for load testing evm?
I am trying to create a load testing script for a simple evm with jsonrpc. I have a different type of methods in my mind.
First one is that i will send lets say 1000 requests(write transactions) to the server and wait for the responses and calculate…

T.I
- 53
- 5
0
votes
2 answers
How to generate address in metamask/coinbase progrematically?
I'm planning to build a chrome extension that interacts with Metamask/Coinbase. I wonder if this is fisibile with the current Metamask API.
Question
I need to generate a new address on the user Metamask/Coinbase wallet from my chrome-extension. Is…

Stav Alfi
- 13,139
- 23
- 99
- 171
0
votes
2 answers
Solidity Fallback Function Gas Limit
I am a bit confused with the fallback function in Solidity using Remix IDE, as far as I understand, the fallback function is limited to 2300 gas. However, when I call the fallback function by using the 'Transact' button in Remix, it does not fail…

RishtarCode47
- 365
- 1
- 4
- 18
0
votes
0 answers
My Solidity program work on Ganache but not on testnet (Goerli)
I want to get all reserve in UniswapV2 pool in one request to the EVM. Here is the code getReserve :
// SPDX-License-Identifier: MIT
// compiled with 0.8.17
pragma solidity >=0.4.22 <0.9.0;
contract IUniswapV2Pair {
function getReserves() public…

Tien-Thinh _
- 1
- 1
0
votes
0 answers
How to use staticcall with inline assembly that returns bytes data?
I've been trying to write a function that takes contractAddress and bytes functionSignature as input parameters and returns bytes data from the static call in inline assembly.
For some reason it keeps returning 0x0 instead of the data
im clearly…

Matt Jaf
- 339
- 2
- 8
0
votes
0 answers
How can I parse an Ethereum block-level logsBloom?
I have been download blocks from EVM-based blockchains via the JSON-RPC API via eth_getBlockByNumber. In the block there is a logsBloom element which, if I understand this correctly, is an aggregate of the logs of every transaction in that…

Michael C
- 53
- 6
0
votes
1 answer
Smart contract factory using an array of Struct as a parameter
I am using a CampaignFactory contract to create multiple instances of the Campaign contract and keep track of them. Every campaign is initialized with an array of Struct called rewards. When I try to create a new Campaign with createCampaign in…

Jeks
- 21
- 5
0
votes
0 answers
Calling external Contract function securely in solidity
Contract A
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
// This is just as dummy contract for testing
// DONT USE IN PRODUCTION!
contract AttackerContract is ERC721 {
constructor() ERC721("Attacker NFT",…

zOthix
- 526
- 4
- 16
0
votes
1 answer
how to use the solidity shift for non binary numbers?
I wanted to pop some zeros of a number without having to use division.(from 1000 to 10).
I checked out the operand << and i know it's only for bit shifts but I was wondering if there is a way I can use shift in solidity to do that?

Jack
- 13
- 4
0
votes
1 answer
return array of type string in solidity
if we have a mapping that is like => mapping(uint => string[])
and we want create a function that get a number and return all strings that are related to that number
how should I declare it in order to return that string array of mapping??
I want to…
0
votes
2 answers
how to run the rest of the test code after a failed call to the contract in hardhat?
I'm trying to write a test for my smart contract in hardhat with js, I want to check somethings in case a call to my contract fails the problem is that when the line of "failed contract call" runs it reverts the whole block of test and will not run…

Jack
- 13
- 4
0
votes
1 answer
How can I decode ETH Input Data from txHash?
I am trying to decode the ETH Input Data, but tried few online tools it doesn't work.
I understand it required an ABI for the decode, I used ERC721 project Moonbirds for the testing below.
It is the transaction I am trying to…

HKEF
- 1
- 1
0
votes
1 answer
How many EVM in Ethereum chain?
I am really confused for now. I am working on Solidity DEV, but today, I try to think of one question, how many EVM is in the Ethereum chain?
I am not joking. I really want to know, when to create the EVM. I have read the doc…

leiiiooo
- 83
- 1
- 5