How can I use WETH with Metamask wallet? I can see ETH in my Metamask (Rinkeby TestNet, it works on Mainnet) but can not use other tokens. Any Repository or lead will be appreciated. If yes, What will be token Contract address it asks for? Also, How can ether.js/web3.js be used to find WETH balance of wallet address?
-
Does this answer your question? "Add Token" in Metamask– Lauri PeltonenCommented Jun 3, 2022 at 5:36
-
No, I need to also know if Metamask wallet can be used to import WETH token in Rinkeby test network? If yes, What will be token Contract address it asks for?– Rohit MittalCommented Jun 3, 2022 at 5:53
-
1@RohitMittal Do you want to convert ETH into WETH?– Ismael ♦Commented Jun 3, 2022 at 15:42
1 Answer
All ERC20 tokens are fully supported in Metamask, and WETH is an ERC20 token. The tricky thing is that you have to manually add the tokens, since otherwise Metamask doesn't know which tokens you have.
The extra tricky part with WETH is that there are numerous versions of the WETH token contract, in different addresses. I'm not 100% sure, but I think the version Uniswap uses is the most popular. Basically you have to check the projects you are interested in, to see which version they use. Here are the WETH addresses for different networks which Uniswap uses: https://docs.uniswap.org/protocol/reference/deployments (scroll down).
To use ethers.js to get a token balance, check for example here: How to get the ERC-20 token balance of an account using etherjs? or https://stackoverflow.com/questions/71106843/check-balance-of-erc20-token-in-hardhat-using-ethers-js
-
How can ether.js/web3.js be used to find WETH balance of wallet address? Commented Jun 3, 2022 at 6:04
-