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

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
5 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
22 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
8 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
23 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
29 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
48 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
0answers
19 views

How do I collect addresses submitted by users for an ERC20 token airdrop? [on hold]

I'm planning on conducting an airdrop for 30,000 to 50,000 people, the site is ready, the executive summary, the whitepaper, the budget is set and the only thing i need to know is how to save the ...
0
votes
1answer
12 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
24 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
25 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
28 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 ...
-1
votes
0answers
51 views

ERC20 Token not appear on approveAndCall function

When I use the function approveAndCall on my Token contract (ropsten) and Metamask is triggered, my token name and value do not appear, only the gas calculation. I have added a custom token to ...
0
votes
1answer
22 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
36 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
29 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.
0
votes
0answers
30 views

Getting an error cannot read property “encodeParameters” of undefined

I am running a node.js server but while running it, i am getting following error. what could be the possible reason?
2
votes
1answer
26 views

How to set the call back in WEB3 with Jquery

I have 2 functions in blockchain contract to get the investors and funds for an address and tried to save that in excel. 1st Function To get the list of investors getInvestorsList() 2nd Function ...
0
votes
1answer
20 views

HDWallet Provider vs HttpProvider

What exactly is the difference between HDWalletProvider and HttpProvider, and what is the proper scenario for using each?
1
vote
1answer
19 views

web3.eth.sign sometimes gives V parameter of 54 or 55, ecrecover then fails. What's going on?

I've been using ecrecover and web3.eth.sign to authorize transactions, but when I run web3.eth.sign a second time on my server, the V part of the signature is wrong(or, at least, ecrecover thinks it's ...
2
votes
0answers
30 views

geth : Unable to fully sync to Rinkeby

I am trying to synchronise geth with Rinkeby node but when around 100 or so block left, it keep on dropping the peer and doesnot sync fully with the test net below are the screenshot for the same.
1
vote
1answer
19 views

is there any method convert mutiple params to one bytes in web3js ,and then get these original data from bytes in solidity?

eg: the params in js code below,how to convert to one bytes var min=100; var max=100000000000; var price=1000000000000000000000000000; var name="john"; in solidity code below,how to get original ...
0
votes
1answer
25 views

How to automatically deliver the tokens in a PostDeliveryCrowdsale

My goal is to deliver the tokens only at the end of the crowd sale. I have seen the below code which can deliver the tokens in a batch. Questions Will this work even when there is a million _to ...
3
votes
1answer
73 views

Evaluate the performance of a smart contract [closed]

What is the best way and tools to evaluate the performance of a smart contract. More specifically, I want to test my contract for large scale deployment by making a script that emulate real world ...
0
votes
1answer
32 views

TypeError: ajtokenSaleInstance.tokensSold is not a function

I am following this tutorial on youtube "Code Your Own Cryptocurrency on Ethereum (Full)" i stuck at one of the part where i am trying to return the value of TokensSold but i keep on getting error as ...
-1
votes
0answers
31 views

The uport app doesn't ask me about the credentials as set in the file

That's my react uport app code on github: https://github.com/damianjnc/reactuport It should ask me about my creadential afer scanning the QR code as shown in this video: https://www.youtube.com/watch?...
0
votes
1answer
25 views

Script For Emptying Address

Does anyone have a script that can be used to transfer all ether found in an address to another address? The script will constantly check for any incoming ether and make an automatic transaction, ...
1
vote
1answer
30 views

If a smart contract automatic transfer its ether to it's benificiary accounts then who will pay gas price (transaction cost) for this transfer?

I am writing a smart contract of a charity.It pay all the money to it's subscribers in every week. I am puzzled in such point that who will pay the transaction cost of transfer? When I am ...
0
votes
2answers
64 views

Returning error message from smart contract

