Skip to main content

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
8 views

Error: invalid solidity type!: tuple

I have an error code while doing unit testing to a contract: Error: invalid solidity type!: tuple The line that throw the error is: const negotiation = await this.negotiations.allNegotiations("0&...
WP Smart Contracts's user avatar
0 votes
0 answers
8 views

Metamask - How to claim ownership of Unknown account

I tried to transfer a small amount of ETH from my Binance Web3 wallet to my Metamask wallet using the OPMainnet. Now, the transfer is successful, and has left my BinanceWeb3 wallet and shows ...
Minhal Hasan's user avatar
0 votes
0 answers
19 views

the execution reverted when I call a certain method from my ERC 721 smart contract using web3js

These are my methods for adding and retrieving of records from my smart contract: // Function to retrieve records of a patient function getRecords(address patientAddress) public view returns(Record[] ...
My name is's user avatar
0 votes
0 answers
28 views

Returned error: insufficient funds for gas * price + value (overshot)

I'm trying to automate the calculation of gas based on the balance, set the required gas and send the remaining balance. Am I misunderstanding something? // send all const amount = balance.weiBalance -...
Jayson H's user avatar
  • 101
0 votes
1 answer
19 views

Why transaction with higher gas priority fee executes later than with lower priority fee?

I have found 2 transactions, the first one is has position 1 in block and another one has position 53 in the same block, although the second transaction has more fee to pay for gas and more priority ...
sirjay's user avatar
  • 133
1 vote
1 answer
29 views

How to know why Uniswap cancelled my transaction?

I am not pro, but can someone check please why my transaction was cancelled on Ethereum after sending to Swap token on Uniswap v2? https://etherscan.io/tx/...
sirjay's user avatar
  • 133
0 votes
0 answers
19 views

TransactionRevertInstructionError: Transaction has been reverted by the EVM

I am now trying to use addLiquidity with Uniswap V2 on sepolia testnet. I am using web3.js in truffle, but there are some areas where errors keep occurring. I have posted only the necessary code here. ...
songyujin's user avatar
0 votes
0 answers
8 views

Error handling while fetching account from useWeb3React() hook of '@web3-react/core'

I'm fetching account from useWeb3React() hook and want to detect if there is any error while fetching the value to initiate further operations. How to do it?
soumyadeep.eth's user avatar
0 votes
0 answers
14 views

when trying to access the contract from the browser, it says the listener argument must be of type function. received type object

TypeError: The "listener" argument must be of type Function. Received type object     at checkListener (events.js:72:1)     at _addListener (events.js:169:1)     at module.exports....
Nahla El-Araby's user avatar
0 votes
0 answers
36 views

web3.js wrong EIP-1559 transaction

I am currently working on a function (for educational purposes) that signs a hex message, extracts the signatures and create a signed transaction, but every time I add the signature, the from address ...
Adebayo Anuoluwa's user avatar
0 votes
0 answers
26 views

Why does my from address changes when signing an eth_sign transaction

I need help with something. I am trying to create a transaction, sign it, and send the transaction with web3, but every time it gets signed, the from address changes to a random address. After much ...
Zurik Dev's user avatar
0 votes
1 answer
17 views

Metamask transaction error

getting MetaMask - RPC Error: Function object could not be cloned. DOMException: Function object could not be cloned. after signing the transaction This is how i am signing the transaction this....
ashish0411's user avatar
0 votes
0 answers
13 views

Uniswap router V3 exactOutputSingle failing without proper error

I need to make a swap with Javascript web3.js and uniswap V3 router (for testing I use BSC) Here my code import Web3 from 'web3'; import config from './components/config.js'; import BigNumber from '...
Skinsky Gnudy's user avatar
0 votes
0 answers
15 views

List of the escrow dapps

guys. Could you please suggest the most verified and battle-tested escrow services? I can find plenty of them on the internet, but I don't really know which one to use.
AGJoYy's user avatar
  • 426
0 votes
0 answers
18 views

estimated balance changes web3js?

how to make it via web3js so that it shows as in metamask estimated balance changes?
Алексей Болгов's user avatar
0 votes
0 answers
42 views

how connect solana to web3modal

I have been using the Web3 Modal to connect my Metamask and Trust Wallet for a while now in the Ethereum and Seoplia chain network but I recently thought of connecting Solana into the available ...
Adebayo Anuoluwa's user avatar
0 votes
0 answers
23 views

How to solve Delay while calling contract method

I have a contract which has a trigger button and am calling that trigger on every 30 seconds so what i need is instant change in the contract as i have conditions to match and it is basically a time ...
Roy's user avatar
  • 1
0 votes
1 answer
17 views

Getting an error While uploading image folder on pinata using pinFromFS function in nodejs

I am uploading approx 2.3 GBi of folder to pinata using pinFromFS() now i am getting error given below: Error: write EPROTO at afterWriteDispatched (node:internal/stream_base_commons:160:15) ...
Rahul Pithadia's user avatar
1 vote
1 answer
52 views

TESTS FOR MY ERC20 TOKEN IS NOT WORKING

// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/...
Kwesili Okafor's user avatar
1 vote
1 answer
127 views

How to customize Web3Modal wallet menu?

I want to use WalletConnect in my web-based dapp using Javascript. So I used Web3Modal to ask me the proper wallet to connect to. I want it to show this menu: I used this code to connect the proper ...
Alireza Zojaji's user avatar
0 votes
1 answer
20 views

Cant get the react navigation correctly in DAPP

I am building this dApp where I am rendering on different components based on Connected Accounts from MetaMask . When I render on /applicant page , I can't navigate through the /applicant page links ...
Shorna's user avatar
  • 17
0 votes
1 answer
36 views

Want to redirect to react component based on metamask address

I'm building an Identification management dApp, in which I have to redirect to a different component based on selected MetaMask account address. For example, if I'm an applicant then I will be ...
Shorna's user avatar
  • 17
0 votes
0 answers
8 views

Need Assistance Resolving ds-math-underflow Error in Liquidity Pool Transaction

I'm currently facing an issue while trying to lock my share of the liquidity pool on the blockchain. Despite successful tests in a Hardhat environment, the transaction is reverted when executed on the ...
Yazan Ali's user avatar
1 vote
2 answers
30 views

web3.js Keccak256 giving different answer

Minimum reproducible example : hash1 = "be516d52220ea58966754101dd7ee25be73a695febd2bca54145681e2cc72fe9" hash2 = "edede15ad23aba32fd2613ffee105278e322b2d81314bcb66eb4c453ad072bd4" ...
shadow's user avatar
  • 23
0 votes
1 answer
129 views

TypeError: Do not know how to serialize a BigInt in event listener response

I am trying to convert the response I have obtained into the event subscription. I get an object but when I want to transform it I get an error. Is there any function in web3js that transforms BigInt ...
UnexpectedCharacter's user avatar
1 vote
0 answers
23 views

Web3.js returning out-of-gas on local node with high --rpc.gascap

I have a local Fantom API node (lachesis) that I start with a really high --rpc.gascap (over 5 billion), which should not be hit in theory. However, when I make an eth_call using Web3.js, it always ...
tim's user avatar
  • 21
0 votes
1 answer
20 views

Is there Uniswap V2/V3 function to get initial token supply amount in pool?

I need to get initial token supply when liquidity pool was created by querying Ethereum node (RPC) or Uniswap contract and not Mint() function, is it possible to do (python)? To get reserves on any ...
sirjay's user avatar
  • 133
0 votes
1 answer
14 views

Getting this error "Web3.providers.HttpProvider is not a constructor"

const provider=new Web3.providers.HttpProvider("https://eth-sepolia.g.alchemy.com/v2/XB5meeKTzn4rqhq0KyhkwS11mpP7mki1"); ^ TypeError: Web3.providers.HttpProvider is not a ...
Siddhu from Srikakulam's user avatar
0 votes
1 answer
22 views

GetBalance faster method and tokens/nft balance

Hello to the whole community! I have a question about the getBalance function. given the same node characteristics, if I were to send the getbalance request for 10000 wallets, is the ethers.js or web3....
Die84albe's user avatar
0 votes
0 answers
24 views

Cannot get transactions returned by w3.eth.filter("pending")

I have code listening at testnet node and getting pending transactions returned by filter. It works well, usually, but sometimes filter returns id (or batch of ids) of non existent transactions. Or ...
Jaroslav Kameník's user avatar
0 votes
1 answer
10 views

What search filter value use to find hexadecimal indexed events logs?

I am trying to retrieve logs per topic, but I am having trouble retrieving the values. I have the following event defined in the SC: event Log( uint256 indexed dHash, uint256 timestamp ); ...
UnexpectedCharacter's user avatar
0 votes
0 answers
15 views

Most decentralized and secure ways of listening to events for multiple wallets

The most common for listening to events emitted by multiple smart contracts seems to be by using a JSON-RPC wrapper such as ethers or web3js. Let the contracts be ERC-721. If our contract emits an ...
root's user avatar
  • 11
0 votes
0 answers
29 views

Cant see array values inside struct when I returned

/******************** STRUCT ********************/ struct TwentyOneContest { address creator; uint256 rank; uint256 enterPrice; uint256 collectedPrice; ...
seojunchian's user avatar
0 votes
0 answers
5 views

Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract)

I am getting the error: Line: 49 in TransactionsContract.sol Member "transactionCount" not found or not visible after argument-dependent lookup in type(contract TransactionsContract). even ...
Aditya Khare's user avatar
0 votes
0 answers
14 views

Public mint but merkle proof exists

I want to programmatically mint this Base Mainnet NFT: NFT Base Scan code The mint is open to everyone, but when I decode my transaction: TX Link, I can see that there still exits merkle proof that is ...
duyanhhz's user avatar
1 vote
1 answer
34 views

Seeking DApps that use personal_sign, eth_signTypedData, and eth_signTypedData_v3 with ERC-1271 signature validation

I am currently working on a wallet and encountering challenges with testing signature verification locally. When using viem's verifyTypedData/verifyMessage methods in a local environment, I'm only ...
cmptrwizard's user avatar
1 vote
0 answers
17 views

Address passed to thirdweb is not getting passed correctly

I'm building a smart wallet that is ERC 4337 compatible, for that I'm using the thirdweb accountfactory contract. Now when creating a smart wallet I'm passing the address of the account factory ...
Rohit Jambhulkar's user avatar
1 vote
1 answer
21 views

Can't catch Web3.js' contract error when calling a method and cancelling the transaction

I have a very simple React app that calls a Solidity smart contract's method using Web3.js (4.3.2) with some data coming from a form. I'm trying to catch errors while calling the contract method or ...
Danziger's user avatar
  • 131
0 votes
2 answers
16 views

reserve0/reserve1 price is different compared to boughtTokensAmount/requiredWeiAmount

I would start with a sample on exact UniswapV2 pair SHIB/WETH (SushiSwap). I use local hardhat node and there's no possibility of 3-rd party effect on LP. I have this toSwapTokensAmount = ...
dvcr's user avatar
  • 3
0 votes
0 answers
17 views

Uncaught ReferenceError: handleRegistration is not defined at HTMLButtonElement.onclick

I have created and deployed a smart contract for IP management using truffle. I have created a frontend to interact with this deployed contract. <head> <meta charset="UTF-8"> ...
Yash R. Khandelwal's user avatar
0 votes
0 answers
35 views

Transaction revert in uniswap universal router

I want to sell token using universal router on Base network but transaction is getting reverted. Can anyone solve this? CODE require('dotenv').config(); const Web3 = require('web3'); const routerABI = ...
shakil khan's user avatar
0 votes
1 answer
16 views

How to check IP address and proxy performance

How to check that the proxy is working and the transaction goes through it. Because it also passes with the wrong proxy const { JsonRpcProvider, FetchRequest } = require('ethers'); const { ...
Jmk's user avatar
  • 1
0 votes
0 answers
22 views

Building dApp To Allow Users to Customize and Deploy Tokens

I have been stuck for quite awhile and cant get past it. I've found some gits of old projects with similar concepts, but none have the features platforms like some I've seen lately, such as: [...
DevJimmy's user avatar
0 votes
1 answer
17 views

How to copy this transaction, change the parmeters and send again?

I need to copy this transaction: https://etherscan.io/tx/0x9acf0ecfd6f5a320a419ad8b155208d25f666e228b955d6df7109c84f46f7425 After that, change the recipient address and the NFT ID and send again. I ...
Udbdjfj's user avatar
0 votes
1 answer
42 views

How to accessing Smart Contract write function from the frontend (React Js ) without any private key?

Currently, when I try to write a function on Solidity Smart Contract from ReactJS, it is not working and throws an error called "unknown account." for the below code. await contractMethods....
AIT DEV's user avatar
  • 15
0 votes
1 answer
72 views

Bytes validation error while transferring ERC20 tokens while using ethereumjs/tx

I am trying to send an ERC20 token using ethereumjs, but I am getting a bytes validation error: Web3ValidatorError: Web3 validator found 1 error[s]: value "0x2,248,191,131,170,54,167,20,138,49,48,...
Shikhar Dubey's user avatar
0 votes
1 answer
31 views

how to verify contracts in contract (created with contract ) polygon

i have a following structure for my contracts : 1 - OpenZeppelin v 4.9 2 - safepool 3 - safepoolfactory i have a single file that this code : pragma solidity ^0.8.0; import "https://github.com/...
Hosein In jast's user avatar
0 votes
0 answers
20 views

Ethereum instance not intiialized - call Ethereum.factory first

I am using @metamask/sdk-react in a react project. Below is the code: import { MetaMaskProvider } from '@metamask/sdk-react'; <MetaMaskProvider debug={true} sdkOptions={{ ...
Joey Yi Zhao's user avatar
0 votes
1 answer
38 views

web3.js code works on chrome + metamask but dosent work on metamask mobile

i have a few codes that works fine on chrome desktop but dosent work with metamask mobile im using web3.js 1.2.7 here is code for connecting to wallet : import Web3 from 'web3'; var web3 = new Web3(...
Hosein In jast's user avatar
0 votes
0 answers
27 views

SeatMap.js:21 Error fetching seats: Error: no matching fragment (operation="fragment", info={ "args": [ null ], "key": "seatsTaken" },

I have been try to see the values in my array from a function i created with solidity in my APP.js: mapping(uint256 => uint256[]) public seatsTaken; function getSeatsTaken(uint256 _matchID) public ...
jesse bonsu's user avatar

1
2 3 4 5
124