Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 answers
5 views

Tokenized margin positions

Is there a protocol in DeFi that tokenizes long & short positions? So you're able to buy a token that represents all variables from N position.
dNyrM's user avatar
  • 918
0 votes
1 answer
11 views

A smart contract already has a non-zero balance even at the start of its non-payable constructor

Solidity compiler version: 0.8.23 Foundry version: 0.2.0 When deploying a smart contract to a forked url of Sepolia, using: console.log("Contract Balance: ",address(this).balance); as the ...
Mighty_Hotdog's user avatar
0 votes
0 answers
14 views

Uniswap v3 Mainnet vs Sepolia EvmError: Revert

I'm struggling to solve EvmError: Revert, while calling createAndInitializePoolIfNecessary function on Uniswap v3 NonfungiblePositionManager contract. I have wrote function that contains this code: ...
Neftyr's user avatar
  • 3
0 votes
0 answers
23 views

How do I determine the constructor bytecode for contracts created by another contract

I am looking to decode constructor arguments for EVM contracts. Some contracts are created by externally owned accounts, but many are created via a contract transaction. In both cases how can I ...
Matthew's user avatar
0 votes
1 answer
40 views

I can't deploy my Token because of EVM version (?)

This is my code, I tried every evm version paris,berlin,istanbul etc. I can't figure out why it doesn't work. Also this is a school project that's why the version is very old we're using an old parent ...
Erdem Arif Akalin's user avatar
0 votes
1 answer
51 views

ERC721 NFT is empty in Avalanche Fuji Testnet

I am using OpenZeppelin to generate this simple contract and Remix IDE to deploy it and interact with it using Core Wallet as injected provider: // SPDX-License-Identifier: MIT // Compatible with ...
Jose Miguel Vega Lopez's user avatar
0 votes
0 answers
18 views

Uniswap OLD revert after swap

I am initializing new pool, and have a contract that allows doing swap on it utilizing TWAP Oracle. I have tested the TWAP and in tests it needed 1 second delay to return correct quotes, until doing a ...
Jan Kwiatkowski's user avatar
1 vote
1 answer
18 views

How do forks in Foundry work?

What you fork a chain in foundry, what chain data does it copy? Does it copy OPCODEs and their gas as well?
smol-ninja's user avatar
1 vote
1 answer
70 views

Do all EVM chains use the same minimum transaction gas of 21000?

Do all EVM chain use 21,000 gas as a minimum transaction gas for simple ETH payments? Optimism seems to do so. How about the other EVM chains?
Paul Razvan Berg's user avatar
1 vote
0 answers
16 views

Ethereum RETURN opocde memory expansion cost

I am currently implementing a version of the ethereum EVM and am running into a problem when implementing memory expansion costs for the RETURN opcode. When returning data from addresses outside the ...
max-wickham's user avatar
1 vote
1 answer
27 views

Storage ops / gas spent

Is it possible to know the amount of storage operations (or gas spent) that are between, let's say 4 functions, or a full contract? Is foundry capable of this? Thanks!
dNyrM's user avatar
  • 918
0 votes
1 answer
17 views

can we send value as well as call smart contract function using CALL

CALL opcode consumes value of the stack (which is transferred to the account). It can also additionally consume stack items to pass input to the smart contract account function. Can both happen ...
Sudeep Kumar's user avatar
1 vote
2 answers
28 views

what's the point of CODECOPY opcode

CODECOPY is used to copy the executing program's opcode onto the memory. I wonder what's the use of this though. Is there a deployed example where CODECOPY is useful?
Sudeep Kumar's user avatar
0 votes
1 answer
28 views

Is it safe to reuse same memory slots for both inputs and ouputs when working with assembly call?