I am trying to return error messages from solidity. I have this contract: pragma solidity ^0.4.23; contract Simple { function arithmetics(uint a, uint b){ require(...
0
votes
1answer
34 views

How would you generate this transaction hash?

let contract = await instance.mint( accounts, usersInput.url, usersInput.metadata[0], usersInput.metadata[1], usersInput.metadata[2], { ...
1
vote
1answer
17 views

Can't approve a transaction via uport though i have balance.what is the reason?

I am using rinkeby network. I am try to save a information to rinkeby network.but a popup apera to sign or approve the transaction via uport. i have balance but i can't sign the transaction. ...
1
vote
0answers
18 views

Signing a transaction with uport can't approve as the selected account can't change.How can i change in uport selected account?

I am developing a dapp with uport verifications but when i goes for saving a information into ropsten network. a uport signing transaction is apear on my screen and i can't approved the transaction. ...
0
votes
1answer
39 views

How to sign on ethereum a pdf like on this video? [closed]

How to sign on ethereum a pdf like on this video? I'm asking specifically about what happens at 00:40 where you have a user uploading the file and then it get stored and cryptographic signature is ...
0
votes
1answer
62 views

Web3 Rinkeby Infura Problems

I've got a Smart Contract that works perfectly when deployed to localhost: 8545 (using Ganache) with my Web3 Dapp. But when I put it on Rinkeby, I'm running into problems,. The Contract is super-...
0
votes
2answers
81 views

What is the best practice for a tax payment Smart Contract?

I have just been introduced to Ethereum Smart Contracts and I have a faculty-related project that implies the usage of them. The idea is to create a DApp which allows clients (persons) pay taxes (in ...
0
votes
1answer
102 views

How long does it take to sync Rinkeby network with geth?

I am syncing the Rinkeby network with geth geth --rinkeby --rpc --rpcapi="personal,eth,network,web3,net" --ipcpath="~/.ethereum/geth.ipc" When I run eth syncing in geth console, it is showing { ...
0
votes
1answer
18 views

Script to automatically transfer ether to another address

Please, can anyone help with a script to use and watch my address for any incoming ether, and once it enters, the script would quickly transfer the ether to another address. I would also love to know ...
1
vote
1answer
90 views

MetaMask breaking change - does ethereum.enable() prompt an Access signature every time it's called?

Does ethereum.enable() prompt an Access signature every time it's called? Or will access-granted status persist?
1
vote
3answers
41 views

What is Metamask?

I know it's a dApp web3 browser, a wallet. But which ethereum client is used in the back end to interact with block chain? How the same account is able to connect with all networks (mainnet,testnet, ...
1
vote
2answers
35 views

How to setup 'topics' for function getPastLogs ()?

Sir, I want to read the past event log by using getPastLogs(),but I got the whole log.I hope I can filter some log. I find I can setup the 'topics' in getPastLogs(),but it always fails. How ...
1
vote
1answer
27 views

Send eth from one account to another using transfer() function

I am trying to write a smart contract that will send eth from one account to another account : Contract Send { event Sent(address from, address to, uint amount ); function send(address _receiver,...
0
votes
1answer
31 views

About getPastLogs usage

"getPastLogs" can get past event log. I check the web3 documentation: fromBlock - Number|String: The number of the earliest block ("latest" may be given to mean the most recent and "pending" ...
0
votes
2answers
130 views

Sending Signed Transaction returns pending and event:undefined

I am trying to send a signed transaction using web3 1.0 and Infura.io through the browser. When I run it I dont get any errors but the transaction never hits the blockchain so I am confused on whats ...
0
votes
3answers
68 views

how to generate mnemonics from randombytes

I am able to get the randombytes using react-native-crypto-js const words = CryptoJS.lib.WordArray.random(32); Is that possible to generate mnemonics using random bytes.
0
votes
1answer
95 views

Error: Cannot find module 'ethereumjs-wallet'

A truffle test needs ethereumjs-wallet const wallet = require('ethereumjs-wallet'); I tried npm install ethereumjs-wallet and even npm uninstall ethereumjs-wallet npm install --save ethereumjs-...
2
votes
1answer
97 views

Different address with single mnemonic phrase

I'm trying to implement ethereumjs-wallet library to my code. But when I decided to compare generated accounts with accounts generated with the same mnemonic here, I got absolutely different accounts, ...
1
vote
0answers
49 views

Unable to deploy smart contract to rinkeby using ledger wallet?

I am trying to deploy smart contract using ledger wallet. But i keep getting the error cant subscribe to new header. However i get the transaction hash but cant receive the contract instance and ...
0
votes
1answer
53 views

How to state private keys when using node.js and ethereum to run a contract?

I have to run node.js to execute smart contracts. My quetsion is about the keys. I have seen this from the docs - 1. Code to sign 2. Code to execute But I am unsure how the two are combined. Could ...
2
votes
0answers
82 views

Mnemonic and HD Path in Ganache and ethereumjs-tx gives different private key and address

I am having difficulty reproducing the private key and address using the mnemonic and HD path provided by Ganache. Mnemonic weird farm vast surge upper truth answer end radar impact mind jeans HD ...
0
votes
0answers
43 views

Getting Addresses using a Path causes the error: Could not derive hardened child key

I am using ethereumjs-wallet npm package to generate a unique wallet address for each user. However instead of using the mnemonic/seed, a public extended key xpub will be used instead to keep the ...