Questions tagged [web3js]

Use this tag with questions about programming for the Ethereum JavaScript API.

Web3.js is open source and continuously updated since 2015. It has everything you need to start interacting with the Ethereum blockchain, giving easy access to accounts, events, smart contracts.

Useful links

2372 questions
0
votes
1 answer

How to read Ethereum contract storage values which are not emitted?

I want to read the contract storage for '0x9EC55d57208cb28a7714A2eA3468bD9d5bB15125' at block 16368474 on BSC . I tried - const Web3 = require('web3') const rpcURL = "https://bsc-dataseed1.binance.org/" const web3 = new Web3(rpcURL) let…
shadow
  • 33
  • 4
0
votes
0 answers

Metamask keeps rotating the loader when I call Approve() method of token in web3

I'm an entry-level blockchain developer, so I often get stuck, but the community here is always there to help with the already asked questions, but this time I couldn't get what I need. What I'm actually trying to accomplish is that I have deployed…
Naveed Ali
  • 101
  • 2
0
votes
1 answer

How to transfer ERC-721 tokens from multiple wallets to a single wallet?

Is it possible to transfer ERC-721 tokens from multiple wallets to a single wallet in one transaction? If not, is there another quick way? I'm interested as I mint a lot of tokens (50+) to multiple wallets, and want to merge these all into one…
0
votes
1 answer

Transform button into text after condition is true

I'm using the AppBar component of material-ui library, I added a button, I'd say it's hardcoded in the AppBar, I'm trying to transform this button to just a text in the AppBar, but I got nothing. How can I transform the button in the AppBar to just…
0
votes
2 answers

How to call function on web3

I'm trying to call a function on web3, but it doesn't get executed on web3. It just doesn't popup Metamask wallet to ask for the transaction approval, so it doesn't execute. Solidity function: function Deposit(uint _amount) payable public{ …
brt88
  • 37
  • 6
0
votes
2 answers

can not use web3js send() or call() function

I have a smart contract addOwner function that accepts some param : // add owner to the contract function addOwner(string[] memory _name, address[] memory _owner_address,uint _confirmationOfOwner) public onlyOwner { …
Dara
  • 37
  • 1
  • 7
0
votes
1 answer

Can not deploy my contract when i use estimateGas()

I can not deploy my contract when I use estimateGas() actually estimateGas() and the gasUsed in error is the same. Why does this happen? How to fix this problem? my code: const deployedContract = await deployTx.send({ from:…
Dara
  • 37
  • 1
  • 7
0
votes
1 answer

How to connect my web3 app only to Meta Mask wallet

I am trying to build an app with web3js. I use JavaScript for connecting the app to wallet. const accounts = await web3.eth.requestAccounts().catch((error) => { $('#walletErrorMsg').html(error.message); …
Amal S R
  • 870
  • 7
  • 21
0
votes
1 answer

How to show data from json file that is linked to logged in users wallet address in next.js?

I'm trying to make a claim page in next.js that would allow logged in metamask address to: read data provided in .json file locally to see if the account is eligible for claiming the item and rendering a claim page on submiting form to write to…
Kristaps
  • 21
  • 4
0
votes
0 answers

Why does my code thing deployed() is not a function?

code: loadContract: async ()=>{ //Create JS version of smart contract const todoList = await $.getJSON('TodoList.json') App.contracts.TodoList = TruffleContract(todoList) App.contracts.TodoList = web3.setProvider(new…
Daniel
  • 1
  • 3
0
votes
2 answers

useing web3 in React has error : webpack < 5 used to include polyfills for node.js core modules by default

I tried use web3 in Reactjs but when I import web3 it has error : webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. I use nodejs…
hora
  • 25
  • 5
0
votes
1 answer

is it possible to get metamask account name using web3 or any other way?

I've tried to search in Metamask doc, but I did not find anything about the account info, so is there any API or can I use Web3 to get the account name?
Bruce Zhu
  • 3
  • 1
0
votes
1 answer

Web3 contract.methods.approve(contractAddress, value), how to prompt user to approve using test account address?

I am able to call Smart contract methods from client machine in development env: example: contract.methods.allowance contract.methods.approve and I can see the transactions in Ganache UI returned from contract.methods.approve Which is fine.…
McDev
  • 11
  • 2
0
votes
0 answers

Struct Not Updating Using Ethers

I have an array of struct Campaign. The function launch adds a new Campaign to the array. After that when a user sends some ETH using the pledge function, the transaction succeeds and the eth gets sent but the struct doesn't get updated. I'm using…
0
votes
1 answer

On mainnet-beta, signMetadata() returns a program error, whereas it works on devnet

The odd part is, the transactions both look completely successful. It's just that signMetadata throws an exception when using mainnet-beta. Two txns for comparison, using identical code: Mainnet-beta:…
Kyle
  • 1,054
  • 2
  • 14
  • 27
1 2 3
99
100