1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
/// @notice Minimal stand-in for WETH9: wraps ETH 1:1, same 18 decimals, same
/// `deposit`/`withdraw` entrypoints. Test-only.
contract MockWETH is ERC20 {
constructor() ERC20("Wrapped Ether", "WETH") {}
receive() external payable {
deposit();
}
function deposit() public payable {
_mint(msg.sender, msg.value);
}
function withdraw(uint256 amount) external {
_burn(msg.sender, amount);
payable(msg.sender).transfer(amount);
}
}
|