Most Popular
1500 questions
16
votes
1 answer
Nested structs in solidity?
Is it possible to have a struct inside a struct?
I am not sure about the data type internals, but I was basically trying to do something like (pseudo-code):
library IpfsUtils {
struct IpfsHash {
bytes32 hash;
uint8 hashFunction;
…
bumi
- 348
- 1
- 2
- 9
16
votes
1 answer
What is the exploit behind Parity's multisig wallet from 2017-07-19
Right now (2017-07-19, 10pm CEST), there is an alert from Parity that there is an ongoing exploit on their multisig wallet.
What is the cause and mechanism of this exploit?
SCBuergel
- 8,774
- 7
- 38
- 69
16
votes
1 answer
Does ecRecover in solidity expects the "\x19Ethereum Signed Message:\n"-prefix
I struggle heavy to actually recover the ethereum address from a hash and the {r, s, v} from a signature with the ecRecover-method in solidity.
What i want is to sign another ethereum-address. So i hash that address with sha3 and hex-encoding in…
user2762996
- 293
- 2
- 6
16
votes
2 answers
How to reduce chaindata database size?
Currently chaindata size is more then 10.02 GB.
Is there any solution to reduce the size of stored data?
Is there a way to store particular database and keep entirely the functionality of client (e.g. eth/geth) in this case?
Alex Koz.
- 621
- 7
- 12
16
votes
2 answers
In the truffle console, how to set and get current account?
I'm using the $ truffle console.
I can see my available accounts using truffle(development)> web3.eth.accounts.
But when I run some smart contract code, which account is running the contract?
And, how can I change the account which is running the…
kris
- 380
- 1
- 4
- 12
16
votes
1 answer
Why was RLP chosen as the low level protocol encoding algorithm?
Is this an ad-hoc decision? Why RLP? Is it specifically suited to something?
Sentinel
- 1,238
- 9
- 19
16
votes
6 answers
How can dapps work on smartphones?
How can dapps on mobile web browsers interact with web3.js?
Is there any tool like Metamask or Mist on the roadmap for mobile?
Diego Cerdan Puyol
- 263
- 1
- 2
- 5
16
votes
1 answer
How should I handle blockchain forks in my DApp?
In the user interface of my DApp, how can I detect that a blockchain reorganization happened and what should I do to update the UI state once the fork is resolved?
J-B
- 8,941
- 16
- 46
- 77
16
votes
6 answers
Better pattern to detect web3 default account when using metamask
Context: I want to use blockies to render an identicon on the page, i get the defaultAccount from web3, for this, the user has to be logged on to metamask with a selected address from his wallet.
The problem: the web app seems to not detect the web3…
Jorge Alvarado
- 283
- 1
- 2
- 7
16
votes
4 answers
are there "public" ethereum nodes? or any recommendations on hosting solutions?
I've always ran apps on Heroku. Just developed a smart contract and I need to check the blockchain from the app. Are there public nodes I can connect to to get the info I need to show on my app?
If not, have you set up an ethereum node on a hosting…
Anto
- 311
- 1
- 3
- 9
16
votes
3 answers
Is there a max amount of gas per transaction?
If there's an ICO with a cap of $1 million usd and there's $10 million Ether being sent all at the same time, I'm assuming the transaction with the highest gas gets prioritized...but is there a limit to how much gas you can put? For example will…
ello
- 161
- 1
- 1
- 4
16
votes
3 answers
Truffle console - How can I get and print the value returned by a contract function?
This is an absolute newbie question. Given this simple Hello World contract:
pragma solidity ^0.4.4;
contract Greeter {
function Greeter() {}
function sayHello() returns(string) {
return "hello";
}
}
I deploy it and try to…
codependent
- 415
- 1
- 6
- 11
16
votes
6 answers
Sorting an Array of integer with Ethereum
I'm trying to have a simple array of integer sorted in Solidity but i couldn't find any real ressources so instead i'm trying to do it "the hard way" but so far with very little success.
Is anyone aware of anything that could help ?
This is what…
user697
- 2,176
- 3
- 15
- 19
16
votes
3 answers
How to set up a Private network and connect peers in geth?
I am trying to setup a private network and trying to connect peers. Currently I'm trying it on my laptop and desktop (both of them are connected to different internet).
I run the below command in first terminal(in both systems (data dir is different…
Diwaker Singh
- 161
- 1
- 1
- 4
16
votes
1 answer
Why does ++i cost less gas than i++?
Why in solidity, i++ & ++i works the same but one costs a little bit more gas?
Take a look at this contract:
contract foobar {
uint[] public arr = [1,2,3,4,5];
function find() public view returns(bool) {
for(uint i = 0; i <…
DevABDee
- 441
- 2
- 11