Most Popular
1500 questions
10
votes
4 answers
Composition Over Inheritance - Gas Efficiency
In OOP languages, composition over inheritance is a well-known best practice. Solidity is an OOP language too but there is also the gas efficiency issue.
Question is, in Solidity, how do composition and inheritance compare to each other considering…
ferit
- 507
- 5
- 25
10
votes
2 answers
memory keyword in function argument
What does the memory keyword in the argument of a function do?
pragma solidity 0.4.24;
pragma experimental "ABIEncoderV2";
contract Conditional {
struct Condition {
address to;
bytes4 selector;
bytes parameters;
bytes32…
pd176
- 439
- 4
- 14
10
votes
8 answers
Error: Number can only safely store up to 53 bits
const result = await myContract.methods.myMethod(1).call();
brings the error from above. There is a simmilar questions here but since I use call gas shouldn't matter. I'm using "web3": "1.0.0-beta.35", (Beta.36 doesn't work for me at all.)
MarcS82
- 323
- 1
- 3
- 13
10
votes
2 answers
What is the measured distribution of block times since Homestead?
The variance of block times should arguably follow a Poisson distribution. But by casual observation I've seen blocks fast as 4 s or 1 m 15 s. The average is around 14 s since Homestead.
If it follows a Poisson distribution it would have not that…
Roland Kofler
- 11,638
- 3
- 44
- 83
10
votes
2 answers
How can I connect to geth by IPC on nodejs?
This this the command line i have used to get geth running.
geth ipc --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --ipcpath "/root/.ethereum_experiment/geth.ipc"
so from node js how to connect to this geth client,
before this i…
Subhod I
- 927
- 1
- 9
- 18
10
votes
2 answers
Why Merkle-Patricia Trie has three types of nodes?
I've been reading about Merkel Patricia Trie and I think that I understand how it works, but it looks a bit overcomplicated to me, which suggests that I do not understand it fully.
Here is how Merkle Patricia Trie looks like:
Merkel Patricia Trie…
Ivan
- 277
- 2
- 10
10
votes
1 answer
Quorum: Extending list of participants that can access private transactions post transaction creation?
According to the Quorum roadmap (which is over a year old now) the team at JPM was planning to add a feature whereby additional parties could be given rights to view private transactions after those transactions had been created and sent through the…
Max
- 636
- 4
- 15
10
votes
4 answers
The best Web3 providers online
Does anyone know what are the most popular web3 providers online? (Or is Infura the only one?)
Jonas
- 103
- 1
- 1
- 4
10
votes
1 answer
Why are the last 20 bytes of the public key used as the address?
According to this post regarding how to derive the Ethereum address from a public key:
Take the last 40 characters / 20 bytes of this public key
(Keccak-256). Or, in other words, drop the first 24 characters / 12
bytes. These 40 characters / 20…
thanos
- 844
- 1
- 8
- 20
10
votes
1 answer
Security measures to overcome 51% attack
I was reading During a 51% attack, What Can the Attacker Actually Accomplish?
from there, i understand the after-effects are something serious, so what are the security measures which ethereum have and what if all they fail?
niksmac
- 9,673
- 2
- 40
- 72
10
votes
3 answers
TypeError: Web3 is not a constructor when trying to use node.js with truffle-contract
I'm trying to use node.js with my smart contract for my app. As I've tried to convert from using the default app.js set-up to index.js set-up I've ran into this weird issue I can't fix.
It throws the error when trying to instantiate my .json file…
savard
- 448
- 1
- 4
- 16
10
votes
4 answers
How will dApps built on ETH deal with the requirements of GDPR?
GDPR expects it's citizens to have the 'right to be forgotten'. A company failing to fulfill this obligation is expected to pay a hefty fine. How will decentralized autonomous communities who store immutable data on the blockchain about its users…
Able Joseph
- 203
- 1
- 4
10
votes
3 answers
Best Resource for Intense Solidity Coding (In May 2018)
Learning Solidity seems like it's constantly in flux. Some code I had written previously is no longer cool (example: declaring the contract name in the function is no longer bueno!)
As of right now, where would a Pretty Good Code Writer (get it?) go…
pgSystemTester
- 219
- 2
- 8
10
votes
2 answers
how to interpret event data ethereum
I was able to use the EtherScan api to get an array with event logs. Now I need to read from the data stored inside.
The event data exists out of: uint256, uint256, uint256, address, address, string.
I can do the following web3 function:…
mesqueeb
- 555
- 8
- 21
10
votes
4 answers
How to use web3.js@1.0.0-beta34 with TypeScript?
Here is a minimal code for testing:
import * as Web3 from "web3"
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"))
const main = async () => {
const blockNumber = await web3.eth.getBlockNumber()
console.log({…
user33994