DepositAndWithdraw.sol
This contract handles the wrapping and unwrapping of ETH for the sender.
Deposit Instructions for the Sender:
- Sender should hold an ETH balance to begin with.
- Sender will deposit a desired amount of ETH in the contract by calling the 'Deposit()' function
- Sender will then hold a WETH balance in the WETH contract.
Withdraw Instructions for the Sender:
- Sender might want to unwrap WETH to hold an ETH balance.
- Sender calls the 'Withdraw(uint256)' function by specifying the amount of WETH.
- Sender can check the ETH balance by calling the 'getUserETHBalance()'
- Sender then calls the 'safeWithdraw(uint256' which has the noReentrance guard, to withdraw funds.
Goerli TestNet npx hardhat run scripts/2_deploy_DepositAndWithdraw.js --network goerli
npx hardhat verify "0x80865853E1f195445Fa33a9a99862c5071dCA518" "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" --network goerli
Goerli Testnet Contract Address https://goerli.etherscan.io/address/0x80865853E1f195445Fa33a9a99862c5071dCA518#code