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
2 answers
51 views

Hardhat Node Stops Emitting Events to Web3js

I'm running a hardhat node and a nodejs backend using web3js to capture events (code) and for some reason the events stop getting caught by web3js. The transactions seem to be firing just fine as I ...
user avatar
  • 113
0 votes
0 answers
22 views

Web3js send method promise response when user refresh the page

I have a website that connect with a smart contract throught metamask provider. I'm using the send method and I'm managing every posible response of the promise, as on "confimration", on &...
user avatar
0 votes
0 answers
85 views

Mint NFT with web3.js: Invalid parameters: must provide an Ethereum address

I have a simple Smart Contract deployed to Rinkeby Test Network from "administrator Wallet" and I'am trying to write a code which allow other users to mint a ERC-721 token from it using Web3....
user avatar
  • 1
0 votes
1 answer
35 views

Becoming a good solidity developer [closed]

I'm a javascript / web3 developer, with not much experience writing solidity. I have a lot of experience interacting with contracts using web3. What would be the best steps to start learning and ...
user avatar
  • 3
0 votes
0 answers
17 views

How To Read All Specific Data

I wrote a smart contract that saves data to the blockchain and is able to return read that data when you enter a specific id. The problem is I would also like to save the data by date but when I enter ...
user avatar
0 votes
1 answer
18 views

Can we change ERC721 mapping Access Modifier?

I am using openzeppelin ERC721 smart contract. That smart contract have a mapping's called : mapping(address => uint256) private _balances; mapping(uint256 => address) private _owners; Can we ...
user avatar
0 votes
1 answer
28 views

VM Exception while processing transaction: revert — Transferring ether from EOA to contract account

Problem summary I get the following error whenever I try transferring ether from an EOA(externally owned account) to a contract account in one of my functions as seen below. I am currently using the ...
user avatar
  • 105
0 votes
1 answer
46 views

I sent usdt to my smart contract

I have send by mistake usdt(polygon) to my smart contract that’s token contract created on bsc network. Is there any chance to pull that token out ? When I execute transfer function it only pull funds ...
user avatar
0 votes
0 answers
142 views

How to create dapps webview with inject web3 in flutter

I'm trying to inject and then connect web3.js to flutter WebView, but I can't get the wallet connected to the network, it's not showing me to the wallet connected browser site. This is how trying to ...
user avatar
  • 101
1 vote
1 answer
419 views

How to send BNB from my wallet to another wallet using web3?

I am sending BNB from one to another wallet but I a getting an error when I execute my code while I have 0.009 BNB in my wallet : Error: Returned error: insufficient funds for gas * price + value Here ...
user avatar
0 votes
0 answers
64 views

How to Send BUSD using web3js & Metamask with Vuejs

I found this answer very useful on how to send BUSD with metamask/web3. However in my own case, nothing seem to happen when button is clicked. Can't figure out what I'm not doing rightly I'm using ...
user avatar
  • 101
1 vote
1 answer
107 views

Error: ethjs-query while formatting outputs from RPC

I am having the following contract: pragma solidity >=0.7.0 <0.9.0; import "./IERC165.sol"; import "./IERC721.sol"; import "./IERC721Enumerable.sol"; import "....
user avatar
  • 120
0 votes
0 answers
46 views

How to integrated javascript /web 3 into wordpress?

hello everyone i use wordpress for website developement and right now i developping a web3 app and i would to know how can i integrated the script to wordpress element (button etc ). Should i develop ...
user avatar
  • 5
0 votes
0 answers
9 views

Identify money sending transaction and contract creation transaction

I'm using web3 version ^1.0.0-beta.46. below is an example transaction of Ethereum block accessList: [] blockHash: "0x0b82cf9ba5232f3e6432f99bed4e850f984d9b05ee64c8b4d42a826a1e68588e" ...
user avatar
  • 101
1 vote
1 answer
99 views

Native token Bridge to swap another native token

I have a smart contract on the BSC network that I want to accept other tokens like AVAX, MATIC, ETH, and other EVM compatible tokens. How would one go about letting a user use AVAX but at the end it ...
user avatar
0 votes
1 answer
126 views

Web3 provider returns object. Need to store the provider in localstorage

I have a set of function in my react application which I want to connect to the web3 modal. I use Web3 and web3modal for connecting with different wallets. Here is my code: import axios from "...
user avatar
0 votes
1 answer
236 views

How to Export public key from Metamask

【Front】 const keyB64 = await window.ethereum.request({ method: 'eth_getEncryptionPublicKey', params: [accounts], }); const publicKey = Buffer.from(keyB64, 'base64') ...
user avatar
0 votes
0 answers
41 views

