Questions tagged [evm]

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

173 questions
1
vote
1 answer

How does Hyperledger fabric EVM generate the address from the public key?

In Ethereum, the wallet address is the last 20 bytes of the keccak256 hash of the public key of the wallet. I am working with Hyperledger Fabric EVM, and I would like to know which is the mechanism that is used to generate the address from the…
1
vote
1 answer

What are the trade-off of using near-evm solidity contract compared to near native rust/assemblyscript?

What are the trade-off of using near-evm solidity contract compared to near native rust/assemblyscript? xpost from https://discord.com/channels/490367152054992913/490367152054992917/749591544478171198
1
vote
1 answer

Where do the actual bytecodes of an Ethereum contract reside?

As far as I know, when a contract is created, the deploy-code inside the init field gets executed once and discarded after the actual bytecodes is returned, in the meantime, the codeHash field inside the account state is updated accordingly, but…
Zekie
  • 13
  • 3
1
vote
1 answer

In solidity, do function signatures take data location into account?

ex: if my function in solidity is: function someFunction(uint256 a, bytes calldata _data) external { //some stuff } would the function signature be the first four bytes of the hash of: someFunction(uint256,bytes) or would it be the first four…
a94
  • 564
  • 1
  • 7
  • 16
1
vote
1 answer

dynamically create a variable in solidity

I'd like to include an internal method in my contract that allows the creation of a new uint256 in storage named by a parameter. Something like: function createUint (string memory _name) internal { /* * creates a new uint256 named _name in…
a94
  • 564
  • 1
  • 7
  • 16
1
vote
0 answers

Is there a way to extend the Solidity compiler to generate byte code for a new instruction?

If you wanted to extend Solidity to generate code for a new instruction, how would you go about this? Is there some work done with something like LLVM?
pie man
  • 11
  • 1
1
vote
2 answers

What happens when the sender run out of gas in the middle of a function execution?

Suppose we have a contract with the following defined function: function send(address receiver, uint amount) public { if (balances[msg.sender] < amount) return; balances[msg.sender] -= amount; balances[receiver] +=…
Federico Caccia
  • 1,817
  • 1
  • 13
  • 33
1
vote
0 answers

Solidity: Why is this simple storage contract not working?

I'm practicing by creating a simple storage contract, but I can't store or retrieve values from the array "numbers." The uint "structID" does not increment and function "testRetrieve" only returns 0 for the correct indexes. The fact that…
Coalited
  • 99
  • 3
1
vote
2 answers

How does the opcode JUMP work in the EVM Stack?

I'm following along on the "Advanced Solidity" tutorial here. I ran into an example I'm having trouble understanding. In this example, why does JUMP affect the state of the stack? I expected it to only affect the program counter. (i.e. I would…
Sze-Hung Daniel Tsui
  • 2,282
  • 13
  • 20
0
votes
0 answers

What is difference in UniswapV2 router address and pair address? and when they occur?

I am currently working on a pre-built ERC20 contract code that uses two different addresses from UniswapV2 to do validations in its logic. uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair =…
0
votes
0 answers

how to calculate maxtx on contract tokens?

I want to ask, is it possible to calculate max tx + max wallet by transferring tokens? I have tried transferring tokens by manipulating slots, but there is a problem with the TO & FROM address so it does not pass the max tx/max wallet filter see…
daviens
  • 1
  • 1
0
votes
1 answer

Why my contract address after deplyment doesn't appear even though I have a Public State Variable (address public owner)?

The function setActivity always revert due to the address ? How can I get the contract address because it sounds that the address is always all zeros when I get the value fron the (address sate variable) ? Here is the Smart Contract : //…
0
votes
0 answers

A simple vault saving IERC20, but fails a simple foundry test

I wrote a simple vault for a particular IERC20 contract. // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; import "forge-std/interfaces/IERC20.sol"; contract BasicVault { mapping (address => uint) user_to_balance_; IERC20…
zuanyg
  • 71
  • 1
  • 1
  • 5
0
votes
4 answers

Is there any way to get receipt or logs of pending transaction?

Let's say we can listen for pending transaction using code below. We can simulate transactions using provider.call() function. And we can get result from simulated transaction as a string. There should be a way to get logs of simulated transaction.…
graygt
  • 47
  • 3
0
votes
0 answers

Error while deploying a contract on sepolia testnet with Brownie

I'm currently trying to deploy a contract on sepolia testnets using Brownie and my Infura API, by running the following line of code: brownie run scripts/my_contract.py --network sepolia However, what I get is: Running…
Beppe
  • 1
  • 1