Most Popular

1500 questions
25
votes
2 answers

How to cast address to address payable in solidity 0.5.0

Got address from 3rd-party library: address wallet = rlp[5].toAddress(); And wanna transfer some funds to it: wallet.transfer(amount); Got error: TypeError: Member "transfer" not found or not visible after argument-dependent lookup in address. …
k06a
  • 3,016
  • 2
  • 21
  • 35
25
votes
2 answers

Relationship between Transaction Trie and Receipts Trie

Reading through the Yellow paper, I can see that each block header includes the Keccak 256 hash of the root of the trie for transactions and transaction receipts. I am struggling to understand how and where they are created. How are the …
Lee
  • 8,548
  • 6
  • 46
  • 80
25
votes
1 answer

Does it cost more gas to call another contract's functions in solidity?

I would like to break my code up into multiple contracts, but I'm afraid of this increasing the gas fees. Does an external function call cost more gas than an internal call to a function within the same contract? If so, is it a flat fee for each…
Jonah
  • 655
  • 1
  • 7
  • 17
25
votes
1 answer

Instrumenting EVM

I need to get all contract internal transactions. To do it, I'll need to instrument Ethereum EVM. My question is: what I should do to get the transaction details? Right now, I'm looking to the code but if someone can point me to the correct part of…
Paul Exchange
  • 2,723
  • 3
  • 21
  • 26
25
votes
1 answer

What is the max size of transactions can clients like geth keep in txpool?

What is the limit of transactions Ethereum clients can keep in transaction pool? Geth can keep 64 transactions per address according to this answer, but what is the max size of total transactions in txpool?
Satoshi Nakanishi
  • 5,749
  • 7
  • 38
  • 57
25
votes
2 answers

When will the difficulty bomb make mining impossible?

I know the answer must be out there in the code already, but I couldn't figure out where exactly. Could someone do the maths for me: With block 200k the difficulty bomb started increasing the difficulty, but when will the difficulty bomb make mining…
q9f
  • 32,913
  • 47
  • 156
  • 395
25
votes
5 answers

Pass a function as a parameter in Solidity

Can you pass a function as a parameter in Solidity? My guess: There is the concept of address in Solidity, but they represent contracts. Contracts can have fallback functions, but I don't think you can give them parameters. Thinking about passing…
Karl Floersch
  • 1,691
  • 3
  • 19
  • 24
25
votes
4 answers

Ethereum Address vs Public Key

I'm creating an ethereum wallet and I'm a bit confused with the concept of public key vs address. I understand that the Address is a hashed version of the public key, but when I'm generating a new wallet, I have 3 data fields: private key (used to…
sigmaxf
  • 1,080
  • 2
  • 13
  • 21
25
votes
1 answer

What is the "difficulty bomb" and what is the goal of it?

The difficulty bomb is related to the switch to proof of stake. How does it work exactly and why is it going to help to switch to proof of stake?
mKoeppelmann
  • 7,616
  • 8
  • 36
  • 48
25
votes
6 answers

Invalid JSON RPC response: undefined, when running web3.eth.accounts (Node)

I'm very new Ethereum and trying to follow this tutorial: https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2 But when I run: web3.eth.accounts I get an error: Error: Invalid JSON RPC response:…
tim_xyz
  • 397
  • 1
  • 3
  • 7
25
votes
1 answer

What if I had the private key that had the public address of a contract?

Could I spend the money a contract owns if I had the private key that goes to the public address that a contract resides at? (I realize that I'd have a better chance of being struck by lightning several times in a row for years.) But if you forced…
linagee
  • 6,138
  • 27
  • 32
25
votes
2 answers

Do I need a compiled contract just to get the ABI definition?

Why do I need a compiled version of the contract just to get the ABI definition? Seems like the contract address should be enough. Im very confused because I am simply trying to run a contract assuming it was made on another computer. It looks like…
ZMitton
  • 2,750
  • 4
  • 19
  • 34
25
votes
3 answers

What is the purpose of underscores in front of parameters?

I see contracts that use underscores in front of parameter names, like so: function Greeter(string _greeting) public { greeting = _greeting; } What's the purpose of these underscores? Do they have a similar meaning as 'internal use' names in…
Joël
  • 1,720
  • 2
  • 17
  • 35
25
votes
2 answers

How to convert WEI to ETH with ethers.js

How do you convert WEI to ETH? How do you convert WEI to ETH? How do you convert WEI to ETH? Had to repost because it wouldn't let me post once.
user
  • 451
  • 1
  • 6
  • 11
25
votes
1 answer

How can you check if a `string` is empty in Solidity

How can you check if a type string is empty in Solidity? For instance this would work when testing if a string was initialized to have no characters: string public emptyStringTest = ''; or when you would like to test if a mapping(bytes32 => string)…
Karl Floersch
  • 1,691
  • 3
  • 19
  • 24