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
0answers
4 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 ...
2
votes
2answers
37 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
0answers
6 views

Can we compare some of decentralized exchanges? [closed]

among the top decentralized exchanges, I almost use KyberSwap and Bancor. I would like to hear your options when you choose the exchange to trade. Many thanks!
-2
votes
0answers
21 views

Error: Type “mapping(string => string)” not supported for state variable.\n\tmapping (string => string) dataLink; [closed]

My work is in terminal. First i install the solidity compiler by $ sudo npm install solc@0.4.11 $ node ...
-1
votes
0answers
60 views

Error while truffle test

C:\Users\Dreams\Newcontract>truffle test Using network 'development'. Compiling your contracts... =========================== > Everything is up to date, there is nothing to compile. C:\Users\...
0
votes
1answer
17 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
22 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
42 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
23 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
40 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
23 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
25 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
53 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
20 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
41 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
23 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
21 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
21 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
48 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
52 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
16 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
8 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
88 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
36 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
14 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
40 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
34 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
15 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
183 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
14 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
42 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 ...
0
votes
0answers
26 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 ...
0
votes
0answers
15 views

how to compute smart contract address in native JS or web3.js [duplicate]

I am newbie in Solidity. I've read that the address for an Ethereum contract is deterministically computed from the address of its creator (sender) and how many transactions the creator has sent (...
1
vote
1answer
49 views

On Rinkeby, after I deploy my gas limit is low for function, even though it was high when I deployed

I deployed my smart contracts to Rinkeby. I made my gas limit 3000000 in truffle.js like so: rinkeby: { host: "localhost", port: 8545, network_id: 4, gas: 3000000 } On Etherscan, it shows my ...
1
vote
1answer
25 views

Calling a write function of a contract will deploy a new contract

I'm calling a function that will write information to contract, and MetaMask will list it as a 'Contract Deployment'. It is on the Rinkeby testnet. But if I run it locally using Truffle/Ganache, it ...
0
votes
1answer
23 views

How to interact with events from a smart contract?

can we get access to watch the event and get logged data from them and use it for processing in a smart contract? Like matching an state variable with the data logged by an event .
0
votes
2answers
32 views

Which ERC standard is suitable for an ICO token to have types?

There will be ICO with multiple cycles... Here, investors can purchase tokens and after a fixed window of 270 days, they can redeem it back. But within this window period, they can transfer tokens to ...
0
votes
1answer
12 views

How do you add miner address so that it can mint tokens?

I have ERC721 that I'm making. function mint(address to, uint256 tokenId) public onlyMinter returns (bool) { _mint(to, tokenId); return true; } How can I add an address so that it is able ...
0
votes
1answer
33 views

Transferring funds from a contract to an account using adresses

I had been trying for a long to transfer the complete fund with one of my contracts to a specific account. But nothing seems to be working. pragma solidity >= 0.4.22; contract reg{ address ...
0
votes
0answers
52 views

Transferring ether balance from contract balance to winner,not working

here is my Solidity snippet: function deliverPrizes(address payable winner) public onlyOwner{ winner.transfer(address(this).balance); } This is what I wrote on truffle console: dCoders....
2
votes
3answers
82 views

accepting ether in a smart contract

I want to create a simple smart contract for registration of users to a competition where when users can pay to contract and 2 ethers will deduct from his account. But when I'm trying to do so on my ...
0
votes
1answer
23 views

Stress test DApps on rinkeby test network

Is there any way of stress testing a dapp? I developed dapp, now I want to see how much stress it can handle? I can't test it on Main Ethereum Network. At least I can do it on Rinkeby test Network. ...
0
votes
0answers
30 views

Sending message on a transaction?

I want send a data on a transaction. _data is storing my message.. Here's my code: const Tx = require('ethereumjs-tx') const Web3 = require('web3') const web3 = new Web3('https://rinkeby.infura.io/v3/...
0
votes
2answers
34 views

Saving the actual data vs. hash of the data - which one is better?

I am new to etheruem, I would like to create a smart contract for keeping document data. From 2 designs below, can I know the pro and con of each one, please? put the array of raw JSON data to the ...
1
vote
1answer
36 views

how can the smart contract auto update contract status for every 1st of each month? [duplicate]

I am new to etherum blockchain. I am working on designing the contract for payment money. The customer must pay money for rent space for every 1 month, or the contract will be invalid. How can my ...
0
votes
1answer
28 views

How to centralize same ERC-20 token to one ETH address using SMART CONTRACT/SIGNED OFFLINE TRANSACTION

Suppose i have same ERC-20 Tokens in 100 ETH accounts. To sell those i have to send the token one by one to ONE mother ETH address. It takes lot of time. I heard there is a shortcut way to do that. ...
0
votes
1answer
22 views

Single Entrance Restriction

Please suggest that how two restric subscriber for single entry means no one can join twice. function selectionW1(address subscribersW1, uint subscriberWheelW1) public { require (...
1
vote
2answers
60 views

Collecting ERC20 balances from multiple addresses?

I'm building a dApp that involves creating unique accounts for individual users for ERC20 deposits [I keep the addresses and private keys in a centralized database], for popular ERC20 tokens like BNB, ...
1
vote
1answer
46 views

Any who has done any smart contract analysis? [closed]

I want to analyze smart contract application and I wanted to know if there is a crawler for it and after the contracts have been crawled using the data's from the contracts to analyze each block.