Is it safe to reuse memory for both inputs and ouputs when working with assembly call? If not, what can go wrong? Contract below uses assembly to call Target contract YulStaticCall { function ...
tsknakamura's user avatar
3 votes
1 answer
151 views

Issue with Accounts Not Displaying in Remix VM (Cancun and Shanghai) Environments

I'm encountering an issue with Remix VM where, after successful compilation, the accounts are not displaying in the "Deploy" section. This problem persists in both the Cancun and Shanghai ...
Piña's user avatar
  • 33
0 votes
1 answer
38 views

Why the method _castToPure in hardhat/console.sol can convert a view method to a pure one?

I have a question when read the console.sol. There is a method named _castToPure that can convert a view method _sendLogPayloadImplementation into a pure method. I cant understand the reason and ...
Alvan's user avatar
  • 31
0 votes
1 answer
19 views

How to determine whether code is running in a JS VM such as Remix, as opposed to ETH mainnet?

block.chainid always returns 1 for both Remix VM and ETH mainnet. There has to be some intrinsic variable that will always return a different value compared to the other environment. I'm aware I could ...
Ashraile's user avatar
  • 125
0 votes
1 answer
30 views

Deploying contract through create2 is returning a zero address

In this function I am deploying a contract through create2 and in this NFTImplementation is just a standard ERC721 implementation. The function always reverts due to the address returned from the ...
SMdG's user avatar
  • 1
0 votes
0 answers
10 views

Adding a custom devnet to remix

I am trying to deploy a smart contract to a new EVM Devnet with its dedicated ChainID. I've got the RPC endpoint, but when I try to add it as a custom External HTTP Provider in remix, I get an "...
GoLDs's user avatar
  • 1
0 votes
1 answer
45 views

Runtime bytecode not contained in creation bytecode

I'm currently delving into EVM and contract bytecode. My understanding is that by sending a transaction to the NULL address with both the initcode and contract code, and ensuring that the init code ...
kaspyjrefluss8's user avatar
1 vote
1 answer
106 views

How can I decode the output of the first call and use it to send a transaction?

I am attempting to call view function “0x…” with argument of value “3…” to a specific address “0x…” and also send X wei to that address I am looking to acquire the hash of the successful tx. Tools/...
QuantumDomain's user avatar
1 vote
0 answers
13 views

Blind signing when trying to send USDT over Arbitrum network

I am trying to send USDT ERC20 token through arbitrum network and all things go well until i want to personally sign it using my hardware wallet. seems like the ABI is wrong or corrupt as i get bling ...
saugat giri's user avatar
0 votes
2 answers
29 views

Why out of gas if it doesn't consume that much in the end?

I tried modify gas limit to a number I checked it should be enough to run transfer on USDT (62,800) but failed with "out of gas" error. When I send another transaction without modifying ...
zklim's user avatar
  • 1
0 votes
0 answers
15 views

I mistakeanly sent my tokens to the BSC contract address

I mistakeanly sent YOURAI to the BSC contract address 0x27f16d9a5095b763baeadd7dd78e83288af . Can someone please take a look at the contract and see if the tokens can be recovered?** Thank you. I send ...
crypto384em's user avatar
0 votes
1 answer
20 views

How can a contract have funds on another chain?

I've been looking at some random contracts on EVM compatible chains and noticed some of them have funds on the Ethereum network or another EVM network. For example, https://polygonscan.com/address/...
De ruige's user avatar
  • 123
1 vote
1 answer
31 views

How optimize array of uints in function call input arguments to decrease msg.data size?

I have a Solidity function like sampleFunction(uint[]calldata) which takes an array of uints which contains 6 numbers [1900000000000000,1,990,990,2,1]. Far as I know these input variables will consume ...
rihekopo's user avatar
  • 316
0 votes
1 answer
42 views

How to calculate fee when dealing with different decimals token?

I'm kinda struggling here to find a solution. I have a code where user can deposit token like USDC, DAI etc... For example USDC had 6 decimals and DAI has 18 decimals. How can I have a generic fee ...
0xAurora's user avatar
0 votes
0 answers
20 views

Remix Gas Limit, Transaction Cost, Execution Cost calculation

As can be seen in the screenshot, I am trying to deploy an entirely empty smart contract locally. The gas limit is set to 3, so logically, this should revert the transaction, right? However, it ...
Mark's user avatar
  • 13
1 vote
1 answer
53 views

What is the metamask algorithm for creating accounts based on one seed phrase?

Metamask uses one seed phrase to generate other accounts. Thus, with one seed phrase you can restore all accounts. But what is the algorithm for this? I want a script that could show 10 of my accounts ...
Илья Зелень's user avatar
1 vote
0 answers
29 views

Can I store a secret on evm without using zkp

I want to gatekeep a contract function by only allowing it to be called through an API endpoint. I tried using this Verifier library but uses alot of gas. Is there a simpler more cost efficient ...
Ibra's user avatar
  • 71
0 votes
0 answers
42 views

How to create a ZKP rollups on top of any EVM (eg. Hyperledger Besu) blockchain network?

I have a Hyperledger Besu network running, with IBFT 2.0 consensus protocol, up and running. I'm figuring out how could I deploy a layer 2 network, on top of this Besu network, in order to increase ...
Alexander Herranz's user avatar
0 votes
0 answers
30 views

Equivalent of hardhat local node in golang

I would like to know if Golang has any tools like Hardhat to simulate blockchain's environment/local node with persisting state. I want to create an app that for a given wallet and token address ...
Kacper's user avatar
  • 1
3 votes
1 answer
184 views

Where does Metamask store the private key (when the account is only locked with a machine-specific password)?

Where does Metamask store the private keys of an EVM-account after one recovers an account with private keys? Does it cipher the private keys before writing to storage, e.g. encoding with the access ...
Mila A's user avatar
  • 1,219
0 votes
1 answer
41 views

Find out revert/error reason

I have a forwarder contract that calls a function (joinChallenge) on behalf of a user(gasless). User successfully signs permit request. I'm getting a revert on the execute call for forwarder.execute. ...
Ibra's user avatar
  • 71
0 votes
1 answer
363 views

Getting pancake swap's v3 price via eth_call

I need to get price of PCS v3 pairs. I see that Pancakeswap makes call to https://nodes.pancakeswap.info/ [ { "data": "...", "to": "..." }, "....
LLDimup's user avatar
1 vote
2 answers
38 views

Is it possible to encode a struct to calldata when calling another function?

Let's say I have the following struct: struct Price { uint value; } Let's say I have the following function: function isPriceOkay(Price calldata price) public pure returns (bool) { return ...
robeng's user avatar
  • 41
0 votes
1 answer
21 views

Why does adding a new external function increase gas for calls to all other functions?

I have added a new external function to my Solidity smart contract. When checking the gas usage for calls to other already existing external functions, I see the gas usage has increased slightly. Does ...
UpsideDown's user avatar
0 votes
1 answer
103 views

Can we upgrade the Name and Symbol of ERC20 Token

Exploring Options: Can the Name and Symbol of an ERC20 Token be Upgraded? 🚀 Seeking insights from the crypto community! 💡Considering a potential upgrade for our ERC20 token's name and symbol. Any ...
Sohail Ghafoor's user avatar
0 votes
1 answer
773 views

How to know the default evm version of a specific version of solc

I have multiple versions of solc installed ❯ asdf list solidity 0.4.24 *0.8.23 latest solc includes the default evm version in the help output: ❯ solc --version && solc --help|grep evm ...
sify's user avatar
  • 101
0 votes
1 answer
23 views

SSTORE to stockpile gas for times of high prices?

lets assume Gas drops to 5 GWei. I could have a contract, which performs a bunch of SSTORE operations. 20k Gas each Now, assume Gas increases to 50 GWei. Now I will empty the storage slots SSTORE[x] = ...
Derawi's user avatar
  • 101
1 vote
2 answers
52 views

How are bytes and bytes32 different in inline-assembly?

function mloadTest1() public pure returns(bytes memory) { bytes memory a; assembly { a :=mload(0x40) } return a; // 0x20 } function mloadTest2() public pure returns(bytes32) { ...
imelon2's user avatar
  • 548
3 votes
2 answers
126 views

Why does mload(0x40) result in 0x20?

I ran the code below and had a question. function mloadTest1() public pure returns(bytes memory) { bytes memory a; assembly { a :=mload(0x40) } return a; } mload(x) is a Yul ...
imelon2's user avatar
  • 548
0 votes
0 answers
22 views

when a contract nonce will increase, and why? [duplicate]

when we send a transaction with a EOA, the nonce will increase to ensure the sequence and ... but mu question is what is nonce in a CA? why we have it? and when and why it increase?
Keyhan Alizadeh's user avatar
0 votes
1 answer
23 views

I want to know a Contract address verified or not by programatically

I am having Token Names , Token Symbols and token addresses , I want to know that a Particular Contract address is verified or not by programmatically , but I don't want to use BSCSCAN API endpoint , ...
Bhushan Dhiware's user avatar
0 votes
0 answers
9 views

Is it possible to display opcode address in hex in remix debugger?

for any who is using the remix debugger, wonder how do you make the addresses appear in hex? Also are there any better debugger outta there for evm (local or online both works.) Thanks!
Justin Zhang's user avatar
1 vote
0 answers
38 views

"execution timeout" timeout when calling debug_trace transaction

I have one question. We have organized the ethereum en node as an archive. Since then, we have called large amounts of debug_traceTransaction to that node, but err="execution timeout" ...
user129590's user avatar
0 votes
1 answer
42 views

How do I manually find the storage slot for a string greater than 32 bytes?

This is my contract: SPDX-License-Identifier: MIT pragma solidity 0.8.22; contract StringStorage { string short_string = "ABCD"; string long_string = "...
davidastro's user avatar
0 votes
0 answers
50 views

Understand the Assembly Codes for Allowance Slot Calculation in Solady's ERC20.sol

I'm exploring the ERC20.sol contract in the solady library (https://github.com/vectorized/solady/blob/main/src/tokens/ERC20.sol) and trying to understand a specific assembly code block used for ...
PETER nguyễn's user avatar
0 votes
0 answers
13 views

Could someone please dumb down how the sign extend opcode works? [duplicate]

I was trying to understand how the sign extend opcode works via the playground of evm.codes, but I can't seem to wrap my head around it. Somebody please help me and explain how it works?
davidastro's user avatar
1 vote
1 answer
33 views

Clarification Needed on Storage Slot References in Inherited Smart Contracts

I'm currently reading https://blog.openzeppelin.com/upgradeability-using-unstructured-storage which has an example with an OwnedUpgradeabilityProxy smart contract which inherits from a base Proxy ...
PETER nguyễn's user avatar

1
2 3 4 5
21