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

Feeding a Smart contract with large Data

I want to feed a smart contract with multiple 5000 or more wallet addresses (for whitelisting purposes) in an array in a single transaction. How can I achieve that without sending data in chunks? ...
Bhushan Dhiware's user avatar
0 votes
0 answers
15 views

WEB DEV AND BLOCKCHAIN [closed]

HELP PLEASE Guys! All of these Web3 apps and websites for all of these blockchain projects are so seamless and elegant. Are there any resources that can help me build a website that look like these? ...
Joey Ettinger's user avatar
0 votes
2 answers
27 views

Is it possible to make an atomic transaction using web3.js only?

I am currently working on a project using web3.js that invloves making 2 transactions atomically. Is it possible to pass those 2 transactions in a single transaction object to make it atomic or is the ...
John's user avatar
  • 1
0 votes
0 answers
19 views

I can't Compile [closed]

√ Fetching solc version list from solc-bin. Attempt #1 √ Fetching solc version list from solc-bin. Attempt #2 √ Fetching solc version list from solc-bin. Attempt #3 √ Fetching solc version list from ...
Ashutosh Mishra's user avatar
1 vote
0 answers
17 views

Solidity: getStudentNotifications Retrieves notifications to other metamask account instead of one metamask account

I have two metamask accounts, one is Vamshi (student) and Mike(University). I use Vamshi's account to call the function sendRecordsToUniversity and the university address, I use here is Mike's. so the ...
Robert Downey Jr.'s user avatar
0 votes
1 answer
26 views

How to transfer entire address balance to another address

