I'm attempting to wrap ETH on Goerli into WETH by calling deposit
function using ethers. Even though several TX already have been confirmed and successfully mined, nothing will appear on my WETH balance at goerli.etherscan.io
in the dropdown Token Holdings
. No is there WETH
there at all, whereas there're other tokens
async function myWrap(prKey) {
let wallet = new ethers.Wallet(prKey, provider);
const contract = new ethers.Contract(WETH_CONTRACT_ADDRESS, WETH_ABI, wallet);
const txSigner = contract.connect(wallet);
const balance = await provider.getBalance(wallet.address);
const gasPrice = await provider.getGasPrice();
const balanceMinusGas = balance.sub(gasPrice.mul(ETH_GAS_LIMIT));
let tx = txSigner.deposit({value: balanceMinusGas});
return tx;
}
What's the matter?
Moreover, at https://goerli.etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 my TX-s are present.
update1
Additionally, I then have tried to call
let amount = ethers.utils.parseEther(<sum of all previous ETH-s transfers>);
contract.transfer(wallet.address, amount);
yet, to no avail
update 2
I'd forgotten to mention that it was on Goerli. I've now switched to 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6
which is the correct address of WETH.
However, calling contract.deposit()
still haven't gotten me any WETH. Although, again, all the calls have been successfully mined.