Questions tagged [web3js]

Use this tag with questions about programming for the Ethereum JavaScript API.

Web3.js is open source and continuously updated since 2015. It has everything you need to start interacting with the Ethereum blockchain, giving easy access to accounts, events, smart contracts.

Useful links

2372 questions
0
votes
2 answers

How to listen or read past logs event transfer ETH on ERC-20 or (BNB on BSC chain) between two address?

I want to listen or get all events transfer native token on Ethereum or BSC networks. As follow transaction: https://testnet.bscscan.com//tx/0xe864d268189a0d1397e97f3f896738632c8bcd74d45219b21f7d718f5307a4b1 But I don't know how to setting:…
Tho Bui Ngoc
  • 763
  • 1
  • 11
  • 36
0
votes
1 answer

How can I disconnect Metamask wallet using web3.js

I want to disconnect metamask wallet using web3 or ether.js But I cannot find any function to disconnect programly.
Proteus
  • 3
  • 1
  • 3
0
votes
1 answer

React does not render when Metamask installed

I'm learning how to create web3 app with Metamask and react.js I used create-react-app and follow https://github.com/ChainSafe/web3.js#troubleshooting-and-known-issues to solve errors around polyfill. Then I followed…
n Z
  • 1
0
votes
1 answer

Not able to send ether to msg.sender from smart contract

This is the simple contract in which I am allowing user to open an account i.e smart contract acts as a account. I have kept an initial balance limit of 1 ether i.e user is bond to pay 1 ether at the time of opening of the account. Moreover, user…
Shamoon97
  • 332
  • 2
  • 12
0
votes
1 answer

MetaMask - RPC Error: execution reverted {code: -32000, message: 'execution reverted'}

I'm trying to develop a DApp using React and Solidity using an ERC20 contract, I've deployed my smart contract on Rinkeby and am able to interact with it using name() and symbol(), however, I cannot execute payable functions like transfer(), the…
KylianMbappe
  • 1,896
  • 2
  • 15
  • 25
0
votes
1 answer

How to convert a value too large for integers in JavaScript?

I am fairly new to this and please let me know if I am wrong in any point. I am trying to convert WEI into Eth, without using the Web3 library. const weiValue = 100000; const ethValue = ethers.utils.formatEther(weiValue);<--- answer is correct at…
0
votes
1 answer

Metamask not. called when I call the contract

I am new in Blockchain ethereum, I am trying to call a function in contract, using Ganache without Metamask it works. I am trying to test the contract in pre-production in Rinkeby through infura. I know this can be old API but I am not sure what I…
Steven
  • 762
  • 1
  • 10
  • 27
0
votes
1 answer

Uncaught ReferenceError: async is not defined at HTMLButtonElement.onclick

How to define async? I try to declare async = require('async') and no success. Then I try on terminal: npm install async --save and same thing without result. async function donate() { let options = { contractAddress: "0x..", …
0
votes
1 answer

ReactJS Error: Expected ';', '}' or

Error: This is the expression part of an expression statement cosnt sendTransaction = async ( I am using ReactJS and following a tutorial, but my code looks the same and can not figure out how to solve this error. This is my…
dustycar17
  • 27
  • 6
0
votes
1 answer

How do I delete hardhat:core:config so I can create a new sample project

I’ve been trying for hours, it won’t give me the options to create a sample project when I type “npx hardhat” I’ve tried 1. “Mkdir hello-smart” “Cd hello-smart” “Npm init” “Npm install hardhat” “Npx hardhat” And also tried npm init -y npm…
0
votes
0 answers

error An unexpected error occurred: "https://registry.yarnpkg.com/aria-query/-/aria-query-5.0.0.tgz: tunneling socket could not be establisherd, cause

can anyone can help me to fix this error i have tried many solutions from stackoverflow to fix this problem but nothing works the error is imagehere PS C:\Users\Nilay\Desktop\Twitter-Start> yarn yarn install v1.22.19 [1/4] Resolving…
user19282446
0
votes
0 answers

ReferenceError: process is not defined while trying mint in web3 in Reactjs

I am trying to develop NFT minting website. So in my App.js I have a button called connectWallet. const connectWallet = async () => { if (typeof window.ethereum !== 'undefined') { var web3 = new Web3(window.ethereum); const accounts =…
breking bed
  • 135
  • 2
  • 14
0
votes
1 answer

Receive information from events and register in a database

I try to listen to two events I have in smart contracts (one of them smart contract factory) that are related to each other and save the information I get in the dataBase. But once I have several users using a smart contract at the same time then…
0
votes
3 answers

How to run the Remix-project under the offline mode?

Recently I tried to run the Remix-project in local environment - offline status. https://github.com/ethereum/remix-project You can get the source code from this url. After pull down it, I have installed all of the npm modules in my pc, then I tried…
Top
  • 95
  • 4
0
votes
1 answer

Process 2 Ethereum Transactions with single Transaction

I'm using third party SDK method and completing the transaction successfully. I'm trying to do the same function twice within a single ETH transaction. It's impossible with SDK method. I tried to deploy my own smart contract by using this function,…
1 2 3
99
100