// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract WETH9 is ERC20 { event Deposit(address indexed sender, uint256 amount); event Withdrawal(address indexed sender, uint256 amount); constructor() ERC20("Wrapped Ether", "WETH") {} function deposit() public payable { _mint(msg.sender, msg.value); emit Deposit(msg.sender, msg.value); } function withdraw(uint256 amount) public { _burn(msg.sender, amount); payable(msg.sender).transfer(amount); emit Withdrawal(msg.sender, amount); } function totalSupply() public view override returns (uint256) { return address(this).balance; } }