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

Connecting to MetaMask using Web3.js: Web3.givenProvider vs window.ethereum

I am a newcomer to DApp development and am currently attempting to programmatically connect to MetaMask using Web3.js. I am following the Getting Started guide (https://web3js.readthedocs.io/en/v3.0.0-...
Dawid's user avatar
  • 101
0 votes
1 answer
33 views

Can't send eth + data into contract with etherjs

I want to send eth + data into this contract: 0x5293Bb897db0B64FFd11E0194984E8c5F1f06178 like this transaction: https://sepolia.etherscan.io/tx/...
Zambaize's user avatar
0 votes
0 answers
9 views

Eip838ExecutionError: execution reverted, while deploying contract with web3js

I maintain a web3 application, for each customer I deploy a smart-contract through the application. The contract was good and I were able to deploy it on polygon, but it isn't comply with the ERC721 ...
Lollo's user avatar
  • 101
0 votes
0 answers
5 views

Web3 Could not find name 'Web3'. Did you mean 'web3'

My code works but I am getting this with Web3 dotted. Could not find name 'Web3'. Did you mean 'web3'? const web3 = new Web3(Web3.givenProvider || infuraUrl); When I try to fix it by doing this: ...
trox's user avatar
  • 1
1 vote
0 answers
15 views

SignTypedData in ethers version 6.9.0

Does anyone know how to perform signTypedData in ethers version 6.9.0 . I am tryin to do this but it reverts with this function doesnt exist . I am trying to create a signer usin g JavaScript ...
Jaskaran Singh's user avatar
0 votes
1 answer
18 views

Smart contract holds USDT

My smart contract holds some USDT token and now if someone knows my Contract address can he/she transfer that USDT to his/her address. Just to clarify the USDT contract has transferfrom function which ...
Nishant Dhamija's user avatar
0 votes
0 answers
7 views

Send Value Raw Transaction fails with insufficient funds for gas

const amount = web3.utils.toWei("0.0000001", "ether"); var gasPrice = await web3.eth.getGasPrice(); var gasLimit = 21000; var nonce = await web3.eth....
lsj's user avatar
  • 1
0 votes
1 answer
25 views

TypeError in Nonce [Web3, Python, FlashBot]

Here is the code. When I wrote the private key of sender's address without string, it showed me provide sender's key as string. When I wrote the private key of sender's address in string, it showed me ...
Axaansh Dholiya's user avatar
0 votes
0 answers
10 views

WebSocket connection Failed when using Helia in react app

I have been trying to use helia in my react.js application but keep getting the following error in the console: WebSocket connection to ‘wss://ny5.bootstrap.libp2p.io/p2p/...
Harmanpreet Singh's user avatar
0 votes
1 answer
25 views

Methods not appearing when printing contract but do appear on Etherscan

I have a goerli testnet contract you can check out here. I'm trying to call executeFlashLoan using a javascript function using web3js, but the code acts as if the function doesn't exist. However, it'...
Trent Kennelly's user avatar
0 votes
0 answers
8 views

Is there documentation for web3 .request(...) method?

I created a js web3 app that sends a transaction with the final line of code: const receipt = await web3.eth.sendSignedTransaction(tx); Now, I would like to send multiple transactions via web3's ...
deniskov's user avatar
0 votes
1 answer
17 views

Creating a token for my personal dapp use only

I want to store the money in a smart contract from my user as long the user wants and pay back the user once he asks i will not charge for this service if I store ether in it and the value of Ethereum ...
Nishant Dhamija's user avatar
0 votes
0 answers
9 views

How Remix IDE compiles smart contract code to ABI and bytecode?

I am building a DApp where user uploads his smart contract code file and his smart contract gets deployed using his private key ( After he connects his metamask account to the DApp ) . How RemixIDE is ...
Gaurav Pant's user avatar
0 votes
2 answers
21 views

Test BNB / WBNB for Development testing purpose

I am in need of 100 test BNB for testing purpose but with faucet its not possible to get that much is there any way to have that much test bnb. OR is there any existing liquidity of test BNB / WBNB ...
Bhushan Dhiware's user avatar
0 votes
1 answer
10 views

Staking pool for native coins

I wanna build a staking pool for native coins like trx to test my skills as an engineer and yet due to my limited knowledge I don't know how to make a staking platform without creating a new token. Is ...
Sina Blank's user avatar
0 votes
0 answers
14 views

Strange order of transactions in the same block

recently i saw next thing: There is a nft game contract, the goal is to be the first (top 100). Each game starts by Tx from admin, let's say he calls start() function in his transaction. Then all ...
0xse's user avatar
  • 1
0 votes
0 answers
31 views

Swap functions seems to not swap?

I have deployed a smart contract on a local network and I am trying to do swaps from a metamask account. I have allocated a quantity of tokens to the smart contract so it can use it using the approve ...
guiflam's user avatar
0 votes
0 answers
24 views

Call contract method via metamask without web3

https://docs.metamask.io/wallet/reference/json-rpc-api/ window.web3 is no longer injected by metamask, instead it is window.ethereum, but loads of methods are missing. It used to be very simple, just: ...
zeb3142's user avatar
0 votes
1 answer
13 views

in cloud window.ehtereumundefined,in local window.ehtereum is object

I am developing a dapp now, deploy the dapp in local PC, it can connect with browser extension, window.ehtereum is Object, but deploy it in aws cloud, it cann't connect with browser extension, window....
spencer's user avatar
0 votes
0 answers
15 views

How to make many transactions in one transaction to pay less gas

Web3.js Good afternoon, can you please tell me how I can make several transactions from different wallets to one wallet? We have conditionally realized system of deposit and main wallet. When the ...
Meliodas's user avatar
0 votes
1 answer
40 views

Error (9322): No matching declaration found after argument-dependent lookup

Here is the file which i try to run test through foundry. //Imports import "forge-std/Test.sol"; import {Portal} from "../src/Portal.sol"; import {IERC20} from "@openzeppelin/...
Internet and Computer Probe's user avatar
0 votes
1 answer
44 views

Error happened while trying to execute a function inside a smart contract: Chainlink Functions Contract Deployment

Attempting to deploy this smart contract on the Mumbai Testnet. The contract deploys and it's address is 0x435daA3ba0d89A92b91174DC745D013c201fcF6a. But, when I try and press on the accept ownership ...
kixsmart's user avatar
0 votes
0 answers
17 views

InvalidResponseError: Returned error: The method eth_sendTransaction does not exist/is not available

I'm trying to interact with a smart contract on BSCtest using web3. I think the error occurs in this line rs = await TokenContract.methods.transfer(receiverAddress, 100000).send({ from: myAddress, ...
Ngọc Minh Nguyễn's user avatar
0 votes
1 answer
17 views

React (opts:) not working, am i missing dependency?

I have a basic walletconnect web3 module here. I am following a video from https://www.youtube.com/watch?v=L65gP0cGC30 but it errors (opts:) on the example video the text actually is grayed out so it ...
Jim Mike's user avatar
0 votes
0 answers
32 views

React Dapp, Wont notify user after successful TX

This is my "Test" dapp which i am building, i am struggling to call an event handler to check if the user has approved spending on a certain contract, in this case USDt ...
Jim Mike's user avatar
0 votes
0 answers
25 views

Signature verification using ecsign and ecrecover

I am using web3.js library to sign a transaction and then verify it from the smart contract. The Signature generated on FrontEnd and as well as from the smart contract are not same.. This is the ...
hammad ali's user avatar
0 votes
2 answers
53 views

Callback After Dapp Approval

I have had a contract made for me, and a dapp set up by a developer. My question is how can i produce an event on my website when the user has approved spend of a certain token? Can i use a javascript ...
Jim Mike's user avatar
0 votes
1 answer
14 views

Send selected token (the one you deployed) with web3js

How to send a transaction of a token that I have in my wallet other than the default one like ether in Ethereum without a contract method just with web3js?
seojunchian's user avatar
0 votes
1 answer
48 views

'value at "/0" is required'

const {Web3} = require("web3"); require("dotenv").config(); const sPrivateKey = process.env.SENDER_PRIVATE_KEY; const sPublicKey = process.env.SENDER_PUBLIC_KEY; const rPublicKey =...
seojunchian's user avatar
0 votes
1 answer
31 views

Signature verification using web3js

I am using web3 library to sign a transaction and then verify it from the smart contract. The signature is not verifying. This is the frontend code const DomainSeparator = ethers.keccak256( ...
Abdul Samad's user avatar
0 votes
0 answers
22 views

eth_sendTransaction does not exist/is not available

What I am trying to do is I am trying to send transactions with web3js. At first I used sign transaction then send signed transaction get the same error after a little bit of research and tryed them. ...
seojunchian's user avatar
0 votes
0 answers
29 views

Cannot read properties of undefined (reading 'getDefaultChain')

in this code when i want call the function from contract i get this error: Cannot read properties of undefined (reading 'getDefaultChain') i use walletConnect V2 for connecting wallet and use etherjs ...
Elham Bahrami's user avatar
0 votes
1 answer
24 views

How to send a token other then eth with metamask without extension of course?

I wanted send token other than eth with metamask using code but I did a little bit of research couldnt find anything. Do you guys know anything about that? I checked metamask docs site too didnt find ...
seojunchian's user avatar
0 votes
2 answers
38 views

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Returned error: invalid opcode

Unable to deploy this code on any chain. I have done all i could, cleared my browser and restarted my pc and still could not deploy. what could be the issue please. // SPDX-License-Identifier: MIT ...
Bamu Gift's user avatar
0 votes
1 answer
32 views

How set Market or Agressive fee

Im using RainbowKit and Web3.js, theres any way to set transaction fee to be default market or aggressive, when open metamesk pop up to sign the transaction?
Wesley Sousa's user avatar
0 votes
0 answers
11 views

Why registerAllowedOrderSigner function doesnt work

i created a limit order. Then what I wanted is to give access to another address who can sign the order on behalf of me. I called the registerAllowedOrderSigner method from the proxy contract and ...
sayantan mondal's user avatar
0 votes
1 answer
71 views

How to fix `Expected 0 arguments, but got 1` error on web3.eth.contract method?

I'm trying to make a simple function call to a view function that takes a single uint256 as input, however when I try to pass the variable, next type check gives me this error: Expected 0 arguments, ...
Rohan Nero's user avatar
  • 1,443
0 votes
1 answer
12 views

"What are the key considerations for optimizing gas costs in complex Ethereum smart contracts while ensuring security and scalability?"

Techniques and best practices for reducing gas consumption in Ethereum smart contracts. Code optimization strategies that apply to various contract types (e.g., ERC-20, ERC-721) and scenarios.
Princeleonal's user avatar
0 votes
0 answers
12 views

Can I delete the Values in the mappings using delete keyword [duplicate]

mapping(IERC => contract) public testing; delete testing[IERC]; In the above code snippet I want to delete contract type (value) using the delete keyword can it be possible?
kumar's user avatar
  • 41
0 votes
0 answers
7 views

How to fix `str is undefined` nft dapp upload picture problem?

I'm trying to do an example in a tutorial, I tried to run this, but I get an error that "Upload errorTypeError: str is undefined". How can I solve this? I tried: -> deleting artifacts and ...
Kayhan's user avatar
  • 1
0 votes
0 answers
145 views

"Error happened while trying to execute a function inside a smart contract" after trying to call smart contract function with fork ethereum chain

I am forking Ethereum blockchain using Alchemy's api. Below is my chain config module.exports = { solidity: { compilers :[ {version : "0.8.17"}, {version: "0.8.4"}...
Rohit Goyal's user avatar
2 votes
1 answer
43 views

ethers.js library version to use to learn Ethereum development

Which version of the Ethers.js library, either v5 or v6, is recommended for me to learn and work with? I'm seeking advice on which version would be more beneficial for my current needs and future ...
Israel Ogunsola's user avatar
0 votes
1 answer
46 views

How to download and install Echidna?

I have just started learning echidna but i havent found any detailed information of how to install and setup echidna in WSL.
kumar's user avatar
  • 41
1 vote
1 answer
28 views

".send()" web3.js in the browser for a deployed contract, it doesn't work correctly

I am not a native English speaker, so my English is not very good. I apologize if my sentences are not correct. I have deployed the following contract. pragma solidity >=0.4.22 <0.9.0; pragma ...
Sichi's user avatar
  • 11
1 vote
2 answers
39 views

How to know base token from the pool

here is quick question. From uniswap pool, which one is base token? token0 or token1?
Biruk Damte's user avatar
1 vote
1 answer
58 views

Tracking the spedup transactions from metamask

while building a Dapp using metamask to make transactions, i figured that metamask is not responding correctly when a transaction is spedup, making my code wait forever for a canceled transaction that ...
Kaki Master Of Time's user avatar
1 vote
0 answers
11 views

error when executing swap via TG bot

Hey I’ve been getting this error trying to execute a swap with my telegram bot. I’ve tried to figure it out myself but I’m sure posting here will get to a solution quicker than I can. This is the ...
Web3Assassin's user avatar
0 votes
1 answer
37 views

Cant make conection with my Smart Contract using web3

I cant get my contract instance using web3 . I am making todo app using web3 . I cant get my contract instance in js file . I am new to web3 development and everyday I am trying my best improve my ...
Shorna's user avatar
  • 13
0 votes
0 answers
24 views

I cant log out my contract in a project

I am building web3 Todo app . I am building it using Next Js . I am trying to console log out my contract on console . So I have just build my smart contract . Now trying to make connection with my ...
Shorna's user avatar
  • 13
0 votes
1 answer
9 views

Is there any other use-case of having a decentralised network other than majorly DeFi and GameFi?

I have been familiar with the Web3 ecosystem for almost 2-years now. But I still fail to understand if there is any other real world use-case for a decentralised network other than DeFi, ICOs and NFTs ...
MT 16's user avatar
  • 45

1
2 3 4 5
122