Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

For questions regarding the installation or use of EthereumJS, a Javascript library that implements a number of Ethereum utility functions.

1
vote
1answer
14 views

Allowing multiple polling for user

Is there a way to allow user to vote for multiple proposals. For example: User A can vote for proposals :P1,P2,P3,etc. Once A has voted for P1 he should not be allowed to vote for P1 but is eligible ...
0
votes
0answers
8 views

Unable to Generate Same Account from MetaMask Mnemonic in EthereumJSWallet

I've been unable to generate the Account I see in MetaMask in EthereumJSWallet even if I use the same mnemonic. Due to the lack of documentation, I may be misunderstanding how to do so. I have run ...
0
votes
2answers
15 views

Require validation error not working

I tried using require method in solidity in the following way: require(validate(personName),"Error: Invalid Person") In this case i am checking if a person is already added to my person list. If not ...
0
votes
1answer
13 views

solidity error, while accessing struct value of an array of nested mapping of deployed contract

Remix Error: Type error, Return argument type inaccessible dynamic type is not implicitly convertible to expected type (type of first return variable) bytes32[]. snippet code shown below: Do take note ...
0
votes
1answer
23 views

solidity interaction with a struct mapping of a deployed smart contract

I have followed the below code as follows on remix and it works fine but i have an issue when i try to access one of the struct value of a key.The last line of the code doesnt work. pragma solidity ^...
0
votes
1answer
31 views

getting error nonce too low , but nonce is proper stuck since one day

I am working with web3.js since sometime now , but now i am stuck with nonce too low error , the nonce is proper also i have checked private key and other addresses , they also seem to proper , ...
1
vote
2answers
17 views

Convert array with hex datatype to readable format using truffle console

I am new to ethereum. I am using truffle to develop, deploy and interact with my solidity contract.I have a function in my contract which is as follows: function getResult(bytes32 name) public view ...
0
votes
1answer
21 views

Store N key value pairs

I have a scenario where I need to store N no. of document hashes in a smart contract with some key(id). And also fetch the particular document hash by it's key. Any help on designing the structure for ...
4
votes
2answers
78 views

Difference between public private and consortium blockchain

I am new to blockchain therefore i am trying to understand difference between private public and consortium blockchain. I do understand public blockchain but i am unable to differentiate between ...
1
vote
1answer
43 views

problem deploying a contract

I am trying to deploy a contract on testrpc using web3.js, contract deploys fine when I deploy it from remix, it uses roughly the same amount of gas as the estimate. However, when I try to deploy ...
1
vote
1answer
49 views

How to calculate optimal gasPrice and gasLimit? [duplicate]

I am using rawTransactions and web3Instance.eth.sendSignedTransaction to deploy and interact with smart-contracts. The problem is that I can't figure out hot to calculate optimal gasPrice & ...
1
vote
3answers
44 views

Problem using require('ethereumjs-tx');

I am making a dapp and I am trying to import modules. The structure of my folders is the one that you can get from the truffle webpackage, the following: -App ---build ---constracts ---migrations ---...
2
votes
0answers
18 views

msg.sender is not showing corect value

