Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [ethereumjs]

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

0
votes
1answer
15 views

Web3 - Cannot read property 'clearSubscriptions' of undefined

While creating a web3 instance, and attempting to call setProvider with a valid provider (Ganache), I get a TypeError. TypeError: Cannot read property 'clearSubscriptions' of undefined Steps to ...
0
votes
1answer
11 views

VM error transaction has been revert to initial state [on hold]

pragma solidity ^0.5.8; contract PharmaChain { address public superAdmin; //address of the super admin uint quotlist; enum Status { NotExist, Pending, Aproved, Rejected, ...
0
votes
1answer
15 views

How do I deposit Ether to Smart Contract using Web3.js

So I am creating a web application that interacts with a smart contract that I deployed on the Ropsten TestNet. I am able to withdraw ether from the contract to my Metamask account using a withdraw ...
0
votes
0answers
12 views

getting an error while deploying smart contract of ethereum

I am getting an error while trying to deploy smart contract of voting dapp on ethereum I have searched for the solution for the same and i got a question with same problem but there no solution. ...
2
votes
2answers
303 views

How to connect with public Ethereum Blockchain on a backend/web server?

In the backend of a Web application I have to communicate with the public Ethereum Blockchain. On local development machine, I run ganache as testrpc and connect with such a line of code: web3 = new ...
0
votes
0answers
29 views

How can I comparing fingerprint using solidity language?

I have a fingerprint image stored in IPFS and I want to compare with another fingerprint image, because i need to know if is the same fingerprint ,is there some way, some lib that i can compare this ...
0
votes
1answer
37 views

Can I create & run test cases for smart contract without truffle?How?

does truffle is necessary for smart contract testing? Is there any alternative way, so that we can perform smart contract testing without truffle?
0
votes
2answers
52 views

msg.sender in contract is empty

I have the following deployment script var contract = web3.eth.contract(response.abi); var bytecode = response.bytecode; var options = { from: ...
0
votes
0answers
16 views

Etherscan API call at specific block number

I'm trying to use Etherscan API to call a specific method from smart contract, however, i cannot call at specific block number. For example: This is the API: https://api.etherscan.io/api?module=...
1
vote
1answer
27 views

Timeout exceeded during the transaction confirmation process. Be aware the transaction could still get confirmed

contract deploy , web3 version is 1.0.0-beta.52. let {bytecode, interface} = require('./1-compile') let Web3 = require('web3') let web3 = new Web3('http://localhost:7545') console.log('version :',...
0
votes
1answer
21 views

Method personal_sign not supported

I'm trying to use personal_sign and getting not supported error. I'm using web3 v 0.20.1 I first tried using infura and was not able to resolve the issue, so then I connected to a geth node with this ...
0
votes
0answers
10 views

Problem installing ethereum-abi module

I tried to install ethereumjs-abi module using node package manager. I used the following standard command: npm install ethereumjs-abi Although in the end I got the message from the installer that ...
1
vote
2answers
32 views

How do I recover the address from message and signature generated with web3.personal.sign?

Is there any way to do that? To recover address in nodejs server-side from signature and message after it was signed with web3.personal.sign client-side? I tried this: https://ethereum.stackexchange....
0
votes
0answers
11 views

Calculating the PPS reward

I'm trying to write a DAPP to calculate estimated rewards of miners. What is the right way to calculate PPS reward? Single Share Reward => (portDifficulty / networkDifficulty) * BlockReward Total ...
0
votes
2answers
25 views

eth.sendTransaction successful or not?

I sent 1 ETH on a private chain from node1 to node2. >eth.sendTransaction({ from: "0x30278b135d0f5c10eb0684ff18bfd84912ae0f2b", gasPrice: "5000000000", gas: "21000", to: '...
1
vote
0answers
22 views

Smart Contract ABI in Remix (Ethereum)

When I deploy smart contract on the Rinkeby network using Remix the ABI of smart contract does not contain its address, so how do I connect it with my frontend application.
0
votes
0answers
32 views

how to generate ethereum address from mnemonic and derivation path without using ethereumjs-wallet npm package?

Is there any way to generate ethereum address from mnemonic and derivation path without using ethereumjs-wallet npm package? I have generated mnemonic using bip39 and i can generate Ethereum ...
0
votes
1answer
49 views

ethereumjs-wallet/hdkey is no more in npm

how to generate multiple addresses from single mnemonic? var hdkey = require("ethereumjs-wallet/hdkey") var bip39 = require("bip39"); // You can generate a mnemonic seed with bip39 library var ...
1
vote
1answer
19 views

is the gas price on test net equal to main net?

I have 1 contract deploying on test net, let say it use 300,000 gas for executing 1 function. On main net, this contract will cost 300,000 gas per function also? Thanks
0
votes
0answers
28 views

Store data on ethereum block chain using react js

I'm trying to store data on ethereum blockchain by doing this import storemetadata from "./storemetadata"; where i have the smart contract ABI in storemetadata I now add name like so storemetadata....
0
votes
0answers
7 views

How to get Metamask return the rawTransaction from the JSON transaction?

I am in the process of exposing a web interface to interact with a back-end Web3 Json Rpc compatible node, but it is necessary that I add additional parameters in the jsonrpc request before submitting ...
3
votes
2answers
82 views

how to setup a ethereum private blockchain?

Does anyone know how to set up a private blockchain in ethereum network? is that possible to run a private ethereum node? I have seen forking of public blockchain like EOS into a private blockchain.i ...
0
votes
1answer
27 views

how to connect my html form that is username and password to blockchin and taking the username as metamask key?

I am developing a decentralized cloud web application, when the user will login into the application he/she will generate password from blockchain, I am not getting how to connect my html form that is ...
-1
votes
1answer
23 views

Smart contract to strore and retrieve address and ID in blockchian using mapping

I want to store some address and their ids in blockchain using mapping and i want to know how to get the stored addresses when searching with their respective IDs.
1
vote
1answer
52 views

Doubt in terminologies used in Ganache Interface

I am developing a DApp (an e-commerce app) based on Ethereum. I wrote the solidity contract and interact it with a NodeJS server/web3js API. I am running a Ganache Ethereum RPC client locally. The app ...
0
votes
1answer
60 views

Expected ';' but got 'payable'

I have written following Smart contract. pragma solidity >=0.4.17; contract factoryCampaign { Campaign[] public deployedCampaign; function createCampaign (uint256 minimumContribution) ...
-1
votes
1answer
74 views

UnhandledPromiseRejectionWarning: Error: invalid json request

my deploy.js script returns this error : "(node:6636) UnhandledPromiseRejectionWarning: Error: invalid json request at D:\kickstart\node_modules\truffle-hdwallet-provider\dist\index.js:15:620862 ...
1
vote
0answers
30 views

Ecrecover wrong address is returned

I'm trying to validate signed data with ecrecover. The message is signed like this on the FE: return this.web3.eth.personal.sign( `${nonce}`, publicAddress ).then( ( signature ) => { ...
0
votes
0answers
35 views

HTTP query create request error for oraclize

I have tried to deploy a sample contract having oraclizer query using truffle+ethereum bridge+solidity. First ethereum bridge made up and got OAR address which is used in sample contract in ...
0
votes
0answers
136 views

How to access the return value of function of ethereum contract using web3 in javascript?

I have written a basic hello world! smart contract and deployed using testrpc and truffle. I have a function in the contract that returns a value and i am using this function and the value it returns ...
0
votes
0answers
31 views

Unable to transfer token from one personal account to another

I have created two personal account on private blockchain with geth. This is the balance of one account web3.fromWei(eth.getBalance(eth.accounts[0]), "ether"); 100000000000 And this is of the ...
0
votes
0answers
97 views

unable to deploy contract on rinkeby network

I am trying to deploy my contract to rinkeby test network but unable to do so here is my contract code. pragma solidity ^0.4.17; contract Inbox { string public message; function Inbox(string ...
0
votes
1answer
67 views

web3 reading memory string gives error

i have declared a string variable in struct like struct test{ string testString; } I have written a function to access the variable like function getteststring(uint256 index)public ...
0
votes
1answer
33 views

Cannot see account created when using getAccounts

i have setup private blockchain on vm using geth and i have created personal account for deployment of contract on private blockchain. Now, when i try to create new account, i am able to do so but i ...
0
votes
0answers
49 views

UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The field to must have byte length of 20

I'm encountering a problem that I'm not able to solve. The code should launch a configured transaction with the details object. The current configuration is set to Ropsten and I am using the INFURA ...
0
votes
1answer
67 views

How to create trueUSD token to my eth address [closed]

I am newbee about smart contract and eth tokens. I have created an eth account by: let account = web3Client.eth.accounts.create() I have my account details. I need to add some true usd token to eth ...
1
vote
3answers
118 views

Sign Message Using private key instead of kesytore

I need to sign data using the private key and not keystore file. I can get data using: var hash = "0x" + ethereumjs.ABI.soliditySHA3( ["address", "uint256", "uint256"], [web3.eth....
0
votes
0answers
21 views

In ethereumj, why the signature use loop to get v?

In the java version of Ethereum, I see the signature code as follows: public ECDSASignature sign(byte[] messageHash) { ECDSASignature sig = doSign(messageHash); // Now we have to work ...
0
votes
0answers
11 views

How to read the data from block?

In my smart contract, I am inserting plain text message. I can also update the message. After updating, if I want to see the previous message, is it possible? Can I see all the data in etherscan.io?...
0
votes
1answer
171 views

Ganache provider not working with web3

I am trying to run a test script for my smart contract but ganache provider is not being accepted by web3 here is my code. const assert = require('assert'); const ganache = require('ganache-cli');...
0
votes
1answer
83 views

To handle emitted events from solidity in javascript in truffle suite

The function I am accessing will emit events i need to use that event but the function is a transaction when i am accessing the event it turns as promise pending . So suggest me some methods. thanks! ...
0
votes
1answer
17 views

What is the cheapest way to send ERC20 to multiple Addresses? [duplicate]

Let's say I got 100 tokens of any ERC20, and I want to send one of each to 100 differents addresses. What would be the cheapest in term of gas between 1) creating a smart contract which takes in ...
0
votes
1answer
79 views

User ether.js mnemonic for bitcoin

I'm using Ether.js for my react native app to create mnemonic. i want use Wallet.fromMnemonic(code, path) to get key pairs but when i send bitcoin Derivation Path i get and ethereum private key which ...
1
vote
1answer
38 views

Sign message twice with web3

a quick beginner's question... is it possible to sign a message twice with web3? For example Alice creates a message and signs it. Then it is sent to Bob. Can Bob sign the message before he executes ...
0
votes
0answers
22 views

Contract's Mapping variable state change fails when called from web3 js javascript program

I am running into a strange issue with following contract- pragma solidity ^0.4.25; contract ApprovedPOCreateAndOwnershipTransferContract { struct PO{ bytes32 bill_to_location; ...
0
votes
0answers
448 views

Type address is not implicitly convertible to expected type address payable [duplicate]

Can you please help me out how to explicitly convert address to address payable as i am using solidity compiler above 0.5 its asking me to have address payable when i use transfer().
0
votes
0answers
17 views

Error in establishing the connection between Geth and Api (Invalid JSON RPC response)

For my test project, I have my geth running in main server(rpc port-8117). The api(node.js), which is used to interact with the geth is present in the other system. In the api, I have given the http ...
0
votes
2answers
46 views

Ethereum Enterprise Blockchain

I am starting a project that I need to build a solution to track products (ex: from farm until it gets to the supermarket) Basically, I need to set up a blockchain structure for my company(private) ...
1
vote
1answer
15 views

Make sure I don't jump any blocks

I'm making a simple program to track transactions in and out of an address, I have a function that gets the latest block and then I run it consecutively. When I run the function sometimes the block ...
1
vote
1answer
74 views

Can I use Flutter or Android Studio to design front end instead of using react.js and still be able to interact with ethereum?

I am new to blockchain and currently learning solidity. I have understood the concept behind blockchain and solidity is also good so far. I can design mocha tests and deploy the contract on local ...