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
1 answer
15 views

What is the best way to store the private key to sign transactions on web3js

So I have a web3js script(bot), something along these lines: let walletAddress = "" let pvtKey = "" signed = await web3.eth.accounts.signTransaction(txObject, pvtKey); What is ...
0 votes
0 answers
9 views

why this call is not working?

I can interact with the smart contract but I can not read a avariable value .In this piece of code the withdrawToken() function is working but when I try to get the value of totalTokensSold variable ...
0 votes
1 answer
8 views

the method eth_blockNumber does not exist/is not available

Hello hope are good ? I have my own full node with a ssh tunnel My code is : async function test (){ const url = 'ws://localhost:8546'; const web3 = new Web3(new Web3.providers.WebsocketProvider(...
0 votes
2 answers
24 views

Web3.js Integration not working

Below is the simple programme which I wrote to use EVM compatible functions in VS code. let web3 = require('web3'); const tr = new web3(web3.givenProvider || "ws://localhost:8545"); // ...
  • 33
0 votes
3 answers
29 views

Error: connection not open on send() when trying to connect NodeJs to my Private Geth Node

hope all are good ? I have a pb with my FULL NODE i can't connect it with my nodeJs files I can use my node if file's url is localhost:8546, i'm able to run my script from my server only but i want ...
0 votes
0 answers
14 views

Private Ethereum Blockchain Connection with AWS (PoA consensus)

Is it possible to connect a private Ethereum blockchain with AWS? An alternative to Amazon Managed Blockchain (which forces me to use Hyperledger) and amazon EC2, is there?? Also, how can I implement ...
  • 11
0 votes
0 answers
8 views

I get an error whenever i install web3uikit on my react app

i get this error whenever i install the web3uikit. can anyone help?
0 votes
2 answers
28 views

How do you save an account balance to a variable in web3.js?

I am trying to get an account balance into a variable in web3.js. I don't want it in a function, just stored as a variable. This is the equivalent code I have in web3.py, which is what I want it to do:...
0 votes
2 answers
20 views

How get the mint price from contract and max supply not total supply

I wanted to get the Mint price from nft i tried getting it from abi but it's not effective since different contracts has different names for it so how can i find the set mint price from contract in ...
0 votes
0 answers
11 views

What is ethereum.request and how can define or replace ethereum to make the HTML file running?

This is the html that creates a website where you write messages on the goerli testnetwork via smart contract. Metamask does not pop up and I get a response back shown in the pictures. <!DOCTYPE ...
0 votes
1 answer
14 views

How do i prevent further burn once the minimum total supply of my token has been reached?

I have successfully created my token and I have an automatic burn fee but I would like the burn fee to be automatically set to 0 once the minimum total supply has been reached and also prevent any ...
1 vote
2 answers
43 views

How does etherscan get such data?

I need to select special transactions like these: That is, a sale transaction, with a certain price (0 ether, as here). As a result of the work carried out, I can determine which nft from which ...
0 votes
1 answer
17 views

Provided address undefined is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted

I'm building a Dapp and when i im click the mint button i get this error Error: Provided address undefined is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which ...
0 votes
0 answers
20 views

web3.eth.subscribe not working properly

import Web3 from "web3"; const web3 = new Web3( new Web3.providers.WebsocketProvider("url") ); const addr = web3.utils.toChecksumAddress("...
0 votes
0 answers
32 views

Web3.js event listener keeps reconnecting

I have a websocket set up listening to an event of a particular contract. However, I have noticed that the .on('connect') event keeps getting triggered intermittently leading me to believe that I am ...
0 votes
0 answers
14 views

Can not view my listed NFTS on my NFT Marketplace frontend

I followed alchemy road to web3 tutorial on NFT market place. After listing the NFTs and then go to the market place to view my listed NFTs I get a has been blocked by CORS policy error. I used "...
0 votes
1 answer
42 views

Getting an error of : "TypeError: Cannot read properties of undefined (reading 'provider')"

I am getting this error TypeError: Cannot read properties of undefined (reading 'provider') Here is my code for buy-coffee.js inside of scripts. // We require the Hardhat Runtime Environment ...
0 votes
0 answers
30 views

Integrating ML with blockchain

I am currently doing a blockchain project on fake news detection. I have created all the smart contract part and frontend for the app. Now I want to use ML to detect fake news which is stored in ...
0 votes
1 answer
22 views

How to send BNB to multiple address without using for loop

I need to send BNB or BSC tokens to multiple addresses. I saw some answers but they are used for loop. I can't use a loop because it takes a lot of time and the server is not responding. Is there any ...
0 votes
0 answers
36 views

web3.js verify the success of the token transfer in mass transfer transaction

I've deployed smart contract: // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event ...
  • 101
-2 votes
0 answers
8 views

Starting to Learn blockchain development [duplicate]

I am a BSIT student learning blockchain development. Have any tips on how to do it? Thanks
0 votes
1 answer
15 views

When can one use web3.eth.abi.encodeFunctionSignature() and web3.eth.abi.encodeFunctionCall()?

Does the smart contract containing the function to be encoded have to be deployed first before one can use web3.eth.abi.encodeFunctionSignature() and web3.eth.abi.encodeFunctionCall() for a certain ...
1 vote
1 answer
20 views

How can I query the transaction number of a liquidity pool in PancakeSwap?

I want to query the transaction numbers of the liquidity pools of PancakeSwap and so that decide which 10000 of them are the most active ones (there are 1.2M). How can I do this using Ethers.js or ...
  • 11
1 vote
2 answers
122 views

Transaction Error: Error: non-payable method cannot override value

I Designed a quiz app which simply withdraws the amount earned by user after playing the game from the smart contract.But Each time i click on the withdraw button to call the withdraw function on my ...
1 vote
1 answer
21 views

Does delegatecall also works for calling other contract's constructor?

I want to call other contract's constructor, but I'm not sure if the delegatecall function will work for that case. I have no way to test it out on Remix, because my Remix seem to not work with even ...
  • 21
0 votes
2 answers
15 views

How to send ETH to other accounts without signing

I am creating a dapp. When a user sends 1 ether to the owner account then the owner should send 2 ether to the account which sent 1 ether using web3js. How can I achieve this?
0 votes
1 answer
25 views

Transferring ETH to a account

Recently I was writing a smart contract to transfer ETH from a account to another account. My code should transfer 100000000000 gwei but while transacting metamask pop-up shows the required amount as ...
0 votes
1 answer
29 views

Invalid opcode OR Cannot read properties of undefined (reading 'length') (depending on the situation)

I'm working on a bot that loads in a bunch of values from an array and uses an event handler to take action upon an event. This was originally built as a bot to monitor a swap on two exchanges for a ...
0 votes
1 answer
13 views

Balance too low to burn | Reason

I am running an Ethereum burning script on arbitrum. I got this error mostly. Meanwhile, The script is required to burn the whole balance. Balance too low to burn (balance=0.00024506291612428 gasPrice=...
0 votes
0 answers
14 views

How to programmatically get a list of current stakers, their delegates, and the amount of ETH staked?

🙏 I'm coming from mostly Substrate background, so apologies if I'm missing something obvious. 🙏 Since Ethereum is now proof-of-stake, I'd like to know who has staked in the network, and how much. ...
  • 1
0 votes
0 answers
15 views

What projects to land a job as a solidity dev? [duplicate]

Hey yo, I'm a C and Javascript self-taught dude, what's the best projects you could advise me to do for getting a job in solidity ?
0 votes
1 answer
23 views

-32000 Execution Reverted - Simple AAVE Price Oracle request

I'm currently in the early stages of learning solidity and diving into the blockchain world; I do have prior programming experience. I'm currently stumped on something that seems rather trivial, but ...
0 votes
0 answers
21 views

Why is my buyTokens function recieving a Metamask RPC error?

I have been working through a tutorial to learn more about blockchain development. In the tutorial , we develop an ERC-20 token and deploy it to a test network. We then run an ICO using another ...
  • 21
0 votes
1 answer
24 views

Can I subscribe to a 'logs' event notifying the transaction is done with web3.js?

I'm using web3.js library to subscribe to ERC20 token transfer events on a blockchain: const logOptions = { // Filter transfer topics topics: [ web3.utils.sha3('Transfer(address,address,...
  • 101
0 votes
1 answer
19 views

I am not able to change my Metamask account due to 3 lines of code in the below App.js code from line 25-27

Whenever I am compiling my code using the line 25-27 then I am not able to change my metamask account. The 3 lines have been highlighted below. const realEstate = new ethers.Contract(config[network....
0 votes
0 answers
19 views

Error: call revert exception (method="getTotWaves()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION,)

when i click "Wave at me" button i encounter with this call revert error!. here is the App.js import React, { useEffect, useState } from "react"; import { ethers } from "...
0 votes
1 answer
48 views

Ethernaut Level 24 - Puzzle Wallet

I'm following the tutorial here: https://blog.dixitaditya.com/ethernaut-level-24-puzzle-wallet // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import ".....
0 votes
0 answers
44 views

Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]"

Please help I'm getting this error when accessing fetchItemsListed() and fetchMyNFTs() Github repo link: https://github.com/YasinduNethmina/nft-marketplace In addition when I try to create an nft this ...
0 votes
1 answer
22 views

Can I make a Dapp in react that doesn't uses metamask at all?

I want to build a Dapp in which I don't want to use the metamask wallet. There is a central ethereum address that I have and when any one calls the function that intracts with the blockchain I want ...
0 votes
1 answer
22 views

How can i listening or monitoring pending Smart Contract function or events?

Hello everybody hope all are good ? i need your help .. Note i already know how we can monitoring mempool but i'm talking about function of smart contract... As mempool with pending Tx, i want make ...
1 vote
0 answers
25 views

network ID error while deploying a truffle project to ganache cli. how do i resolve it

when I deploy my truffle project to ganache I get the error, network id are not the same. and when I checked the network id on ganache and truffle, i changed the network id of truffle to match that of ...
  • 11
0 votes
1 answer
21 views

Where are the transactions in the genesis block?

When I query the genesis block I get this: AttributeDict({'difficulty': 17179869184, 'extraData': HexBytes('0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa'), 'gasLimit': 5000, '...
  • 57
0 votes
0 answers
16 views

Do Uniswap V3 SDK integrates and works with Vuejs?

We are building a web app that allows users to provide liquidity into uniswap pools and exchange between currencies from the webapp's front end. For this I was using AlphaRouterfrom Uniswap but ...
1 vote
1 answer
23 views

Get the entire contents of an ethereum block with the fewest queries?

Currently to get all of the transactions in a block I pull the block with: web3.eth.getBlock(blockNumber) and then I query every transaction in that block: for t in block['transactions]: tx = web3....
  • 57
0 votes
0 answers
26 views

How to retrieve pending ERC20 balance rewards from a contract?

Let's say we have an LP position on Curve.fi, with pending rewards in various tokens. How would one go about querying the pool / contract to get the balance of pending rewards? My current setup is ...
0 votes
1 answer
36 views

I can't transfer web3js forward contract (USDT)

I am trying to write rpc api via web3 with nodejs. I made ETH transfers somehow, but I couldn't make contract (USDT) transfers in particular. web3 : I am using version 1.8.1. Can you send sample code? ...
0 votes
1 answer
23 views

How can I get message from an Ethereum transaction?

I send a message from contract to an EOA by this Solidity code: function sendByte(address EOA, bytes memory byteData) external{ EOA.call("0x416c6972657a61204b69616b6f6a6f757269"); ...
  • 471
0 votes
2 answers
88 views

How to use getReserves() in a forEach loop?

How can I use getReserves inside a forEach loop to call the reserves relative to each array object (the array objects are token addresses)? Details below: I have an array of addresses being monitored ...
0 votes
0 answers
23 views

How to connect to Goerli console on Geth?

I'm in the attempt of simply connecting Geth to the Goerli testnet and and being able to use the web3 library in the console on the testnet. I tried opening a Goerli instance in Geth and then ...
  • 21
0 votes
1 answer
21 views

how to write a ERC1155 smartcontract to sell nft?

I trying to write a ERC1155 smart contract, where you can sell the nft for someone for a certain eth or wei, and receive that eth or wei in my address. help me with some examples. thanks in advance :)

1
2 3 4 5
120