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

Using Web3 the value sent as payable (msg.value) is equal to 0

We have a smart contract that is supposed to receive payments in order to mint token; it follows the ERC1155 standards as it extends ERC1155URIStorage. Here is a sample of the contract we deploy: // ...
A.J Alhorr's user avatar
0 votes
0 answers
18 views

How to decode orca.so api response

I'm building my arbitrage bot with orca.so, when I try to fetch the price via their api this is the response: { "jsonrpc": "2.0", "result": { "...
Richie Pua's user avatar
0 votes
0 answers
32 views

JsonRpcProvider RPC call results wrong while BrowserProvider works well

I'm facing really weird phemomenon.. What Im doing is, Im instantiating Wallet with my private key, and trying to send ERC-20 methods to endpoint ('https://ethereum.publicnode.com') const provider = ...
Jisang Seo's user avatar
0 votes
2 answers
73 views

How to know total value of buying and selling of a wallet via web3

I want to know how much a wallet has bought and sold the assets. I need to know it in dollars. For example, 500$ of assets bought and sold by a wallet Something like this is possible in web3?
Fariha Abbasi's user avatar
0 votes
1 answer
29 views

How to get total assets value in dollars of a wallet via web3?

I want to check the total assets value in dollars of a wallet. For example, I just want to check how much asset (Ethers, erc20 tokens) does a wallet hold in form of dollars? e.g: 2000$ worth of assets ...
Fariha Abbasi's user avatar
1 vote
1 answer
147 views

How do I access external view data through a proxy's implementation contract with web3.py if the data is stored in the proxy itself?

I want to use web3.py to access all sorts of view-data from smart contracts. In some cases, it's pretty simple. Take USDt: You have the USDt contract on mainnet, ...
PeepoXBT's user avatar
0 votes
0 answers
47 views

NFTs displayed in a collection

I want to display all the NFTs with the same collection name on my marketplace however I get nothing displayed, I have a home page where it displays each collection as a card and I have a collection ...
Eyad Ahmed's user avatar
0 votes
0 answers
49 views

How to dynamic import web3 in next js

I'm using web3 in my project, due to its size I want to import in dynamically, const Web3 = dynamic(() => import('web3')); But I'm getting these errors under this () => import(web3)); Type '...
Mohanraj G's user avatar
0 votes
0 answers
6 views

failed connecting with virtual machine

I have 4 geth Nodes runnning on my PC bootnode address is 192.168.1.2 the 5th node is running on Virtual machine with address ( 192.168.1.5 ) when i try to run the 5th node it doesn't sync with the ...
Amxdz's user avatar
  • 1
2 votes
1 answer
57 views
+50

abi-decoder's decodeMethod returns undefined

I am trying to decode the input field of this transaction as below, const decodedInput = abiDecoder.decodeMethod(transaction.input); but decodedInput returns undefined despite the my ABI having the ...
Nishanth Gobi's user avatar
0 votes
0 answers
25 views

What do the to/from fields in a swap event mean?

Im parsing swap log events from web3 and was reading the to and from addresses from the topic but sometimes the from/to address is the same, and other times its different. It doesn't seem to ever be ...
BAR's user avatar
  • 135
1 vote
1 answer
73 views

web3.js how to call receive() external payable?

