Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

1 vote

Want to redirect to react component based on metamask address

Instead of defining and calling your redirectBasedOnAccount function inside useEffect. You need to define it outside its scope, and call the same inside the return of your App.jsx. Also, you need to ...
SYED ASAD KAZMI's user avatar
1 vote

Can't catch Web3.js' contract error when calling a method and cancelling the transaction

Nevermind, mystery solved: Short answer: There's a bug in Phantom's wallet that prevents the dApp from catching the error. After trying again with MetaMask, everything was working as expected: The ...
Danziger's user avatar
  • 131
0 votes

How to keep wallet connection persistent when refreshing with Ethersjs

I noticed that when I use the useEffect hook inside the connectWallet(), the connectWallet function will be called on initial page load because of the empty dependency array [] without the user ...
Web3Phoenix's user avatar
0 votes

TotalSupply of token not showing

Your code appears suitable for fetching the total supply of an ERC20 token using React. Just make sure your contract address and ABI are correct. Start by confirming that the contract ABI is accurate. ...
Awais Ahmad's user avatar

Top 50 recent answers are included