We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [web3js]

Javascript API and library for Ethereum To develop applications on Ethereum, you can use the web3 object provided by the web3.js library. Under the hood it communicates to a local node through RPC calls. web3.js works with any Ethereum node, which exposes an RPC layer. https://github.com/ethereum/wiki/wiki/JavaScript-API

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

fallback function using Relay contract with delegate call in web3js not working

I have checked all over the stack but I am still unable to call the delegate function properly in Relay contract which supposed to call its fallback function. I am using solidity version ^0.5.0 I ...
0
votes
1answer
30 views

invalid solidity type

solidity 0.5.0 web3@ 0.20.7 In my contract.There's a function (view) returns a struct type. When I used web3.js to call this function, I got "Error: invalid solidity type!: tuple". I know that this ...
0
votes
1answer
32 views

How to build security into Dapps?

I am building a loan dapp. The functionality is not easy to build but relatively straightforward. My question is though does anyone have any suggestions of how to build in user logins and security? ...
0
votes
0answers
16 views

How do a set cookie for a Dapp's front end and pass the information to blockchain?

I am trying to look up documentation on setting up cookies for my dapp using web3 but I am unable to find resources. Can I just use js functions like setCookie and getCookie as one would do for a ...
1
vote
0answers
36 views

Ganache is not showing any events

I have a contract method which emits events but ganache seems not to catch any events. I say this because when I deploy my contract on ropsten the events are being caught fine but only in ganache I ...
0
votes
1answer
23 views

getPastEvents on localhost is not a function error

Now, I'm working on an Ethereum Blockchain project to transfer the ownership of stored devices by using local web3 provider at the truffle environment. Truffle v5.0.27 (core: 5.0.27) Solidity v0.5....
-1
votes
1answer
12 views

I want to create a account on blockchain using web3swift in IOS app, but I am new on blockchain don't know how to do. Please can anyone help me out?

I want to create an account on the blockchain using web3swift in the IOS app, but I am new on blockchain don't know how to do it. Please, can anyone help me out?
0
votes
1answer
26 views

How can I implement redactable chain for ETH?

I am trying to research about Redactable blockchain so my question is how can I implement a Redactable chain in Eth if someone has some idea about it I will be thankful
0
votes
1answer
33 views

How to choose wallet with web3

I have MEW and Metamask installed. When I am trying to send a transaction using: web3.eth.sendTransaction() It always uses Metamask. May I know how can I specify I want to use MEW instead?
0
votes
2answers
95 views

Truffle - Get ETH Balance with Web3JS - two different errors

Using "web3": "1.0.0-beta.46" because doing a tutorial, and they recommended using all his versions to make sure everything works together. Using Gnache and Truffle unit tests, I have tried two ...
0
votes
2answers
51 views

Sign message with web3 and verify with openzeppelin-solidity ECDSA.sol

I'm trying to get a little example working with ECDSA.sol here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/cryptography/ECDSA.sol This contract: Generate a random(...
0
votes
2answers
33 views

Not able to successfully send Transactions via MetaMask on Firefox Browser

Does anybody help me figuring out why I am getting failed transaction here?What does this error means? Few days back,with the same line of code,I was able to successfully send transactions. An update:...
0
votes
1answer
54 views

Invalid sender address, failed to deploy a transaction to the blockchain network

Description I'm trying to deploy a contract to rinkeby network, but everytime I like to deploy the contract it throwing error as invalid sender. Compile code const path = require('path'); const fs =...
0
votes
2answers
39 views

invalid number value for power of 18

Using web3js v1.2.1 const contract = new web3.eth.Contract(abi, '0x29...'); const amount = 1 * 10 ** 18; const data = contract.methods.transfer(recipient, amount).encodeABI(); I get error : invalid ...
0
votes
2answers
46 views

Error: Invalid JSON RPC response: “” from web3

I run: geth --rinkeby --rpc --rpcport=8545 --rpcaddr=192.168.1.37 It works in console: geth attach http://192.168.1.37:8545 > eth.syncing false > eth.accounts ["...
0
votes
0answers
17 views

Trying to send ERC20 token with Javascript button without success

I am trying to send an ERC20 token with the following code via web3.js. It was working until a week ago and then it stopped. Am I doing something wrong? Upon clicking it no longer interacts with ...
0
votes
0answers
24 views

