Most Popular

1500 questions
11
votes
9 answers

Invalid value undefined for HardhatConfig.networks.mainnet_fork.url - Expected a value of type string

I have an ALCHEMY_MAINNET_RPC_URL environment that is of type string. I can verify it as such with: const ALCHEMY_MAINNET_RPC_URL = process.env.ALCHEMY_MAINNET_RPC_URL || '' console.log(typeof (ALCHEMY_MAINNET_RPC_URL)) And I get the output…
Patrick Collins
  • 11,186
  • 5
  • 44
  • 97
11
votes
2 answers

How to connect etherwallet to my private blockchain?

I am unable to make etherwallet v3.4.2 to connect to my private blockchain. The way I run my private network: (please note that it works perfectly fine) geth --port 3000 --networkid 23422 --identity node1 --verbosity 3 --nodiscover \ --nat none…
alper
  • 8,395
  • 11
  • 63
  • 152
11
votes
3 answers

Hardhat Test returns transaction instead of return value

I just came from truffle to hardhat. Like the title says, I have a return value (address) of a contract and getting the transaction back. Any idea what I can do about that? it("Check all tested", async function ()…
MaTok
  • 321
  • 3
  • 11
11
votes
1 answer

Unlock account permanently

I have created a dapp where the user can sign a contract using metamask. However, the account that gets the money send to keeps getting locked. Sure, I can manually unlock it, but this is really annoying. Is there any way to automate this, that it…
Arko Elsenaar
  • 431
  • 4
  • 10
11
votes
2 answers

How do I set a gasPrice with ethers deploy script?

I'd like to set a gasPrice in my deploy script, so I could deploy and let miners pick up my transaction when gas is low. Like deploy my contract over night while I'm sleeping to save money. How can I specify the gas price in my ethers deploy…
caker
  • 185
  • 1
  • 2
  • 7
11
votes
2 answers

How to run a "server" for light clients?

When running geth --light the go-ethereum client somehow has to connect to full nodes to interact with. Could geth connect to any full node on the network or does this require a special endpoint? How to run a "server" for light clients? And how do…
q9f
  • 32,913
  • 47
  • 156
  • 395
11
votes
3 answers

Questions about SimpleAuction contract example

Here is the official sample of solidity: if (highestBidder != 0) { // Sending back the money by simply using // highestBidder.send(highestBid) is a security risk // because it can be prevented by the caller by e.g. // raising the…
user2781581
  • 501
  • 3
  • 12
11
votes
4 answers

Received invalid block tag 87. Latest block number is 0

I ran a hardhat node just fine using npx hardhat node, but after I shut it down and restarted it, whenever I try to deploy something on the chain, I get the following error: eth_getTransactionCount Received invalid block tag 87. Latest block…
zendevil.eth
  • 303
  • 1
  • 3
  • 10
11
votes
3 answers

Could mapping data structure return the number of items it points?

For example following code piece from https://ethereum.stackexchange.com/a/10763/4575 . I have added new lines that is followed by //*. pragma solidity ^0.4.2; contract test { struct my_struct { int a; int my_length; //*to keep track…
alper
  • 8,395
  • 11
  • 63
  • 152
11
votes
1 answer

How to connect an Android App user to ethereum network?

I'm working on developing a decentralized application which requires every user of the Android app to have separate account containing his ether balance information and other user-specific information. I read about the concept of light-clients and…
Satwik
  • 213
  • 1
  • 6
11
votes
2 answers

How much gas does it cost to emit an event?

How much gas does it cost to emit an event? Is there a formula for calculating how much gas the emission of an event will cost given that its parameters sum up to n bytes of data? Any info or estimates are useful, Thanks :)
yoyobigmanyo
  • 233
  • 2
  • 6
11
votes
1 answer

Error when using string type as a mapping key

The following code doesn't compile, because compiler needs a mapping key to be of fixed-size type in order to create accessor for a public mapping. I'm using here string type. My strings are 24 byte hex strings. My question: How would you cast…
manidos
  • 4,298
  • 3
  • 31
  • 55
11
votes
2 answers

Fatal: Error starting protocol stack: ... Access is denied

What should you do if you get an error similar to the below when starting geth? Fatal: Error starting protocol stack: Access is denied.
Lee
  • 8,548
  • 6
  • 46
  • 80
11
votes
1 answer

Testing Error thrown with hardhat

How would you test the following function with solidity v0.7 and hardhat v2.3.3? function myFunction(int8 _num) public { require(_num > 5, "Num should be bigger than 5"); ... } I've tried: try { await…
ntonnelier
  • 257
  • 1
  • 4
  • 7
11
votes
2 answers

How dependent is the ethereum client on the router and DNS being trusted?

Another way to put it: what is the root of trust for a full client on a network that has a potentially untrusted (or "owned") router+DNS? As I was going through the ethereum wiki semi-randomly, I came across this, it says: "[...] it allows a node…
sitaram
  • 213
  • 1
  • 4