I am facing a strange issue. Please read the below case craefully and assit me to geth this issue resolved. I have ERC20Token created by Zeppling templates. [Please ignore syntaxes, I am just trying ...
0
votes
0answers
20 views

How to create hd wallet for multiple types of coins (like bitcoin,ethereum,eos ) in node js

I'm using two different library to create HD wallet for ethereum and Bitcoin. instead of two different lib, I need to use a single library to create HD wallet for multiple coins. let bip39 = ...
2
votes
0answers
31 views

Signature generated through web3.eth.sign not leading to same address after fromRpcSig

I am trying to write sign a challenge using web3.eth.sign, web3 uses ganache.provider(), But when i do fromRpcSig(signature) ecrecover(challenge) which results in different address. But when i sign ...
2
votes
0answers
25 views

Estimated gas is always low

web3.eth.estimateGas is always calculating low gas for the transaction. Here is a reference to a trasaction in ropsten. https://ropsten.etherscan.io/tx/...
1
vote
0answers
23 views

Uncaught at initializeDrizzle TypeError: Cannot read property 'apply' of undefined

I am working a Drizzle truffle box project, and this is my first intro to React so I am struggling a little bit. I keep getting this error and I cannot for the life of me seem to fix it. The ...
1
vote
0answers
32 views

Loading Script Geth puppeth

I failed to load a script into a private blockchain setup using puppeth. I have used puppeth to configure a private blockchain (PoA) with a few sealers on different vms. Could someone help? I now ...
1
vote
1answer
14 views

Digital Identity with signing

Is there a way to sign some data right out from a smart contract? Let's say I want to create a smart contract, that will represent my Digital Identity and I want it to have sign() method. Maybe ...
0
votes
0answers
21 views

Web3 Not Being Imported Into React Project

I'm trying to add web3 to my react.js dapp. In my index.js file I have this code: import Web3Provider from 'react-web3-provider'; ReactDOM.render( <Web3Provider defaultWeb3Provider="https:/...
2
votes
0answers
36 views

How to use ethereumjs-vm to find the internal transactions for a transaction/block using infura.io

I am using infura.io as my node and trying to get the internal transactions (i.e. transfers initiated by smart contract) for a specific transaction (or its parent block). I have two attempts (both ...
1
vote
0answers
19 views

How do I get a merkle proof (stateHash) from the merkle patricia trie?

So I understand how a patricia trie works, it's a trie using 0 to f as root nodes, and it also removes empty nodes to make leafs and extensions. What I don't get is how the stateRoot hash is made. ...
0
votes
0answers
29 views

How to deploy a smartcontract on mainnet without a browser (=no metamask)

I want to deploy a smart contract without the browser, so with no metamask and no remix. I tried ethers.js but I have this error on etherscan : "Warning! Error encountered during contract execution [...
0
votes
1answer
14 views

Access Block Document

I have a requirement where we need to save data(pdf) to blockchain so that any third party can access and view it later by the block address. I can't store the hash of the data on blockchain as the ...
1
vote
0answers
21 views

creation of Hourglass errored: transaction execution failed

I don't know why I'm getting this error while deploying 2 of my contracts. creation of Hourglass errored: transaction execution failed while code compiles successfully no issues there. ...
1
vote
0answers
38 views

miner shows 0x0000000… while getting block details using eth.getBlock()

I have created a private ethereum POA network using a bootnode and 6 nodes , of them 3 are miners .But every time i do a successful transaction over network , the miner returned by the getBlock of eth ...
0
votes
1answer
21 views

30 second delay after payment submitted to Rinkeby test network before receiving Tx hash?

When I call the .send(); from Web3.js based browser Javascript code, there is a 30 second delay right after I submit payment via the Metamask extension before the call returns with the Tx hash. Note,...
5
votes
3answers
595 views

I get error couldn't find module 'ethereumjs-wallet/hdkey'

I was running this code deploy.js const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const { interface, bytecode } = require('./compile'); const provider = ...
0
votes
1answer
75 views

Problem with sending ERC20 token using web3@1.0.0

Circumstance I have followed all indications from this GH issue and from other SO posts. The transaction gets successfully broadcasted but no tokens are transferred. When I check the balance before ...
1
vote
1answer
19 views

Why am I not receiving '5 passing, 1 failing' after performing truffle test?

After running truffle test i get the following unexpected error: Zanes-iMac:riskxtoken zanemassey$ truffle test Using network 'development'. Compiling ./contracts/Migrations.sol... Compiling ./...
0
votes
0answers
11 views

How to get daily transactions for ethereum?

On etherscan there is a graph of Ethereum's daily transactions. I'm building an app that needs the same functionality. Is there an api I can use to get daily or even real time transaction count?
1
vote
1answer
27 views

Specify address for transaction in truffle test

I want to specify the address I perform a transaction with in my truffle test. My test looks approximately like this: contract('Test contract', async (accounts) => { let contract; ...
0
votes
1answer
43 views

How do I define my token to pass truffle test?

After running truffle test i get the following error: Zanes-iMac:xyztoken zanemassey$ truffle test Using network 'development'. Compiling ./contracts/Migrations.sol... Compiling ./contracts/xyzToken....
0
votes
1answer
76 views

Transaction signing fails Invalid RLP.“,”data“:”RlpExpectedToBeList"

I'm trying to sign and push a transaction using ethereumjs and Infura. It seems to be working and I'm getting a transaction hash back, but the transaction is not visible on Etherscan, and when I'm ...
0
votes
2answers
62 views

Ethereum transaction RangeError: private key length is invalid

I'm running a tutorial on how to sign an ethereum transaction programmatically, and I'm getting the following error: RangeError: private key length is invalid This is the code: var Web3 = require(...
1
vote
1answer
49 views

NodeJS with HDWalletProvider

I want to execute signed Ethereum transactions from a NodeJS program. I am creating a web3_provider like this var contract = require("truffle-contract"); var provider = new HDWalletProvider("nemonic"...
1
vote
1answer
149 views

web3.js error: Cannot read property 'providers' of undefined

What is problem of this simple html / JavaScript / ethreumjs / web3.js code? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title&...
1
vote
1answer
87 views

How to use “web3.js library” in a “JavaScript” file without using “require(”web3“)”?

Consider we want to use web3.personal.sign in a JavaScript file. So, we need to add : Web3 = require("web3") web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); at top of our ...
0
votes
0answers
20 views

Parsing levelDB files with ethereumjs

I am trying to read the leveldb files using ethereumjs. Here is my code below (taken from https://wanderer.github.io/ethereum/nodejs/code/2014/05/21/using-ethereums-tries-with-node/) - var Trie = ...
0
votes
0answers
39 views

How to be sure “ethereumjs” is installed?

I installed ethereumjs library using following command: npm i ethereumjs-testrpc And here is the output: And then I tried to run an html example which uses ethereumjs-vm. The example is here : ...
0
votes
1answer
31 views

How to time how long it takes to mine a block? [duplicate]

I've recently created a private ethereum blockchain and would like to time, personally, how long it will take to mine a block in the private blockchain I have created. I'm using the command line/geth ...
0
votes
0answers
12 views

“The type of the local variable x is uint[] storage,but since storage is not dynamically allocated.” What exactly it means? [duplicate]

Can someone please explain the content below? A common mistake is to declare a local variable and assume that it will be created in memory, although it will be created in storage: /// THIS ...
0
votes
1answer
33 views

AttributeError: 'Web3' has no attribute 'shh'

Web3.py version: 4.2.1 Python: 3.5.2 OS: linux geth version: 1.8.0-unstable I am running geth with --shh flag and --rpcapi "admin,eth,net,web3,debug,shh" from web3 import Web3, HTTPProvider web3 = ...
1
vote
1answer
35 views

Transaction fail (Tx is Successful in Remix)

I get a transaction failed when trying to execute the following contract: pragma solidity ^0.4.23; pragma experimental ABIEncoderV2; contract state { uint256 contract_version = 1; ...
0
votes
0answers
22 views

Can the result of a call trigger the execution of a transaction?

Supposing I have a transaction (A) = a call (B) + other storage operations (C). Executing A, beeing a transaction, I have to pay the gasUsed by B and C. Beeing B an expensive call and since I need the ...
0
votes
0answers
33 views

Can't call solidity function which has array of address as an argument using web3?

Here is my function inside the smart contract: function mintForInvestors(address[] _to, uint256[] _amount) onlyOwner canMint public returns (bool) { And here is how I am trying to call it with ...
0
votes
1answer
235 views

how to get the token transaction history via web3.js (0.20.6)

set up node.js + web3.js (0.20.6 version) + and using infura for the httpProvider I've figured out and successfully sent erc20 tokens using the web3.js, (after a lot of googling... complete noobie ...
0
votes
0answers
32 views

Is there a way to check block mined was an uncle block?

From the reading I've been doing, uncles are not added to the blockchain but only there headers are stored. For uncles to be added to the blockchain, they need to be mined first. If this is the case,...
1
vote
0answers
26 views

Solidity problem error space coding [closed]

i'm facing a problem with coding the migration.sol how i can fix these error space! - pragma solidity ^0.4.24; contract Migrations { address public owner; uint public ...
1
vote
2answers
63 views

What is Calldata

What is calldata ? I have learned three types of memories which are : 1.Storage 2.Memory 3.Stack In ethereum documentation, it says the function parametera are of type memory by default But later I ...