getPastEvents undefined(please help)

I had asked this question before. I looked carefully at the exchange section, which I advised, and I think there is no problem with the exchange section. At least in my opinion there is no problem and ...
1
vote
1answer
21 views

Creating a contract instance

Is it generally better to define a contract instance once, then pass it through your components like... class Parent extends React.Component{ constructor(props){ super(props); ...
0
votes
1answer
29 views

TypeError: market.FileViewed is not a function while trying to watch event

I want to watch for fileViewed event and it throws TypeError: market.FileViewed is not a function in marketplace.FileViewed{ ^ My solidity contract: pragma solidity ^0.5.0; contract ...
0
votes
0answers
14 views

cloning div container number of deployed child contracts time and put their data inside div container

Sorry for the silly question. I have a div container "product-card" , I want to loop the number of my deployed smart contracts time. every time when I loop I want to clone this div container and ...
0
votes
1answer
15 views

How can I change the text message on connection request window of metamask?

I want to change the message in connection request window using web3js. I have attached screenshot here. kindly check it.
0
votes
1answer
35 views

Parity Aura - Error: Transaction has been reverted by the EVM

I run the following code against two private blockchains, parity-aura and geth-clique. Why does the parity transaction revert and why does it use 6,000,000gas when it should actually only use about ...
0
votes
0answers
49 views

erc20 transfer SafeMath: subtraction overflow?

I am trying to transfer a erc20 token. const data = contract.methods.transfer(recipient, amount).encodeABI(); const rawTx = { from: sender, nonce: '0x' + count.toString(16), ...
0
votes
0answers
23 views

Ethereum payment processor Nodejs

I'm working on a web project where I need to have the ability to accept crypto payments. Implementing bitcoin was fairly easy as there were api's whom allowed me to directly subscribe to a specific ...
1
vote
2answers
30 views

How do i use .send() to fire methods of my smartcontract?

I have looked alot for information about this and lastly i turn myself to here. I've written a smartcontract and deployed it to Ropsten . I am then using web3.js to interact with my smartcontract, i ...
0
votes
1answer
16 views

Tokens are not being transferred with web3js

i have been using following code for transferring tokens from wallet to another with the use of web3js. async Transfer(eth_address, amount){ let tokenAddress = "...
0
votes
1answer
50 views

web3.js keeps throwing “error: insufficient funds for gas * price + value” on ropsten

I have been chacking around the site for possible solutions but i havent found any that would solve my (probably most basic) error. The account from which i'm sending has around 1 ether and i'm ...
0
votes
0answers
12 views

RSA signature verification: Inputs to Precompile contract

I am trying to verify an RSA signature using Ethereum smart contract. I have some doubts regarding my design. I am using the precompile at address 0X05 to generate s^e mod n, where s is the ...
0
votes
1answer
12 views

methods.myMethod.call not return value I wanted

I am attempt to get an address using methods.call(). And it's something error. JS var rcAddr = "0x683d1602fa7252d49cda8ac414c1641a56e73d03"; var methodName = "Access Control"; var register = new ...
0
votes
1answer
21 views

rpc error with payload and exception thrown in contract code

This is the problem I get when trying to run my contract! And then when I go ahead and run it, this pops up This is my js code: import React, { Component } from 'react'; import Web3 from 'web3'; ...
0
votes
1answer
19 views

Call functions from another account by default in web3

In my truffle tests, I am trying to call a function from an account other than the default account, so not accounts[0] from the below result. web3.eth.defaultAccount doesn't seem to work. web3.eth....
1
vote
0answers
31 views

How to get DAI using Web3.js

I'm building a Web3 app and I'm trying it out on the Kovan testnet. I'm trying to get some DAI. As far as I understand it the way to get DAI is to: Exchange ETH for WETH. Use Sai Tub contract to open ...
1
vote
1answer
33 views

Does using a very high gas limit somehow get your transactions executed slower?

I'm executing transactions on mainnet with a NodeJS script: async function send(web3, transaction, destAddr, gasPrice, privateKey) { const options = { data : transaction.encodeABI(), ...
0
votes
1answer
32 views

Proper way to save a public key as bytes in a contract

I need to save public keys in many contracts. Despite that this choice costs, I store them as bytes (I know that the best way is to split the key and store it to different bytes32 constants, but that ...
0
votes
0answers
39 views

Events using Infura websockets on rinkeby Web3 1.2.1. Returned values aren't valid, did it run Out of Gas?

I am trying to do a simple event listener with NodeJS and Web3 using an Infura endpoint. I have the correct project-id const Web3 = require('web3'); let web3 = new Web3( // Replace YOUR-PROJECT-ID ...
0
votes
2answers
45 views

app.vote(1, {from: web3.eth.accounts[0] }) not working

I am following a tutorial from Dapp University about building Election Smart Contract. When I run this command in the console: app.vote(1, {from: web3.eth.accounts[0] }) I get the following error: ...
0
votes
0answers
17 views

Approving tokens from original contract, how would you do it?

I need to create a general approval for a transferFrom function for an exchange or general contract if you will. I've tried many ways in solidity to reference the old contract, including using tx....
0
votes
0answers
11 views

How to Convert TransactionHash (SendETH) to Variable?

I have created a function to send Ethereum and it can run inside console.log. With a simple code call a function like this: var sendEth = sendMoney(data).then(hash => { console.log(hash....
1
vote
1answer
30 views

I have a huge ᴀʙɪ file in the ᴊꜱᴏɴ fomat but third party’s contract’s code is private. How to generate the list of function selectors?

I have an abi file with lot of functions for a large contract. It would really take a lot of time to generate by hand the hash of each functions/methods. Since the source code isn’t public, how to ...
0
votes
1answer
33 views

end process after web3 sendTransaction return transactionHash

I want to end the process after sendTransaction return transactionHash. Here is my code currently : const Web3 = require('web3'); const web3 = new Web3("http://127.0.0.1:8545"); async function task(...
0
votes
1answer
24 views

web3js later versions. Bundle, how?

I'm trying to build the frontend of a dApp, but the web3js makes my head hurt. I need to include it in my project, but the latest web3.min.js i can find is this. I want to use 1.2.1, and i understand ...
0
votes
1answer
24 views

Why Send Transaction is Error 'exceeds block gas limit'?

Why can't I send Ethereum with a code like this : const Web3 = require('web3') const provider = new Web3.providers.HttpProvider('https://provider') const web3 = new Web3(provider) const account = ...
0
votes
0answers
32 views

Cannot call contract?

ive been trying for days to create a contract and simply call a function on it. Just to learn. But i can for the love of god not figure out what im doing wrong. I got truffle and Ganache set up, and i ...
0
votes
1answer
45 views

Unable to install web3 on windows 10

This is the error I get when I try to install web3 on my machine. After installing git I have another issue: C:\Windows\system32> npm install web3 npm ERR! code ENOENT npm ERR! syscall spawn git ...
0
votes
2answers
20 views

validation of data integrity in block

I am learning ethreum dapps development and have developed some dapps. I was thinking about supply chain dapp which i think , is very good application of blockchain as it ensures all the history of a ...
0
votes
1answer
42 views

How can I unlock my account

I cannot unlock my account. I decrypted my account from encrypted accoun, and want to unlock it to deploy contract. However, I am getting this error, Node error: {"code":-32000,"message":"could ...
0
votes
0answers
5 views

Install Web3php In CodeIgniter?

Does anyone know of this error when I install and update web3php with the composer in codeigniter ? Image Here I tried installing it, but it came out like in the picture.
0
votes
1answer
53 views

Node error when I deployed smart contract - Web3.js

I get this error when I deployed smart contract to my private chain. Error: Node error: {"code":-32000,"message":"unknown account"} This is my web3.js code. const bytecode = "...
0
votes
0answers
29 views

How to transfer ERC20 token from one account to another account but paying the transaction fee from third account?

I want to transfer token from account A to account B by paying transaction fee from account C.I have tried the following logic but token transfer from contract to contract mean contract transfer token ...
2
votes
1answer
45 views

MetaMask and it's “speed up transaction feature” — no callback

I'm using MetaMask to make Ethereum transactions from my website, as described here: https://metamask.github.io/metamask-docs/Main_Concepts/Sending_Transactions It works perfectly. I capture the ...