Most Popular

1500 questions
12
votes
7 answers

How to add peers on a private network?

I have created a private blockchain on two different machines. Now I want these nodes to connect with each other as "peers". I am using geth console. I have tried the following command: >…
Sukhmaninder
  • 491
  • 2
  • 6
  • 14
12
votes
4 answers

How to get events emitted by a transaction with web3.js

I'm writing a user interface in Javascript and I'm using the web3.js library. I have the transaction hash of a confirmed transaction. I would like to get an array of all events emitted by that transaction. I don't necessarily need all events, just…
Jesbus
  • 10,478
  • 6
  • 35
  • 62
12
votes
1 answer

TypeError: Invalid type for argument in function call. Invalid implicit conversion from contract to address requested

I am unable to use the 'this' Keyword in below code. function buyTokens(uint256 _numberOfTokens) public payable { require(msg.value == multiply(_numberOfTokens, tokenPrice)); require(tokenContract.balanceOf(this) >=…
Abhijeet Samanta
  • 399
  • 5
  • 15
12
votes
9 answers

Solc --version: command not found

I'm trying to use solc with no success. I download solc with npm install solc but when I run solc --version the console output is: command not found. If I list packages npm list I'm able to see solc@0.3.5. What's wrong?
underdog
  • 1,190
  • 2
  • 12
  • 24
12
votes
2 answers

Is it possible to attack "the DAO" attackers new splitted DAO?

Since the splitted DAO (dark DAO) has the exact same vulnerability in its code, is it possible to execute the same attack to the attackers DAO?
Kobayashi
  • 1,255
  • 1
  • 9
  • 14
12
votes
1 answer

How does the stack depth attack make a send() silently fail?

From a blogpost on security from Christian Reitwiessner: Because of the maximal stack depth of 1024 the new bidder can always increase the stack size to 1023 and then call bid() which will cause the send(highestBid) call to silently fail. So it…
mKoeppelmann
  • 7,616
  • 8
  • 36
  • 48
12
votes
1 answer

How to loop through a array of addresses?

I have a mapping and an array that contains a list of addresses of students. When I loop over that array, the method .length is not working. How can I loop through the array Student_list shown below? mapping(address => Student) Students; address []…
Mohamed
  • 491
  • 1
  • 4
  • 15
12
votes
4 answers

Running a geth light client, how do I resolve the error: "No trusted canonical hash trie"?

I've been running a geth light client to deploy smart contracts through Truffle Migrations to mainnet. I'm getting: "Error: No trusted canonical hash trie". Any help in what this entails and how to resolve it?
Simon de la Rouviere
  • 1,224
  • 10
  • 18
12
votes
2 answers

How many arguments can Solidity take?

I'd like to set lots of arguments in solidity functions. I wonder how many arguments contracts can handle. Does it depend on number of arguments or data size?
Satoshi Nakanishi
  • 5,749
  • 7
  • 38
  • 57
12
votes
2 answers

Why am I getting less than 5 Ether per block?

Was something changed recently? I've been getting less and less ether per block - is this tied to difficulty level? I thought difficulty would affect the rate of mining a block, not the number of ether per block. My last block got me 3.75 Ether.
q9f
  • 32,913
  • 47
  • 156
  • 395
12
votes
4 answers

Can anyone explain what is the main purpose of events in solidity and when to use it?

pragma solidity ^0.4.24; contract assignment2{ event ageread(address,int); function getage(address peridentifier) public returns(uint){ human = mystruct("adam",10); //using struct mystruct ageread(peridentifier,stateintvariable);…
Faheel Sattar
  • 181
  • 2
  • 6
12
votes
2 answers

What are zkSNARKs? How do they work?

From my brief exposure to the concept, zkSNARKs seems to be a form of zero-knowledge cryptography. What can zkSNARKs bring to the table for Ethereum? I have looked at projects like this but still fail to grasp it's applicability to the platform.
Vignesh Karthikeyan
  • 1,950
  • 1
  • 12
  • 40
12
votes
2 answers

What is minting? how is minting prevented after ICO?

I am trying to know how ICO works (on a high, intuition-level), somehow it is hard to find information on the following questions. As I understand this minting is the process where you create the tokens. What exactly is happening there? You create…
solaire
  • 275
  • 1
  • 2
  • 8
12
votes
1 answer

Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead

The warning is from running sample code from Mastering Ethereum, I get the above error and it says Use "constructor(...) { ... }" instead. function Migrations() public {
Vignesh Karthikeyan
  • 1,950
  • 1
  • 12
  • 40
12
votes
3 answers

Deploy multiple contracts using truffle

I am very new to developing smart contracts. I have a simple question, do i need to write migration file separately for each contract i deploy from an account using truffle or can i deploy multiple contracts using a single migration file. How to…
K Kolluru
  • 467
  • 7
  • 18