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
-1 votes
1 answer
11 views

All my Assert.isTrue testing seems to be passing, im a bit skeptical about how efficient it's to test with asert.isTrue and assert.isFalse [closed]

Is Assert.isTrue efficient for testing solidity functions, all my testing are passing and I'm a bit skeptical about its efficiency.
Santos's user avatar
  • 17
1 vote
0 answers
74 views

ECDSA wrong signature

I am facing a problem with my NFT Marketplace contract. I have LibOrder , LibOrderValidator and Marketplace contracts. When I want to create an order, I need to get a signature and I get a ...
0x.MRX's user avatar
  • 11
0 votes
0 answers
30 views

How to split eth_senduseroperation method by eth_sendRawTransaction method

I want to take the parameters out of the eth_Senduseroperation method to generate the data value, use the eth_RawTransaction method to generate the rawTransaction value, and finally send it up the ...
stan's user avatar
  • 1
1 vote
1 answer
27 views

Call sendSignedTransaction without waiting for result (execute in background)

My Vue.js code with web3.js: function dreamOn() { await web3.eth.sendSignedTransaction(txFin); return; } I want to send this transaction, but I don't want to wait for the result of ...
user125754's user avatar
0 votes
2 answers
106 views

Get multiple ETH transactions

I'm a little new to Web3, and in NodeJS I'm trying to create a deposit-aware system. Today I'm doing the following: ETH Transactions: Get it through getBlock, and check whether the "to" of ...
Alison Silva's user avatar
1 vote
0 answers
109 views

#Wagmi: TypeError: x.replace is not a function after migration from 0.X to 1.X.X

Same code I didn't change a thing. Only a few things in wagconfig to make the migration but the rest should work. I have this error using: const { config, error } = usePrepareContractWrite({...data}) ...
Mentasuave01's user avatar
0 votes
2 answers
18 views

What are the standard solutions to enable new users to interact with a DApp contract for free without gas fees?

I'm developing a decentralized application (Dapp) where new users receive a free NFT upon registration. I want to allow these users to list their NFTs for sale without requiring them to have any ...
kat N's user avatar
  • 1
0 votes
1 answer
29 views

Problem with access private uint in a contract

I want to access a private data in a smart contract, I know that it is located in the second slot, and I use this code : await web3.eth.getStorageAt('0xeB51Bceb2F930aC619815E96FfB8E57C84Fb67Cd' , 1) ...
Mehran Ra's user avatar
  • 481
1 vote
1 answer
25 views

Web3 game backend developement

I'm seeking guidance on the best technologies to employ for a modern web3 application, encompassing both the frontend and backend components. On the frontend side, the landscape seems more ...
Kogelet's user avatar
  • 176
0 votes
1 answer
71 views

Force to send transaction ignoring failing status web3js 4.x.x

I have upgraded to web3 4.x.x, but I can not force to send a transaction ignoring its status cuz I have a batch of transactions and I need to broadcast all, thanks in advance. let txRaw = "...&...
mmo2112's user avatar
  • 27
0 votes
1 answer
20 views

How can I retrieve the latest locked token from the Ethereum blockchain using JavaScript without knowing Solidity?

I'm a JavaScript developer with limited knowledge of Solidity, and I need to retrieve information about the latest locked token from the Ethereum blockchain. I want to accomplish this task using ...
Ghassane Aboughazaouat's user avatar
1 vote
0 answers
22 views

How to anticipate a new React protocol to block Javascript URLs as a Security precaution

Many Web3 dapps have a feature where sending a blockchain transaction conveniently triggers a pop-up link where one can simply click and see that transaction on a blockchain explorer. For example, you ...
Eric Falkenstein's user avatar
0 votes
1 answer
380 views

Coinbase / Web3 - how are they connected? Where is my balance on Web3

I am brand new. I created a Coinbase Account and started investing. I heard someone say something about web3. I don't know what this is, but I think i have money in there. As I'm still waiting to be ...
TheBlackSheep's user avatar
1 vote
0 answers
20 views

Using eth.subscribe() with Web3.js isnt returning any result

const { Web3 } = require('web3'); // Replace with your Infura project ID const API_KEY = ''" const web3 = new Web3(new Web3.providers.WebsocketProvider(`wss://mainnet.infura.io/ws/v3/${API_KEY}`)...
dotheM's user avatar
  • 11
1 vote
1 answer
126 views

Use the swapExactETHForTokensSupportingFeeOnTransferTokens method of uniswap routerV2 to purchase uniswap V3pair tokens