view functions error : Returned values aren't valid, did it run Out of Gas?

I'm calling the methods in the deployed smart contracts in Ganache. Other methods are working fine, but the view functions returns an error. Here's the view function in Solidity: mapping (address =>...
user avatar
0 votes
1 answer
23 views

My transaction was dropped and now when I search the transaction on etherscan it says we are unable to locate this transaction hash. Please help

I sent money to a friend with a low fee. After awhile it showed dropped and I was going to replace it with a higher fee but when I tried to open the transaction id to get the nonce it now says its ...
user avatar
0 votes
1 answer
39 views

Unable to deposit into AAVEv3 via web3

I'm attempting to deposit WMATIC on the Polygon chain into AAVEv3, but I'm getting a revert. I'm running a forked version of Polygon mainnet locally with ganache. I'm using the first account provided ...
user avatar
0 votes
0 answers
162 views

1inch aggregation protocol v4 - basic example of swap

I'm trying to figure out how I can use 1inch AggregationRouterV4 as a smart contract and not as an API. I have experience with ethers , but I can't find any example and tests on how to work with a ...
user avatar
  • 101
0 votes
1 answer
170 views

swapTokensForExactETH, execution reverted: null

I m trying to estimate gas for a swapTokensForExactETH transaction with pancakeswap contract (similar to uniswap one) When i do, i get the following error: Error: Returned error: execution reverted ...
user avatar
  • 113
0 votes
0 answers
25 views

is there any way to get other smart contract ABI(not my smart contract) automatically without using API or manual(etherscan copy-past)?

my question is so simple but with difficult answer :-) is there any way to get ABI for some smart contract address automatically without using API ? there are some API that i can get ABI for smart ...
user avatar
0 votes
0 answers
9 views

Problems sending tokens. The value you send should be less than your current balance

Im having this issue. I understand that: I have Contract A and Contract B If Alice has 100 tokens, and calls transfer on contract A, Alice's tokens are going to be transferred. If Alice has 100 tokens,...
user avatar
  • 25
0 votes
0 answers
97 views

Get details of pending transaction using tx hash

I'm trying to get the details of pending transaction using it's txhash. I tried using web3.eth.getTransaction(transactionHash) but it seems like it returns null for pending transactions but works fine ...
user avatar
0 votes
0 answers
14 views

Contract Calls returning null using truffle Gnache and node

