Questions tagged [ethereum]

Ethereum is a blockchain currency (like Bitcoin) with a public ledger. Questions should relate to programming. General questions about Ethereum should be asked on https://ethereum.stackexchange.com

is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality. It provides a decentralized Turing-complete virtual machine, the Ethereum Virtual Machine (EVM), which can execute scripts using an international network of public nodes. Ethereum also provides a cryptocurrency token called , which can be transferred between accounts and used to compensate participant nodes for computations performed. Gas, an internal transaction pricing mechanism, is used to mitigate spam and allocate resources on the network.

was proposed in late 2013 by Vitalik Buterin, a cryptocurrency researcher and programmer.

The official website of is Ethereum.org

6757 questions
15
votes
10 answers

Error HH12: Trying to use a non-local installation of Hardhat, which is not supported. Please install Hardhat locally using npm or Yarn, and try again

I've been working on a Hardhat project for sometime. After a while, when I run npx hardhat node to start the HH server, I get the error below: I tried researching the error and found this on the hardhat site HH12: Hardhat is not installed or…
KelvinIOT
  • 325
  • 1
  • 2
  • 14
15
votes
5 answers

Failing to compile multiple Solidity versions

I'm trying to compile (through Hardhat) a contract that imports several interfaces with different Solidity versions but I'm getting the following error: Error HH606: The project cannot be compiled, see reasons below. These files and its…
dNyrM
  • 545
  • 1
  • 4
  • 17
15
votes
2 answers

how to swap tokens on uniswap using web3 js

I am trying to use uniswap contract method to simply swap eth for token, using eth from metamask wallet. Uniswap contract method is: function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external …
user3338991
  • 431
  • 2
  • 5
  • 9
15
votes
1 answer

How do you compare strings in Solidity?

I would assume comparing strings would be as easy as doing: function withStrs(string memory a, string memory b) internal { if (a == b) { // do something } } But doing so gives me an error Operator == not compatible with types string memory…
Evan Conrad
  • 3,993
  • 4
  • 28
  • 46
15
votes
4 answers

Unable to resolve module crypto in reactnative

I have posted this here have created react-native app using react-native init myapp added web3 in package.json npm install react-native run-ios but i am getting the error unable to resolve module crypto from web3-eth-accounts. Is there any way to…
Trinu
  • 1,721
  • 3
  • 21
  • 41
15
votes
3 answers

Ethereum Solidity - Does require() use any gas?

Google has failed to give me an concrete answer, does using the require() function in Solidity use up any gas? Even if the statement in the function is evaluated as true?
mrsulaj
  • 398
  • 3
  • 12
15
votes
1 answer

How does Parity's Aura consensus protocol work?

Here it's a very high level description with only formulas. I want to understand actually how it works. I don't actually understand what a step is and what's it's use? Does a node always keep updating the step? And when time to create to create and…
Narayan Prusty
  • 2,501
  • 3
  • 22
  • 41
14
votes
6 answers

How to check if Metamask is connected after page refreshing

My dApp have to connect to MetaMask. There are two rude solutions in the docs: make user to click connect btn every time manually or just pop up connection confirmation after page load. I want to implement the only convenient solution: first time…
14
votes
3 answers

Is there any way to initiate a disconnect request to the Metamask wallet?

I'm building a decentralized application where users can connect their cryptocurrency wallet (Metamask) to my website. They can initiate a connection request by clicking a button. On success, the wallet is connected and my website can interact with…
vladwho
  • 141
  • 1
  • 4
14
votes
4 answers

Get token transfer detail from transaction hash with web3js

With web3js, how do you figure out that there was 40000 tokens transfer from the transaction's hash?
Chris Peng
  • 896
  • 1
  • 10
  • 23
14
votes
2 answers

Rinkeby: "replacement transaction underpriced"

I've been running a local Rinkeby node (in order to use websocket events) which was working fine for a while, but suddenly I have been getting "Returned error: replacement transaction underpriced". I am sending 10x the average gas price and I'm…
M1Reeder
  • 692
  • 2
  • 7
  • 22
14
votes
2 answers

How do I create an ethereum wallet in Python?

I am building an application that would create a wallet for a user. One option is the web3.personal API in web3.py, which has a newAccount('passphrase') method. The method only returns the address of created account. What I'm looking for is a…
Saujanya Acharya
  • 143
  • 1
  • 1
  • 6
14
votes
5 answers

Insufficient funds for gas*price+value error

While deploying contract on blockchain, on adding transaction it gives error insufficient funds for gas *price +value What is that mean?
jatin agarwal
  • 153
  • 1
  • 1
  • 5
13
votes
7 answers

The transaction declared chain ID 5777, but the connected node is on 1337

I am trying to deploy my SimpleStorage.sol contract to a ganache local chain by making a transaction using python. It seems to have trouble connecting to the chain. from solcx import compile_standard from web3 import Web3 import json import os from…
E_charles
  • 133
  • 1
  • 4
13
votes
1 answer

ValueError: Method eth_maxPriorityFeePerGas not supported, web3.py with ganache

I'm running the following code with web3.py: transaction = SimpleStorage.constructor().buildTransaction( {"chainId": chain_id, "from": my_address, "nonce": nonce} ) And I am running into the following error: Traceback (most recent call last): …
Patrick Collins
  • 5,621
  • 3
  • 26
  • 64