const buyToken = async (account: any, tokenContract: any, gasLimit: any, gasPrice: any) => { let amountOutMin = 0; const amountIn = ethers.utils.parseUnits(useBuy.value.toString(), 'ether'); ...
lawrence Alan's user avatar
2 votes
0 answers
19 views

What is the best way to make a chart like this? (historical balance of a certain address)

I wonder how to make a chart like this. It shows the historical balance of specific tokens. It shows total net worth in $. It should be on the Polygon chain. I've been looking through 3rd party ...
JoyfulJoyce's user avatar
0 votes
2 answers
123 views

Multiple transactions in one block

There are three wallets A, B, C, wallet B is empty, I send one ether from wallet A to wallet B, and I want to send 1 ether from wallet B to wallet C in the same block, how can I implement this? I know ...
DinoU's user avatar
  • 1
1 vote
1 answer
55 views

Fail to send erc20 on metamask - BEP-20 Token Transfer Error (Unable to locate corresponding Transfer Event Logs)

i have been using my 1st testnet token for 2 months+, all works great, but suddenly in mid August error as per title starts popping up. So now i cant send this token using metamask to other wallet. ...
adi farhan's user avatar
1 vote
0 answers
70 views

Web3Modal.connect() is not a function

I am getting this error in react while using web3modal v2 library..When i click mint button it says that web3modal.connect() is not a function...can anyone help me solve this problem function App() { ...
Umar's user avatar
  • 23
0 votes
1 answer
75 views

In the goerli test network, the USDC token contract address of aavev3 loan is different from the USDC address of uniswapv3

I would like to ask, how to deal with the same token name but different token contract addresses during the aavev3 flash loan exchange. In the goerli test network, USDC has many token contracts, but I ...
bai li's user avatar
  • 1
2 votes
2 answers
29 views

I'm a newbie and want to learn web3, where to start? [duplicate]

i have a desire to learn coding, programming and web3 website building. i've been searching for a while and got to many resources but i don't know where to start. if someone can guide me to the right ...
CharbsHub's user avatar
1 vote
1 answer
68 views

Encode an integer to a uint256 to call a function

I have the following task. I have a contract, which I don't have the source code for, so what I have is the contract's function selector: 0xddc24be3. The function accepts a uint256 as an argument. ...
iliev951's user avatar
1 vote
0 answers
84 views

How do I solve error 'missing revert data in call exception'?

I'm trying to withdraw donations from a single campaign. When I click the withdraw button it loads then reverts with the error; Error occurred while withdrawing funds Error: ╔═══════════════════╗ ║ ...
kihiuFrank's user avatar
0 votes
0 answers
24 views

Ethernaut Challenge: GateKeeper Three | Is it possible to solve this challenge using proxy?

I read online and understand the solution to this challenge. I decided to experiment and solve this challenge using a proxy instead. As per my understanding of proxies and delegate call, the following ...
Shubham Sharma's user avatar
0 votes
0 answers
37 views

Error when Importing Web3 in React: Module not found for './formats' and

I'm encountering an issue while trying to import the Web3 library in a React project. The error message I'm receiving is: Module not found: Error: Can't resolve './formats' in '/Users/kaustubhsharma/...
kaustubh sharma's user avatar
0 votes
0 answers
28 views

Connect & interact with dApp without wallet connection

I have a question regarding the issues I am facing on my current project. I am building NFT marketplace on the Polygon network. The specific requirement is we should allow the users can interact with ...
legendary's user avatar
1 vote
1 answer
47 views

Smart Contract Working in Remix Testnet but Reverting Transactions in DApp with Metamask

Question: I'm encountering a perplexing issue with my smart contract that's causing transactions to be reverted when interacting with it through a DApp using web3.js and Metamask. Strangely, the same ...
adi farhan's user avatar
1 vote
2 answers
88 views

Why i get evm revert error when calling the method from dapp front end (web3js & metamask)??? but my contract works fine on remix and bscscan

I've created a smartcontract & deployed on bsc testnet. For the past 8 weeks, i have been upgrading and testing the contract on remix and website and they always works fine. I can mint on remix ...
adi farhan's user avatar
1 vote
1 answer
59 views

How to obtain priority gas price in ETH with web3 version > 1.x.x?

I previously used the getFeeHistory method with web3js version 1.x.x to obtain priority gas prices. After updating to versions 3.x.x or 4.x.x, I noticed this method is no longer available, with only ...
Ruhsey Ruha's user avatar
0 votes
2 answers
87 views

How Can I Identify the Blockchain Where a Smart Contract Is Deployed Using Its Address?

I am trying to identify the specific blockchain where a smart contract has been deployed using its deployment address. However, I am unable to find a clear source or method for doing so. When I looked ...
Faisal Hussain's user avatar
1 vote
1 answer
164 views

How to get correct liquidity amount on UniswapV3 for each token(pair) via web3.js?

I'm trying to create a bot that will send me new LPS notifications on Uniswap V3 and in the future more dexes. I want to contain in the message specific data like amount of token and ETH in the pool, ...
RasmonT's user avatar
  • 131
0 votes
1 answer
17 views

How do I update a campaign without it creating a new campaign?

I'm working on the update campaign feature in a project. First Issue - Prefilling the form fields I want first to prefill the form fields then from there, a user can change what they want. In the /...
kihiuFrank's user avatar
1 vote
0 answers
36 views

Web3js Events not working as intended in v4.x

I have a simple contract with an Event. I am trying to use it in my react component. According to the documentation, it can be done like this : contractStorage.events.NewZombie({ fromBlock: 1 }) ...
mnk-reddy's user avatar
0 votes
0 answers
14 views

Ganche-cli, mine multiple transactions into one block

I am using ganache-cli and web3 to build a DAPP. As part of this project I am trying to add multiple transactions into one block but facing unusual behavior. I tried options -b and --blockTime as well....
111Seven's user avatar
0 votes
1 answer
10 views

Help with “web3 not defined”

I am cloning a tutorial https://github.com/techaddict0x/liquidityminer And when I run the debug console I get the error “web3 is not defined” The code is the exact same, looked all over the internet ...
Jackson T.'s user avatar
0 votes
0 answers
27 views

Can I add an NFT image to MetaMask on the Ganache test network?

Here is my code: const addImageToMetaMask = async (_tokenAddress, _tokenName, _tokenSymbol, _urlImage, _tokenId) => { try { if (typeof window.ethereum !== 'undefined') { const provider =...
azam's user avatar
  • 1
1 vote
0 answers
27 views

How would I access a contract's public property (variable) using web3.js?

I'm trying to get a variable called "entryAmount". I've tried many methods, like calling it as a method, but it doesn't work. A part of the solidity code: pragma solidity ^0.8.0; contract ...
Jayden's user avatar
  • 11
0 votes
0 answers
21 views

How to fix, "Uncaught Error Error: No "from" address specified in neither the given options, nor the default options."

https://github.com/techaddict0x/liquidityminer , https://www.youtube.com/watch?v=rSdogDo2YF4 Hey people, I've been trying to clone this liquidity mining project, following the tutorial, but I keep ...
Jackson T.'s user avatar
1 vote
1 answer
86 views

How to get Factory address from the Router address? Web3.js

I'm trying to get a factory address for Uniswap on base network, unfortunately I'm not able to locate this address anywhere and I'm kind of desperate as without it I'm not able to try my code that ...
RasmonT's user avatar
  • 131
1 vote
1 answer
226 views

`web3.eth.abi.decodeParameters()` returning error: AbiError: Parameter decoding error: overflow

I am trying to decode the transaction input which is an hex data. I am using the following code for the same const functionABI = abi.find(entry => entry.name === 'check'); decodedInput = web3.eth....
111Seven's user avatar
1 vote
0 answers
51 views

How can I troubleshoot this contract deployment script?

I have a contract which deploys fine to Goerli and Sepolia via Remix (0xC4c414142B66FB04e2A7c50c7592F5D7696a6a2F and 0x559527Dfe454B717Ee417887127D606E6A7C8e37). I'm trying to deploy them through a ...
Boris K's user avatar
  • 197
0 votes
0 answers
19 views

Ganache-cli unable to create database to store blockchain

I am new to smart contracts, web3. I am trying to deploy a smart contract to ganache-cli and store the blockchain in a database. When I run the below code I am able to deploy the contract but unable ...
111Seven's user avatar
0 votes
0 answers
17 views

Retrieving Full Hash Values from Log Messages

I am currently working on monitoring rejected transactions from a Geth node and facing a challenge with retrieving the full hash of the rejected transactions from the logs. While utilizing Geth with --...
Armen's user avatar
  • 1
0 votes
0 answers
15 views

How to get required Transaction Fee in creating and deploying Gnosis Safe using their SDK core?

how do i get the transaction fee which is required for creating and deploying a SAFE using core SDK? await safeFactory.deploySafe({ safeAccountConfig }) This piece of code is doing that for me, but I ...
Sourav's user avatar
  • 1
1 vote
0 answers
60 views

Network Request Failed in Web3 | Avalanche

I tried to create a project on Avalanche Blockchain. For the project, I created a local subnet using Subnet-EVM on my Local Avalanche Network. After deploying the subnet, I used the resulting RPC URL ...
DopplerPinkman's user avatar
1 vote
1 answer
123 views

Returned error: unknown account Web3.js

I'm trying to create new safe wallet for my current wallet using deploySafe method. Following is my implementation: import Safe, { SafeAccountConfig, SafeFactory, Web3Adapter, ...
Nick's user avatar
  • 21
1 vote
1 answer
253 views

Getting proxy contract instead of the Contract I deployed using Ethers v6

I am trying to get the Contract I deployed so that I can use the Functions in order to implement the functions on the Frontend It works on Ethers v5 and returns the contract I deployed but not on ...
Aditya's user avatar
  • 11
1 vote
1 answer
262 views

I was trying to convert private key of an account to its public key but getting an error

code: const accountFrom = web3.eth.accounts.privateKeyToAccount(privateKey); getting error: throw new web3_errors_1.InvalidPrivateKeyError(); ^ InvalidPrivateKeyError: Invalid Private Key, Not a ...
Aritra Dam's user avatar
0 votes
0 answers
26 views

We have an own wallet but we don't have an idea how to connect this to other sites?

I had an Wallet created by Own.I need to connect that wallet with active sites like Metamask.If we want to connect the Metamask with Site means we call window.ethereum default as a trigger comment. ...
pemaju02's user avatar
1 vote
0 answers
177 views

How to track ERC20 token creations on Ethereum blockhain with web3.js using Infura API?

I'm trying to fetch new ERC20 tokens from the blockchain transactions, my code is scanning the blocks and when I tried to log transactions it works well, (dumping bunch of logs). However I don't know ...
RasmonT's user avatar
  • 131