firstly, I have a code in a contract as below: receive() external payable { // function enter() external payable { require(msg.value > 0.1 ether, "require minimum 0.1 ether!...
cyann's user avatar
  • 11
0 votes
1 answer
716 views

adding BigNumbers with ethers

I am running tests and use ethers to format big numbers. I can't figure out how to add them. For example, say I have two numbers I convert into 10 and 100 Finney: const x1 = utils.formatUnits(&...
Eric Falkenstein's user avatar
0 votes
0 answers
131 views

Error code from `web3.eth.getTransactionReceipt`

I have code structure like this. try { await web3.eth.getTransactionReceipt(hash); } catch (e) { console.log(e.message); console.log(e.code); console.log(e); } When the hash is 123, ...
Samvel Topuzyan's user avatar
0 votes
0 answers
16 views

Compiling Vyper files results in a 'path exists outside base folder' error

I was working with the truffle VyperStorage Example Box. When I execute truffle compile it shows me the error above. I have installed Vyper using pip.The truffle config.js file is used as default so ...
Muhammad Uzair's user avatar
0 votes
0 answers
56 views

how can I get a Block hash before sending?

I'm using tron-api for trx transactions. The obtained raw_data is as follows: [ "visible" => false "txID" => "...
pan's user avatar
  • 1
0 votes
0 answers
11 views

Get all transactions on ethereum

Is there a way to get all transactions on ethereum such that transactions between two unique wallets will be counted as one ?
Loki's user avatar
  • 9
0 votes
0 answers
31 views

Error: Transaction has been reverted by the EVM

I am trying to call the following solidity method from my smart contract in javascript: address[] public investors; function addInvestor(address investor) public { investors.push(investor); ...
Zubair's user avatar
  • 1
0 votes
0 answers
14 views

Get exact Swap price using LP info

I want to calculate the exact price for each swap event that comes through on the blockchain. I gather that the only way to do that is to track the LP balances for WETH and the token. If there is ...
BAR's user avatar
  • 135
0 votes
0 answers
86 views

Decoding the array from the solidity events using web3.js

I want to track an event emitted by the smart contract from the backend using web3.js, But the Problem is there is the array type(uint8[]) in the event ,whenever I try to decode it it gives the ...
shiva sai's user avatar
0 votes
0 answers
50 views

How to get position slot allowance automatic

how to get position slot allowance automatically without looking at the code? because each positive slot allowance in several different tokens, some of the default position is 2 but there are 3 and ...
damartripamungkas's user avatar
0 votes
0 answers
112 views

error the second time I try to Mint: "execution reverted: ERC20: transfer amount exceeds allowance"

I've a problem trying to mint a token in a custom smart-contract. I'm using Nextjs and Wagmi to read/write to the contract const { data, writeAsync: approve } = useErc20Write("approve", [ ...
KreW's user avatar
  • 1
0 votes
0 answers
11 views

Why is it not showing any results in the Table / Collection Section?

this is my transport.request.model import mongoose from "mongoose"; const schema = new mongoose.Schema({ Transport : String, Product : String, Material : String, Capacity : Number, ...
abdou's user avatar
  • 3
1 vote
1 answer
380 views

How would I be able to set slippage for exactInputSingle on Uniswap v3 and Pancakeswap v3?

I'm able to do swap transactions using multicall and exactInputSingle functions on both Uniswap v3 and Pancakeswap v3. However, I have no idea how would I be able to set the slippage. The v2 routers ...
Austin's user avatar
  • 123
1 vote
1 answer
123 views

How to read all Transfers on blockchain

How do I get all transfers occurring on the blockchain and their transaction amounts and to and from addresses? event_signature_hash = web3.keccak(text='Transfer(address,address,uint256)').hex() ...
BAR's user avatar
  • 135
0 votes
1 answer
321 views

web3 python - AttributeError: 'Eth' object has no attribute 'abi'

I am trying to use an example ABI but its not being found. My problem is on last line: AttributeError: 'Eth' object has no attribute 'abi' infura_url = 'https://mainnet.infura.io/v3/xxx' web3 = Web3(...
BAR's user avatar
  • 135
0 votes
1 answer
107 views

Error: network does not support ENS (operation=“ENS”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/5.5.3 Network doesnot support

Hello I wrote a smart contract for crowd funding Actually I have two contracts One is create a campaign for donate funds and second is created campigns for crowd-funding and store all the campaigns ...
Yasir Saeed's user avatar
1 vote
0 answers
87 views

How to transfer coins between L1 and L2 via web3.js or ethers.js?

How to do it? Programmatically. Does it always require a bridge? Or can it be done in other way too? I haven't found any difinitive answer to this anywhere.
Nondi's user avatar
  • 49
0 votes
0 answers
13 views

A moment when an incoming TX has been complitely settled and the coins may be sent out?

I have 2 wallets. I want to send coins from one to the other (1), and from the 2nd one to an external wallet (2). const wallet = get_wallet(); const balance = await provider.getBalance(wallet.address);...
Kyell's user avatar
  • 91
0 votes
1 answer
28 views

Buy token just after the pair deployment?

Hello i saw this today : I'm wondering if how it's possible for someone to buy a token in same time as pair deployment. If i check into some mempool we do not have the info that a pending order is a ...
Valentin Garreau's user avatar
1 vote
1 answer
215 views

How to know token transfered in pending status from memepool

i'm getting list of data from web3.eth.filter('pending'), here i'm listening uniswap ETH router. If i print one result of the list : AttributeDict({'blockHash': None, 'blockNumber': None, 'from': '...
Valentin Garreau's user avatar
0 votes
0 answers
544 views

Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'args')

I get this error Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'args') whenever I want to create an nft on my decentralised application and it only appears after I ...
Eyad Ahmed's user avatar
0 votes
0 answers
261 views

polygon mumbai testnet doesn't revert error reason, instead confirm transaction with status:false

i use web3js to request to the polygon mumbai testnet using quicknode. when i use ganache, i get error revert reson easily but when i use mumbai testnet, it consume gas and return receipt with status ...
xmrrabbitx's user avatar
0 votes
1 answer
25 views

How do I deposit and restore my Ethereum to my wallet?

I want Ethereum to enter my Metamask wallet and I can use it easily to this address. 0x005449873eFD4b886DFDb3dfFeB1fA93817F8449
Shahrzad Mahro's user avatar
0 votes
1 answer
2k views

How can I remove custom spending cap on Metamask?

When I call the approve function of the ERC20 token standard, it asks me to set a custom spending cap, as shown below. But I need to use the default value every time without clicking "use ...
deKaV's user avatar
  • 1
1 vote
1 answer
132 views

Can't catch all the events using ethers

Can't catch all the events. Why? I try to listen to events for several contracts and it is ok. But the more contracts I listen to, the more events are missed? Is there any way to prevent this and why ...
byggy's user avatar
  • 11
1 vote
1 answer
104 views

How does one create and send TXs on L2 - Arbitrum and others?

In ethers.js or web3.js How does one create and send TXs on L2 - Arbitrum and others? Is the algorithm absolutely identical to the one on L1, or not? How does one transfer ETH between L1 and L2?
Kyell's user avatar
  • 91
0 votes
1 answer
278 views

types/value length mismatch (argument="tuple", value='myAddress'

I'm having some problem with the arguments of a function written in solidity and called in JavaScript. I'm using the Remix ballot default example, except I removed the first require in it. It looks ...
marcos's user avatar
  • 1
0 votes
0 answers
23 views

Private blockchain nodes not running in background

Sir I am creating a private blockchain using geth. Doing it on aws ubuntu My geth.service file contains Unit] Description=Ethereum go client [Service] User=root Type=simple Restart=always After=...
quick cricket's user avatar
1 vote
1 answer
395 views

ethers js listening to events doesn't work

What I'm trying to do: I'm trying to listen to any event happening on a contract. Since I'm doing this for the first time, I chose a popular liquidity pool, the "Cake" liquidity pool on ...
你的老师's user avatar
0 votes
0 answers
28 views

Unable to deposit tokens into the contract when the user's balance within the contract is 0

I'm working on a web-based interaction with a smart contract that allows users to deposit and withdraw tokens. I've noticed that when the user's balance within the contract is 0, they cannot deposit ...
user120629's user avatar
0 votes
1 answer
165 views

Is it possibleimpersonate an account using only ethers.js without using Hardhat

Is it possible to impersonate an account using ether js only? I don't want to use Hardhat. Though I have forked mainnet using foundry. Now wants to transfer eth of let's say vitalik to my own account ...
DEEPAK Kumar's user avatar
0 votes
0 answers
52 views

Error: network does not support ENS (operation=“ENS”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/5.5.3 this error is comingabc

When I try to access address as endpoints on getstaticpaths the error is coming Error: network does not support ENS (operation=“ENS”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/...
Yasir's user avatar
  • 1
0 votes
0 answers
341 views

window.ethereum.request({method: "eth_requestAccounts"}) automatically picks the connected account when making a transaction

I have multiple accounts on my Metamask wallet(Most of them are connected to the site). But my selected account is not connected to the Dapp. So, when I try to send a transaction it uses one of the ...
Ishmam Tasin's user avatar
0 votes
0 answers
55 views

Error: EACCES: permission denied, mkdir '/root/.config/hardhat-nodejs'

While compiling below errors occurs anyone please look into this Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support An unexpected error occurred: Error: EACCES: ...
Internet and Computer Probe's user avatar
0 votes
1 answer
93 views

Error while compiling contracts: Cannot find module '@nomiclabs/hardhat-truffle5'

Below error occurs while compiling smart contracts through hardhat. npx hardhat compile --show-stack-traces An unexpected error occurred: Error: Cannot find module '@nomiclabs/hardhat-truffle5' ...
Internet and Computer Probe's user avatar
0 votes
1 answer
570 views

Error: Returned error: nonce too low

const Web3 = require('web3'); const { ethers } = require('ethers'); const { Web3Provider } = require('@ethersproject/providers'); // Virtual addresses const fromAddress = '...
Amin Hlel's user avatar
0 votes
0 answers
31 views

Is there any way to get the array length inside a mapping without a getter function or count variable?

mapping(address => uint256[]) public submitterAddressToFormIdsAssigned; This is a mapping from an address to an array of uint256s. I want to get the length of array. I used a count variable before ...
Gaurav Pant's user avatar
1 vote
0 answers
66 views

How to let client side sign the transaction and send it to blockchain

This mint function is giving me this error Uncaught (in promise) Error: Returned error: transaction could not be decoded: unsupported transaction type And if I use ethereum-js/tx module to serialize ...
kaan.py's user avatar
  • 11
0 votes
0 answers
61 views

Error: Keys not exchanged when calling await ethereum.request({method: 'eth_requestAccounts'})

I am trying to connect my React Native app to MetaMask with MetamaskSDK, but I am getting the error "Error: Keys not exchanged" when calling await ethereum.request({method: '...
matanCohen's user avatar

1
3 4
5
6 7
122