Questions tagged [ethereumjs]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
30 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 ./...
1
vote
1answer
174 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
349 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
478 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
449 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
282 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
946 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
2k 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
96 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
112 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
1answer
97 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
82 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
40 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
2answers
2k 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 ...
1
vote
0answers
82 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
5answers
1k views

Usage of Float Numbers in Smart contract

I am not able to store and retrieve some values of Float types from smart contract. I am about to store the values of IP Address, Geo-location, Mac address etc.. which all are of float types. I know ...
0
votes
2answers
785 views

web3.js library not loading properly

I am trying to load web3 library after installing it via command prompt. However, looks like it is not loading properly as it is not showing all the details for Ethereum ecosystem (ex. unitmap of ...
1
vote
1answer
687 views

how can I get the data returned from solidity function from transaction id in web3js when a solidity function is callled?

I want to get the return data written in solidity function in web3js . I am using the web3.min.js from the truffle pet-shop package as the web3 library . Everything is working fine when calling the ...
0
votes
2answers
110 views

How can I use Web3.js to specify a specific user?

I'm new at Web3.js. In geth, I need to unlock an account before I use this account to send some transactions. This does make sense. But in web3.js, I don't know how to specify the account. ...
0
votes
0answers
296 views

(NEW UPDATE: I need to run “testrpc”) Signing a message using “ethereumjs-abi”? (Error: Invalid JSON RPC response: “”)

I am trying to sign a message using following JavaScript code (from HERE) function constructPaymentMessage(contractAddress, amount) { return ethereumjs.ABI.soliditySHA3( ["address", "uint256"], ...
0
votes
1answer
254 views

Get all function names of specific smart contract ABI

I just want to get list of function names from smart contract abi. Please guide
1
vote
2answers
1k views

How execute a contract method with private key / sign send method?

I'd like to execute an erc20 contract method without unlocking a wallet, signing the transaction inside my code. Here is how the code should look like: public async send(sender: string, receiver: ...
2
votes
1answer
31 views

Transaction wont commit to a block if I send transaction that is signed by private key that is generated by ethereumjs-wallet

Problem So basically what I am trying to do is to send Transactions that were signed by an account that was generated by ethereumjs-wallet so my node don't keep UTC file and therefore I don't have an ...
1
vote
0answers
41 views

Same Transaction is getting mined twice

I have a smart contract which generates a random number and compares it with the user's input to check if both are equals, and based on that it updates a mapping. But anyhow the same transaction is ...
1
vote
1answer
21 views

Ask for explanation of some notations in Ethereum opcodes

I am going to implement EVM for my own project, while reading yellow paper, I can not understand some notations, can anybody help me to clarify them: what is µ_i in the picture above
0
votes
1answer
27 views

Is it possible to see changes that have been made by a user on blockchain?

Is it possible to see every changes that have been made to the block chain from various accounts.In other words is it possible to see what changes have been done by a user to, say its location(a field ...
2
votes
2answers
883 views

Using Trezor (Hardware wallet) with Web3js on Truffle or Ropsten

We are trying to integrate web3js with Trezor in a truffle dev network or using ropsten test network. The idea is to sign the transactions using the hardware wallet and then send a raw transaction ...
1
vote
1answer
184 views

Ethereum private chain not able to addPeer

I created a private chain with my friend with exactly the same genesis block and we wanted to connect through the admin.addPeer method. The problem is that for some reason they are able to connect to ...
1
vote
0answers
190 views

Truffle TypeError: Member “error” not found or not visible after argument-dependent lookup in type(library Assert)

Trying to test my Solidity contract for errors using Truffle test. TestSafeMath.sol function test_add_10_and_max_should_return_err() { uint256 max = 2**256 - 1; Assert.error(SafeMathExt....
3
votes
1answer
447 views

How to calculate the merkle proof for quering the balance of a token holder?

I know this can be done through accessing the full node of Ethereum, but I want to know, how could I do it technically? Suppose I have an ERC20 token contract having address 0xabc.. and Alice is the ...
0
votes
1answer
192 views

Unable to view the transaction details in etherscan

I am using ethereumJs and web3.js to send erc20 tokens from one account to another account.I am able to get the hash of transaction, but cant see any transaction details on the etherscan. var Web3 = ...
0
votes
1answer
196 views

How can I check the provider status ? if testRPC connected or not?

I have a problem with using : web3.net.listening The case when I am connected to the testRPC is working and it returns me TRUE. But the case I am not connected it returns me INTERNAL SERVER ERROR. I ...
1
vote
1answer
46 views

Token added to each MetaMask account

I just request a token(Ropsten test net) from one of my "MetaMask" account(Account 1). But MetaMask showing me same token balance from each Account(I have 3 Accounts). Why this token added to each ...
3
votes
3answers
3k views

how to make batch transaction in ethereum?

Is it possible sending ether to multiple addresses in one go, better called batch sending? I want to make an API to transfer ether to 100 address at once so that I do not need to make 100 transactions....
0
votes
2answers
83 views

Is it necessary to store transaction data into a database?

I am wondering if there are no security risks if i store transaction data in a database besides the fact that is stored on the ethereum blockchain. I am using an API to manage my smart contracts and ...
1
vote
1answer
94 views

How to create a wallet address (say) for a user sign up with any password of user choice and login next time with the same password?

I want my dapp to allow a new user when submitting a sign up to create an ethereum address with his provided password of his choice and next time when he logs into dapp, he must be able to login with ...
2
votes
1answer
4k views

The MetaMask Web3 object does not support synchronous methods like personal_newAccount without a callback parameter

im using web3j with angular 5 connection working perfectly and balance showing perfectly. but when i write transfer function it throw error var tx = this._web3.eth.sendTransaction({ from: this....
1
vote
0answers
105 views

Library for create ethereum wallet

I want to create an ethereum wallet that is erc20 compatible on my client side. It should allow user to enter his own password and generate private key, recovery phrases and utc file. I try to ...
1
vote
1answer
521 views

Ethereum Derivation path(m'/44'/60'/0/'0/n)

when we create ethereum HD wallet through a mnemonic phrase, we always need derivation path. is it fix for a particular currency or we can put whatever we like (ex- m/0/n, m/4/3/n or anything else)?
2
votes
1answer
368 views

How to change block generation period?in POA private ethereum blockchain

my genesis.json like that: "config": { "chainId": 333, "homesteadBlock": 1, "eip150Block": 2, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "...
0
votes
1answer
827 views

How to connect your react ethereum project with MetaMask wallet?

I am developing a ReactJs blockchain application on ethereum network. How can I use MetaMask Wallet instead of local ganache account. import web3 from 'Web3'; const web3 = new Web3("localurl");
1
vote
0answers
361 views

Raw Transaction: GasPrice, Limit in Hex or Decimal?

When signing a raw Transaction like this: (example taken from Javascript API Docs) var Tx = require('ethereumjs-tx'); var privateKey = new Buffer('e331b6d698.......................23123', 'hex') var ...
0
votes
2answers
201 views

Gas related issue at the time of contract migration

Error: The contract code couldn't be stored, please check your gas amount. (I also tried to add gas in truffle.js but didn't get any success) pragma solidity ^0.4.21; contract Ownable { address ...
1
vote
1answer
1k views

How to build an API that communicate with Smart contract Event?

I want to build an API to manage the smart contract events and I wonder how to do it using Node.js. Anyone that can help?
1
vote
0answers
57 views

Derive additional accounts from private key

Im building a dApp and during account creation I can generate an address as well as private/public (extended) keys. What i want is to be able to generate further accounts after the seed is no longer ...
0
votes
0answers
78 views

How can we define the communication line with the Ethereum Blockchain?

Imagine we have a wordpress website and you want to use the functionalities of the smart contract to test your business logic. I am using a web3 library with drupal to test my smart contract using ...
1
vote
2answers
548 views

Call array variable from solidity contract in web application

I have declared one array inside solidity contract like "uint256[] public machineList; " and initialize the values of that array inside the constructor. But when I call that array inside js usgin ...
1
vote
1answer
2k views

Javascritp app.js function returning Undefined

I'm trying to write a simple function retrieving the contract address with a simple call. Anyway while the address value is correct in the function scope, the return value calling the function in that ...
2
votes
0answers
570 views

Hyperledger Fabric and Ethereum Blockchain Integration

How can I connect Hyperledger Fabric to the ethereum blockchain so as to make payments. I am recording the number of tokens to be alloted in the hyperledger system I want to access the data and then ...
0
votes
1answer
82 views

solc compiler; ParserError: Token incompatible with Solidity parser

I am trying to compile this contract (part of an online tutorial, not my contract). I'm running ethereumjs-testrpc (ganace precursor) on one terminal, then on another instantiate web3 object; > ...

1 4 5 6 7 8