Most Popular

1500 questions
19
votes
4 answers

Setup Ganache with Metamask. What and where is a Chain ID?

I am following these instructions. The problem is that the above instructions don't mention Chain ID and it appears Chain ID is required to even make it work. Thus, I'm stuck. What is the Chain ID? How do I get it to set it?
GN.
  • 643
  • 2
  • 8
  • 20
19
votes
1 answer

What does the function "abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)" do exactly?

I tried to edit this function according to my smart contract but I couldn't understand this function. I read the docs already. can someone explain this to me with more details and examples? Thank you.
Erzo
  • 353
  • 1
  • 3
  • 7
19
votes
3 answers

Is it possible to overflow uints?

The Ethereum token tutorial has a check for a uint256 overflow. function transfer(address _to, uint256 _value) { /* Check if sender has balance and for overflows */ if (balanceOf[msg.sender] < _value || balanceOf[_to] + _value <…
Noah Thorp
  • 783
  • 1
  • 7
  • 11
19
votes
2 answers

Whats the difference between .call.value() and .call.value()()

contract Test { function Test(){ msg.sender.call.value(0); msg.sender.call.value(0)(); } } Whats the difference here between the first and second call? My hunch is the 1st one doesn't actually do anything, however this…
Akhil F
  • 1,928
  • 3
  • 19
  • 29
19
votes
2 answers

In a private blockchain, why do miners keep adding empty blocks to the blockchain?

I have been working on a private blockchain and observed that a miner, when started, keeps on adding empty blocks with no transactions to the blockchain. Why is this happening? It doesn't make any sense to add empty blocks. This just results in the…
galahad
  • 3,920
  • 3
  • 26
  • 66
19
votes
4 answers

How can I find my `chaindata` folder?

Someone referred me to the chaindata folder to troubleshoot a problem I am having with Ethereum-Wallet/Mist. How can I find it?
Micah Zoltu
  • 945
  • 2
  • 8
  • 21
19
votes
1 answer

What are the attributes of the `msg` object and how can I list them?

I know msg.sender exists, it gives the address of the sender. What other attributes are there and how can I list them / where are they defined?
TMOTTM
  • 1,953
  • 2
  • 14
  • 23
19
votes
3 answers

send VS call - differences and when to use and when not to use

Can somebody please explain the differences between using a send and call for contracts and when to use and not use these different methods? For example : msg.sender.send(number); msg.sender.call.value(number)(); I know that send uses 2300…
Alex Darby
  • 921
  • 1
  • 6
  • 16
19
votes
1 answer

How do I get the storage indices/keys?

I would like to explore the storage data of a contract. I have geth fully synched and I interact with it over RPC. There is the function "eth.getStorageAt(addr, index, block)" provided, but you need to pass an index to it. Unfortunately this index…
ethinterest
  • 191
  • 1
  • 3
19
votes
1 answer

How much computation can be done in a fallback function?

Simply sending Ether to a contract, will run the contract's code. In Solidity, this code maps to what it calls the fallback function. How much work can be done in a fallback function?
eth
  • 85,679
  • 53
  • 285
  • 406
19
votes
1 answer

Can Proof of Stake (PoS) improve the number of Transactions per Second?

Currently Ethereum is using Proof of Work (PoW). From my understanding there is a limit of time between blocks for two reasons: Part of that time between blocks represents the time to solve the PoW puzzle. It is kept at a certain value in order to…
dragosb
  • 2,370
  • 13
  • 23
19
votes
3 answers

Retrieve CHAIN_ID of the executing chain from a Solidity contract

Is there a way to directly be able to retrieve CHAIN_ID information about the executing chain from a smart contract? I know that for any chain that has EIP-155 implemented, CHAIN_IDs are retrievable from the v component of a signature but would…
Shiri
  • 786
  • 1
  • 8
  • 19
19
votes
2 answers

What are the practical uses of Allowance in ERC20 tokens?

I'm studying ERC20 specification and all seems to make sense. Well, all but allowance. I couldn't grasp to the concept and it's usefulness. What should I use it for? (Should I at all?) What are the drawbacks of setting an allowance for too high or…
sigmaxf
  • 1,080
  • 2
  • 13
  • 21
19
votes
2 answers

What prevents the market from assigning value to testnet ETH?

If enough people mine testnet ETH for testing purposes, difficulty will rise along with the cost of generating testnet coins. In some a circumstance why would the value of testnet coins not rise based on supply/demand?
cowboy4life
  • 293
  • 2
  • 6
19
votes
2 answers

Where does the number 21000 come from for the base gas consumption in Ethereum?

Can you break it down in terms of the cost of opcodes?
Hanhan Li
  • 291
  • 2
  • 4