i have a simple contract pragma solidity ^0.4.18; contract HelloWorld { string private name = "Ire"; function getName() public view returns (string) { return name; } function setName(...
user avatar
0 votes
0 answers
14 views

to convert one token to another, is there something as simple and independent methods, or do we necessarily have to use a dex as a swap interface?

I use web3 with nodejs. To transfer the main network token, which we put in the transaction value. To transfer another token to another wallet, we use the smart contract transfer function of the same ...
user avatar
0 votes
0 answers
49 views

Geth - Full Archive Node

Im currently using an Infura RPC node and web3 for querying transactions. Im running into an issue when trying to query multiple blocks that contain more than 10K results. If I was to run a full ...
user avatar
  • 3
1 vote
0 answers
17 views

Is it possible to extract data such as `gasPrice`, `gasLimit`, `nonce`, etc. from the transaction that has been signed and serialized?

Is it possible to extract data such as gasPrice, gasLimit, nonce, etc. from the transaction that has been signed and serialized? For example I use this code for sign tx: //Signing transaction const ...
user avatar
1 vote
1 answer
15 views

How to understand if a contract has been renounced programmatically?

Is there a way to query the blockchain to find out the current owner of the smart contract programmatically? I mean not the address that deployed the contract, but the one that is currently the owner. ...
user avatar
0 votes
0 answers
41 views

Uncaught (in promise) TypeError: myFunction.watch is not a function

I'm trying to develop my first DAPP based on this tutorial (https://livebook.manning.com/book/building-ethereum-dapps/chapter-12/) and I'm encountering some errors in the javascript part. In ...
user avatar
0 votes
0 answers
51 views

Getting "Expected private key to be an Uint8Array with length 32" when running a transfer function on ropsten testnet through my terminal

i am trying to send a transaction but it throws an error. MY CODE: var Tx = require('ethereumjs-tx').Transaction const Web3 = require('web3') const web3 = new Web3('https://ropsten.infura.io/v3/...
user avatar
0 votes
0 answers
21 views

API for find smart-contract deployed which chain?

Is there any API which gives me details that project smart-contract deployed on which chain via its smart-contract address? e.g. How to know whether it deployed in polygon, avalanche, ethereum? If is ...
user avatar
0 votes
2 answers
90 views

Error : contract.methods.myfunction().call() is not a function

I'm new to web 3 and I'm trying to interact with a contract deployed with ganache and I get an error here is a screenshot: `
user avatar
  • 5
0 votes
1 answer
98 views

Set BUSD transaction value in web3 ETH send transaction

I followed the instructions on Binance docs, using Web3js to create a transaction. I want to create a BUSD transaction on web3 using metamask try { const transactionHash = ethereum.request({ ...
user avatar
  • 101
0 votes
0 answers
34 views

Returned error: replacement transaction underpriced and Returned error: exceeds block gas limit

I'm trying to send a Web3JS transaction for a SmartContract (BSC) but it always returns Returned error: replacement transaction underpriced and if I increase the Gas it generates Returned error: ...
user avatar
0 votes
0 answers
39 views

Uncaught Error: invalid BigNumber string (argument="value", value="2022-05-18", code=INVALID_ARGUMENT, version=bignumber/5.6.0)

I created a function that registers births and use a form to submit the data. The problem is every time I try to use web3/Javascript, it gives me this error. The error is because of the dateOfBirth ...
user avatar
0 votes
0 answers
25 views

Filter Ethereum events by number range

Is it possible, using web3 or ethers to filter events by a number range, e.g. indexing the amount in an event and then filter events with amount > a number.
user avatar
  • 309
0 votes
2 answers
120 views

How to get the returned values in Solidity functions? [duplicate]

Imagine I'm developing a simple function as the following: uint256 state; event Addition(uint256 result); function addition(uint256 a, uint256 b) public ...
user avatar
  • 705
0 votes
1 answer
31 views

Can i build an NFT marketplace on 0x api

I just saw 0x.org today it looks interesting, i am working on an NFT marketplace on Polygon, your docs looks familiar as to what i am working on. so i want to know, if i can build an NFT marketplace ...
user avatar
  • 1
0 votes
0 answers
59 views

geth - allow external node to connect to private, locally running network

I'm running a local, private blockchain using geth. This is currently my setup: bootnode running on port 30300 peer node 1 running on port 30301 with HTTP-RPC server on port 8101 peer node 2 running ...
user avatar
  • 21
0 votes
0 answers
20 views

How to Approve spend of one Token with Web3.js? [duplicate]

I am currently using an html (with javascript) page that is available to my users. I need to set up a button that allows the spending of BUSD or other stablecoin tokens on the same page. Once the ...
user avatar
0 votes
0 answers
27 views

Is using block.timestamp + appropriate for adding months even years into the future?

I have a smart contract that is date dependent. Intended to schedule events far into the future, like days, weeks, months even years into the future. As long as the events happen on the specified date,...
user avatar
  • 107
0 votes
1 answer
55 views

How to Use 2 NFTS metadata to create a new NFT (Breed) with Metadata JSON that they choose from the 2 NFTs

How to Use 2 NFTS metadata to create a new NFT (Breed) with Metadata JSON that they choose from the 2 NFTs.
user avatar
0 votes
0 answers
21 views

How to text search / filter in web3?

I have created a list of ERC721 NFTs in different contracts using thirdwebsdk, I need a way to text search, for example, nfts with the name as "cat" and get the list of all nfts which has &...
user avatar
0 votes
0 answers
427 views

How to Approve spend of one or many Token with Web3.js?

I am currently using an html page (with javascript) that is available to my users. I need to set up a button that allows the spending of BUSD or other stablecoin tokens on the same page. Once the ...
user avatar
0 votes
0 answers
162 views

How to get balance on metamask all network [bsc , eth, cro, etc] using web3modal

how to display the balance for metamask using web3modal with various networks, for example I am on the mainet bsc network I display the bnb balance, and if I use the ether network what appears is the ...
user avatar
0 votes
1 answer
28 views

Why am I failing to interact with a smart contract I found on Etherscan.io?

I am getting the below error trying to call an existing smart contract I found on Etherscan.io function using call(). Error: Error: Returned values aren't valid, did it run Out of Gas? You might also ...
user avatar
  • 107
0 votes
2 answers
262 views

swapExactTokensForTokens estimateGas fails with execution reverted

I'm trying to swap a pair not having wbnb on pancakeswap. For ex. BUSD -> LUNA. As far as the pair doesn't have wbnb I use swapExactTokensForTokens (meanwhile WBNB -> BUSD with ...
user avatar
0 votes
0 answers
20 views

How to create using Mnemonic in Web3.js? [duplicate]

I want to create an account with mnemonic in WEB3.JS I tried using web3.eth.accounts.create() but the only argument is entropy and it returns only { address: "", privateKey: "&...
user avatar

1
3 4
5
6 7
117