Questions tagged [ether]

Ether is the currency used in Ethereum blockchain technology. Refer: https://ethereum.org/ether Questions about Ether which aren't about programming should be asked on the dedicated Ethereum site: https://ethereum.stackexchange.com. Questions which are about programming can be asked on either site.

Ether is a necessary element — a fuel — for operating the distributed application platform . It is a form of payment made by the clients of the platform to the machines executing the requested operations. To put it another way, Ether is the incentive ensuring that developers write quality applications (wasteful code costs more), and that the network remains healthy (people are compensated for their contributed resources).

The official website of is Ethereum.org.

There's also a Ethereum StackExchange site that's dedicated to Bitcoin.

162 questions
67
votes
3 answers

What is address(0) in Solidity

Can anyone explain to me what address(0) is in Solidity? I found the following in the docs but it doesn't really make sense to me: If the target account is the zero-account (the account with the address 0), the transaction creates a new contract.…
pizzarob
  • 11,711
  • 6
  • 48
  • 69
25
votes
4 answers

Set gas limit on contract method in ethers.js

Problem I am trying to use a method of a contract on the test network (ropsten), but it fails due to this error: reason: 'cannot estimate gas; transaction may fail or may require manual gas limit', code: 'UNPREDICTABLE_GAS_LIMIT' Code I created an…
Gh05d
  • 7,923
  • 7
  • 33
  • 64
11
votes
4 answers

How do I add ether to my localhost Metamask wallet with Hardhat?

I've connected metamask to a node created with hardhat. I can connect to this node on http://localhost:8545 network in metamask after setting the chain id to match the hardhat network chain id (31337) How can I send ether to the accounts/addresses…
goonerify
  • 1,668
  • 25
  • 27
9
votes
4 answers

How can we generate multiple random number in ethereum?

I want my smart contract to return 7 or 8 UNIQUE random numbers ranging from 1 to 100 upon calling the contract. What can be the best approach to obtain such result?
Joe Mutti
  • 137
  • 1
  • 8
7
votes
3 answers

Error: sending a transaction requires a signer while calling aggregate function of Multicall Contract Ethereum

index.js:1 Failed to fetch multicall chunk [{…}] 1 Error: sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.0.2) Multicall contract address -…
Shanu Goyanka
  • 71
  • 1
  • 1
  • 2
6
votes
1 answer

bigNumber not parsing ether properly

I have the following: import { BigNumber } from "@ethersproject/bignumber"; import { parseUnits } from "@ethersproject/units"; const decimals = 18; export const add = (a: string, b: string): string => { const _a = parseUnits(a, decimals); …
benhowdle89
  • 36,900
  • 69
  • 202
  • 331
6
votes
3 answers

Solidity function implementing `public onlyOwner` cannot be called even by the owner

I am following along the documentation here: https://docs.alchemyapi.io/alchemy/tutorials/how-to-create-an-nft/how-to-mint-a-nft. And have a smart contract of form: pragma solidity ^0.8.0; import…
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
6
votes
2 answers

Ethereum Nonce Management. error nonce too low

I use web3 and provider mainnet. I do 2 transactions by contract. first is approve method and another transaction is multitransfer. I store second signature in database. if first transaction is success I send second transaction/. second transaction…
6
votes
1 answer

Why we can't send ether to ethereum address 0x1 via smart contracts

With this below solidity code I have tried to send ether to ethereum wallet address 0x1 via smart contract and it becomes failed. But, when I try to send ether to address 0x1 directly from my wallet it becomes success. pragma solidity…
Temüjin
  • 15,371
  • 8
  • 35
  • 57
5
votes
1 answer

How to set msg.value in Remix IDE

This is probably an easy error I'm missing, but I cannot for the life of me figure out how to set the msg.value variable in this contract. I've read online that this value is the amount of wei associated with the transaction, but how do I, as a…
hcwil
  • 59
  • 1
  • 5
5
votes
0 answers

"Error: Failed to check for transaction receipt:" Web3.js[1.0.0] with Node , getting this error with sendSignedTransaction

Here's the code I'm trying to run: w3.eth.sendSignedTransaction( data ).once( 'transactionHash', (hash) => { console.log('hash') }).once('receipt', (receipt) => { console.log('receipt'); }).on('confirmation', (confirmationNumber,…
1110
  • 95
  • 2
  • 6
5
votes
1 answer

accepting ether in smart contract

I'm trying to create a simple smart contract to learn solidity and how ethereum works. From what I understand, using the modify payable on a method will make it accept a value. We then deduct from the sender and add that somewhere else, in this code…
totalnoob
  • 2,521
  • 8
  • 35
  • 69
4
votes
1 answer

Uniswap getAmountsOut() rounds value down to nearest Ether

I'm calling getAmountsOut() from the UniswapV2Router02 contract using ethers.js, where I'm checking the amount of ETH I can get for 50000 DAI. Using the below code, the output amount tells me I can currently get exactly 15 ETH. For testing purposes…
Jasperan
  • 2,154
  • 1
  • 16
  • 40
4
votes
1 answer

Fetch proper execution price from Uniswap V2

I'm trying to undertand Uniswap v2 SDK. I've written simple function, to fetch result of trading: 1 WETH for Dai 1 DAI for WETH My question is, why the first trade result is really accurate with what Uniswap Interface is returning, but the second…
Karzel
  • 928
  • 9
  • 24
4
votes
3 answers

Soldity: Iterate through address mapping

I am looking for a way to iterate through a mapping in Solidity. For example I have this mapping: mapping (address => uint) private shares; And I want to iterate in a function through all addresses and send them ether according to their…
chelo_c
  • 1,739
  • 3
  • 21
  • 34
1
2 3
10 11