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
0 answers
4 views

Getting TypeError: unhashable type: 'list' when reading ABI json

Getting TypeError: unhashable type: 'list' when reading ABI json. Using Python 3.11 Can anybody help ? from web3 import Web3 import json abiStr = '[{"inputs":[],"stateMutability":&...
0 votes
0 answers
2 views

var web3 = new Nethereum.Web3.Web3(); Why does this not work?

It would seem that you can't get any more basic than this. But it does not work. It produces the error: 'Web3' does not contain a constructor that takes 0 arguments
  • 1
0 votes
0 answers
5 views

Web3.js metamask android contract function fails

const value = web3.utils.toWei(userBalance.toString()); const dETH = new web3.eth.Contract( dETH_ethAbi as any, config.goerli.addresses.dEth ); ...
  • 1
0 votes
0 answers
7 views

Price not showing in marketplace after minted from smart contract

We have created a fronted which require client to fill in name,description,price and attach an image. After mint, name, description and image able to display in Opensea created, but price not showing. ...
  • 105
0 votes
0 answers
10 views

Error connected to Blockchain

Most of the Nethereum samples provide the same simple way to connect: Using Nethereum.Web3; var web3 = new Web3("https://mainnet.infura.io"); However this results in the following error: ...
  • 1
0 votes
1 answer
21 views

Need help with solidity?

Hello everyone so Im building flashswap arbitrage program and I got stuck and cant figure out why maybe anyone has a solution : this is the code I have for solidity // SPDX-License-Identifier: ...
0 votes
2 answers
17 views

Truffle vs Hardhat vs Foundry and web3js vs ethersjs

I am relatively new to Web3 and Solidity . When writing smart contracts I usually get struck in which framework to use ... Truffle ( the most I've used so far ) , Hardhat ( just getting started ) and ...
0 votes
0 answers
5 views

how to get balance of token deployed on thirdweb into Next.js app

I'm getting this error: I don't know why balanceOf method not working. My code is: const balance = await token.balanceOf(walletAddress); console.log(balance.displayValue); I am taking reference from ...
0 votes
0 answers
9 views

Accessing the "accounts" variables of the local blockchain

here's the following code : const Vault = artifacts.require("Vault"); describe("Write features of vault", function (accounts) { it("able to receive money", async ...
0 votes
0 answers
13 views

Receiving Invalid Address on Web3

I am having issues launching my web3 connected to Solidity (on Remix) and MetaMask. The error that popped out was that I have an invalid address and they were referencing the function called ...
0 votes
1 answer
22 views

Finding size of a block number

Below is a simple programme which includes web3 :- let web3 = require('web3'); var real = new web3(web3.givenProvider) // web3.givenProvider is having value of my infura endpoint discuss(); ...
0 votes
1 answer
7 views

Is there any method in web3js library to know if a given address is a contract address or an wallet's account address?

I am writing solidity tests . I am using JS for testing . Is there any method in web3js library to know that a certain address is a contract's address or not ?
0 votes
0 answers
10 views

provider.on() method for listening to events by multiple wallet addresses

Currently, web3.js is able to listen for multiple addresses' logs by passing in an array on the . const wallets = ["0x031414134", "0x19351351", "0x130413515"]; ...
  • 13
1 vote
1 answer
19 views

How to transfer token to the smart-contract?

I've created the following mocked token: //SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract Dai is ERC20 { ...
  • 111
0 votes
1 answer
24 views

how to sign a batch of transaction with a private key in web3.js

I have created a batch of transactions with the help of web3.js. Firstly I am batching transactions with the "approve" method of the erc20 contract to approve a smart contract of the tokens ...
0 votes
1 answer
14 views

Object Promise message is displayed

const readData = async () => { const data = window.contract.methods.getName().call(); document.getElementById("dataArea").innerHTML = `Message is here: ${data}`; why am i ...
  • 52
0 votes
0 answers
6 views

use of operator contract in ZK rollups

i understood why 2 smart contracts are deployed in mainnet, but don't understood why an operator contract is deployed in layer 2 chain in ZK rollups. what does this smart contract do exactly ?
0 votes
0 answers
21 views

How can listen speed up/cancel event on transaction in my dapp?

i develop dapp using react and web3js. i figure out that if user click speed up function or cancel in metamask, my dapp doesnt know event. My dapp developed to track transaction hash user requested. ...
  • 5
0 votes
1 answer
24 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
13 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
16 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
26 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
32 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
17 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
15 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
50 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
19 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 ...
1 vote
0 answers
26 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
33 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
16 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
52 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
28 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
123 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
24 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
16 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
30 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
14 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
15 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
25 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 ...

1
2 3 4 5
120