From the smark contract to get WETH from ETH on this link https://goerli.etherscan.io/address/0xccb14936c2e000ed8393a571d15a2672537838ad#writeContract

To make the deposit function work I have to code it like weth.deposit({"from": account, "value": 0.02 * 10 ** 18}) and the withdraw function like weth.withdraw(0.02 * 10 ** 18,{"from": account}) I don't understand the logic of the difference.

enter image description here

1 Answer 1


On the deposit function you need to send your ethereum in a transaction, in the withdraw one you call the withdraw function with the amount parameter. They will do the transfer to you. (If you used the same call as the first one you would send your ethers to the contract)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.