After going through the questions here and here I came up with the code below to transfer the entire balance from one address to another using web3.js. export async function sendTransaction( ...
Zero's user avatar
  • 103
2 votes
3 answers
43 views

How does Etherscan decode unverified contracts events?

Etherscan is able to decode event data from unverified contracts, even without an exposed ABI. Below is an example screenshot. No signature available for this event. I've been able to replicate the ...
user130657's user avatar
0 votes
1 answer
18 views

Etherscans ABI and transaction receipt topic[0] are different. Bug?

I need simply to get Transfer data values from transaction with 1 log https://etherscan.io/tx/0x6465187a7bb43a6db42ee63e5f5cc30fb094393957a7f1ce6c08b5afddf3e0bc. It sends +7,601.747 LINK. The problem ...
sirjay's user avatar
  • 111
0 votes
1 answer
10 views

InvalidResponseError: Returned error: unknown account

I'm attempting to sign a transaction using an account stored locally on my system. In the code below, you can see that I'm reading the file of that account and all other accounts stored using the ...
Alireza's user avatar
  • 533
1 vote
1 answer
106 views

Web3 Contract (React) - SafeERC20 Low Level Call failed with ERC20 Token (USDT)

I am working since 8 days on a problem with my smart contract and / or with my Web3 App. If I try to use the contract with ETH it works well in the moment I try to use it with an ERC20 token (USDT) it ...
Aleksandar's user avatar
1 vote
1 answer
28 views

Cannot send USDT on Polygon : Error happened while trying to execute a function inside a smart contract

//token_address is the adress of the contract : 0xc2132D05D31c914a87C6611C10748AEb04B58e8F //because USDT on polygon is a Proxy contract, minABI is the abi of the contract where it redirect : https://...
Francois's user avatar
1 vote
1 answer
12 views

How to integrate a web3 browser in my crypto wallet expo app

I have created a crypto wallet using Expo and now want to integrate a web3 browser like they have in metamask or trustwallet. i don't know how to start, any guidance or article or help will be highly ...
Shivam Yadav's user avatar
0 votes
1 answer
15 views

Transaction fees too high for swapExactETHForTokens

I've written a script to buy tokens in javascript. The issue is I keep getting an error showing abnormally high transaction fees. This is my script const buyFunction = this.pancakeContract.methods....
ahabsy's user avatar
  • 1
0 votes
0 answers
19 views

Swapping tokens with code

how do I swap tokens using java script in pancake swap v3 I'm looking for source code but not finding it anywhere
RichMond's user avatar
1 vote
2 answers
22 views

How does the real Ether work in ERC20 protocol?

I am reading ERC20 protocol and learning how that is implemented from OpenZeppelin: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol The code demoed ...
Joey Yi Zhao's user avatar
0 votes
1 answer
14 views

Why is the gas fee shown on Ether scan is different than the transaction I sent?

I sent a transaction to Ethereum test network sepolia as below code: const transaction = { from: account.address, to: contractAddress, gas: 202419, ...
Joey Yi Zhao's user avatar
1 vote
1 answer
31 views

How to get revert message in Web3js?

I want to get the revert massage from a send method call to a smart contract. So I use: receipt.logs[0].data that is a string containing a hexadecimal value. Now I want to to decode this value to get ...
Alireza Zojaji's user avatar
0 votes
1 answer
11 views

Metamask Mobile problem

code: if (!$metamask.states.connected || !connectedAddress.value) { errorMessage.value = 'Please connect your wallet first.'; showModalError.value = true; return; } let ...
brok 3's user avatar
  • 1
0 votes
0 answers
10 views

Unhandled Rejection (Error): ENS is not supported on network private

Unhandled Rejection (Error): ENS is not supported on network private l.<anonymous> /packages/web3-eth-ens/lib/ENS.js:481 478 | if (!this._detectedAddress) { 479 | var networkType = await ...
Nishant Patil's user avatar
0 votes
0 answers
14 views

The 'myEvent' is not being set in the getPastEvents function of web3.js

I am using "web3" : "4.5.0" I am trying to use the getPastEvents function in accordance with the official documentation of web3.js to view the emitted events for a specific event. ...
권승미's user avatar
0 votes
2 answers
33 views

Send a transaciton to Sepolia network but it can't be found from `sepolia.etherscan.io`

I am using below code to call a smart contract deployed in Sepolia network. const w = new Web3('https://rpc.sepolia.org'); await w.eth.accounts.signTransaction( { from: ...
Joey Yi Zhao's user avatar
0 votes
0 answers
27 views

Etherscan API doesn't return internal transaction (although it has)

Here is transaction https://etherscan.io/tx/0x33e0dab83aa27ba8b2a08b3c69d61a34911a4adb6e7a35dd30cf11383f43fcc3 with simple Transfer() some GALA tokens. Etherscan shows 1 internal transaction: But it'...
sirjay's user avatar
  • 111
0 votes
1 answer
23 views

Does subscribe("newBlockHeader",...) consistently provide the header of the most recent block?

Assuming we are trying the blow code that subscribes to incoming block headers and returns the header of the i-th block in the ledger, triggering the execution of the callback function in then(). If ...
Alireza's user avatar
  • 533
1 vote
1 answer
27 views

how to get project id from infura

import { createAgent, IResolver } from '@veramo/core' import { DIDResolverPlugin } from '@veramo/did-resolver' import { getResolver as ethrDidResolver } from 'ethr-did-resolver' import { getResolver ...
Lebusetsa Moorosi's user avatar
0 votes
1 answer
43 views

Why Etherscan's API missing ABI functions?

Here is transaction https://etherscan.io/tx/0x0db6f8036ca7ea58bf4a8799bbf62bb30e3431d644d37d4030c27ac0d22f7542#eventlog In logs we can see 3rd function SendToInjectiveEvent(). It is interaction with ...
sirjay's user avatar
  • 111
0 votes
0 answers
50 views

How to get service fee when deploying smart contract (Web3.js)

I am trying to get service fee from every contract deployment on my website frontend, when I run this, the contract is being deployed to testnet successfully but the amount I specified in 6th argument ...
Nah Bulursun's user avatar
1 vote
1 answer
32 views

What is the metamask algorithm for creating accounts based on one seed phrase?

Metamask uses one seed phrase to generate other accounts. Thus, with one seed phrase you can restore all accounts. But what is the algorithm for this? I want a script that could show 10 of my accounts ...
Илья Зеленько's user avatar
0 votes
0 answers
57 views

MetaMask Gas Estimation Error in Staking dApp: "We were not able to estimate gas" without Sufficient Native Tokens. Big gas fee

I'm developing a staking dApp and have encountered a peculiar issue with MetaMask when attempting to execute transactions without sufficient native tokens in the wallet. MetaMask displays the error ...
Nikola Skadric's user avatar
1 vote
1 answer
101 views

How to fix error with deploy my Next.js project?

I have my project that I want to deploy to Vercel but when I'm trying to deploy it I got error Failed to compile. ./node_modules/@wagmi/core/dist/esm/actions/getProof.js Attempted import error: '...
Victor's user avatar
  • 45
1 vote
0 answers
21 views

Represent UUIDv4 string as bytes16 in event topic

I am trying to emit an Event with UUIDv4 indexed string. Example contract: contract EventEmitter { event ExampleEvent(string indexed id); function dispatchEvent(string memory _uuid) public { ...
Marcin's user avatar
  • 111
1 vote
1 answer
25 views

How do i read sales here?

I've been trying to read the sales in this transaction. Tried to read "Execution721MakerFeePacked" event But could not understand anything from it. Tried seeing what NFTs got transferred and ...
Ladybug's user avatar
  • 11
0 votes
0 answers
12 views

There isn't fail reason when the transaction failed to execute with Web3.js 4.x

Environment OS: Ubuntu 20.04 Node: v18 Web3: 4.4.0 Code Snippet Solidity function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ...
george huang's user avatar
0 votes
0 answers
46 views

eth_sign invalid "from" address in signature in Trust Wallet browser extension or 0 balance when user has money

Problem I have code for sending 1 dollar from user to my account. It always works for all wallets except the trust wallet extension (trust wallet mobile works also). When I watch the result ...
noofdmsl1987's user avatar
1 vote
0 answers
36 views

Web3 Provider not available. Use `.setProvider` or `.provider=` to initialize the provider

Modified today Viewed 2 times 0 Hi i cain't get my code to work as it use to a few months back and I caint figure out why can anyone support I appreciate it, I tried a few things but none worked. I ...
David Dacruz's user avatar
1 vote
1 answer
23 views

How to get signature by JS with contract use ECDSA verify

I want get signature by Javascript
ltt88's user avatar
  • 23
0 votes
0 answers
21 views

Fail with error 'Incorrect Ether amount'

I am trying to set up a very basic presale using Remix IDE. 0x96AAC35C248C48418eF9A939e3eB8b9a64207532 --> Presale Contract 0xF60EeA9ab4B520846CA01D368A08cD4b71B619f8 --> Token itself This is ...
Jim Mike's user avatar
0 votes
0 answers
5 views

Calling function from smart contracts after connection using connectWallet SDK react native

I have connected my react native app to metamask using wallet connect sdk now I want to call functions from a smart contract which is deployed on the binance test net. I was thinking I could achieve ...
user130561's user avatar
0 votes
0 answers
25 views

How to sign transaction for two usdt receivers (same sender)?

I have a working code for creating a signed USDT transaction using web3js, but I am not successful in adding another receiver in the same signed transaction. How can I send USDT to two separate ...
CryptoCoder's user avatar
0 votes
0 answers
16 views

How to generate new Breed NFT Image?

How do I use two NFT images to create a new NFT through breeding? I'm a bit confused about this. I've used different attributes for coverage. now I want to generate the image as well. For example, if ...
Maidi's user avatar
  • 121
0 votes
0 answers
33 views

Creating a signed transaction USDT / matic

I want to create a signed transaction that sends USDT to two different receivers, using MATIC. I have a polygon node working (from Alchemy), but I am currently stuck on this error: ...
CryptoCoder's user avatar
0 votes
0 answers
14 views

Declaration "ERC721" not found in "c:/Users/

//SPDX-License-Identifier: Unlicense pragma solidity >=0.8.0; import {ERC721} from "@openzeppelin/contracts/utils/Counters.sol"; // i get error in this line import {ERC721} from "@...
Royhan Nulloh's user avatar
0 votes
1 answer
73 views

Subject: Facing "TypeError: invalid private key" during deployment

Description: I'm encountering an issue while attempting to deploy a contract using ethers.js. The error message I'm receiving is as follows: Error: TypeError: invalid private key (argument="...
Amine Merad's user avatar
0 votes
1 answer
38 views

Return value of contract function in web3 is array, not uint

I am working on the ethernaut game to learn about solidity and the ethereum ecosystem. I solved the Fallback problem, but don't understand the interaction below. The basic question is: the contract ...
kasterma's user avatar
  • 103
0 votes
1 answer
25 views

Possible to get latest NFT from a collection with web3.js?

I want to show the most current NFT from a collection on a website. Is this possible with web3.js? I have a working example how to load all NFTs from a collection which are owned by a certain wallet ...
aronsommer's user avatar
0 votes
1 answer
74 views

Token Balance not changing after simulating swap on uniswap v2

Hi I am trying to mock the process of buying and selling token through uniswap v2 router. I start with a local network fork anvil --fork-url https://mainnet.infura.io/xxx Then I have to do 2 things ...
newbiesolidty's user avatar
0 votes
0 answers
57 views

ResponseError: Returned error: err: insufficient funds for gas * price + value

=====USING=== Sepolia Testnet, metamask, web3js and walletConnectModel =====ERROR=== sendSignedTransaction error: ResponseError: Returned error: err: insufficient funds for gas * price + value: ...
Rommer 's user avatar
0 votes
0 answers
19 views

How can I get strategy of the Linea-Goerli with the vault address?

Like in mantle, we can get the strategy and the contract by navigating to the site https://explorer.mantle.xyz/address/{} How can I get the same for the line I have tried the https://explorer.goerli....
Lakshay khattar's user avatar
0 votes
1 answer
43 views

Getting EVM error when trying to call a basic contract using Javascript

I am a complete beginner when it comes to writing javascript so bear with me. I want to write a basic .js file that I can run that will be able to sell something for BNB (in this case a very small ...
Jewbacca79's user avatar
0 votes
0 answers
18 views

analysing a wallet on a specific contract (web3js/ethers)

is it possible to obtain the transactions of an eth address on a given contract (nft)? at the moment the os API does not allow this, or rather, I would have to iterate over all wallet transactions ...
klok's user avatar
  • 1
0 votes
1 answer
60 views

python web3 account sign_message with nonce

I want to sign message for login dapp, The message is like "Welcome !" and have Nonce. How can I using sign_message function with nonce? In the Metamask show like below.
정승원's user avatar

1
2 3 4 5
123