Most Popular
1500 questions
320
votes
9 answers
`external` vs `public` best practices
Apart from the public modifier Ethereum introduces the external one. Both may be called outside of the contract and inside (the later one by this.f() pattern). Moreover, according to the docs:
External functions are sometimes more efficient when…
Jakub Wojciechowski
- 6,399
- 4
- 18
- 16
260
votes
9 answers
What is meant by the term "gas"?
An Ethereum application that I want to use talks about needing "gas" to run. What is gas, and where do I get it?
Jeff Coleman
- 22,059
- 17
- 77
- 91
233
votes
20 answers
How can I securely generate a random number in my smart contract?
If I am writing a smart contract for some kind of (gambling) game, how can I generate a random number securely? What are the best practises and security trade-offs to be aware of?
J-B
- 8,941
- 16
- 46
- 77
193
votes
2 answers
What is the difference between a transaction and a call?
What is the difference between a transaction and a call? In some interfaces, I can interact with contracts via calls or via transactions. What is the difference between the two, and can contracts also do transactions and calls?
mKoeppelmann
- 7,616
- 8
- 36
- 48
187
votes
13 answers
Upgradeable smart contracts
If the contract issuer wants to have a way to upgrade the contract code, so that account data and other things carry over, can Ethereum provide this? Also can this be done without changing the contract address or does one always need to deploy a new…
Mikko Ohtamaa
- 22,269
- 6
- 62
- 127
174
votes
4 answers
Are there well-solved and simple storage patterns for Solidity?
Simple and appropriate data organization can challenge Solidity newcomers. It wants us to organize everything in ways many of us aren’t accustomed to.
Are there well-solved general patterns for routine on-chain data organization?
Rob Hitchens
- 55,151
- 11
- 89
- 145
173
votes
10 answers
What is an ABI and why is it needed to interact with contracts?
ABI is referenced in many places including the official Ethereum website. What is an ABI and why is it necessary to use?
Taylor Gerring
- 9,580
- 4
- 34
- 39
172
votes
8 answers
What are the Ethereum disk space needs?
How fast is Ethereum blockchain growing and how big is it likely to get in the future? Is it still about 1 GB per month? Are there any data pruning or compression algorithms in place or planned to be used?
Domchi
- 1,821
- 2
- 11
- 5
161
votes
6 answers
How are ethereum addresses generated?
What criteria does a valid Ethereum address need to fulfill, is it just a random number in hexadecimal?
Or does it need to be derived in a specific way, according to some cryptographic algorithms?
What algorithms and standards are used to…
max
- 2,324
- 3
- 14
- 13
145
votes
2 answers
When should I use calldata and when should I use memory?
I have seen people use both memory and calldata keywords when writing Solidity. Specifically, they are used when declaring function parameters that take dynamic types like 'structs' or 'arrays'.
When should I use memory and when should I use…
Shane Fontaine
- 18,036
- 20
- 54
- 82
143
votes
3 answers
Comparison of the different TestNets
The Metamask wallet allows access to four test networks:
Ropsten
Kovan
Rinkeby
Goerli
I'm curious:
What are the similarities/differences between them?
Which use cases are best for each network
Are there more than these listed above?
Tom Hale
- 3,107
- 4
- 20
- 37
142
votes
1 answer
What is Swarm and what is it used for?
What is Swarm and what is it used for? And what is Swarm's relationship with Whisper?
eth
- 85,679
- 53
- 285
- 406
139
votes
5 answers
Why does Ethereum plan to move to Proof of Stake?
The initial version of Ethereum (Frontier) uses a Proof of Work based consensus algorithm, but I see that there are plans to implement a Proof of Stake based consensus algorithm called "Casper" in a future version of Ethereum. What is the…
Jeff Coleman
- 22,059
- 17
- 77
- 91
134
votes
7 answers
How is the address of an Ethereum contract computed?
How is the address of an Ethereum contract computed? What use cases are there for knowing a contract's address in advance?
eth
- 85,679
- 53
- 285
- 406
133
votes
9 answers
How can a contract run itself at a later time?
In my blockchain application, I would like to have an event triggered at a later time, hours or perhaps even days after the application has most recently received a transaction from a user. How can I create an "event" that will trigger after a…
Jeff Coleman
- 22,059
- 17
- 77
- 91