julien/lovepublic Fork 0
92dc0c79aceff6c4cc680853544b8d15e08396f6
Commits
Clone
git clone https://git.rickub.com/julien/love.git
git clone ssh://git@rickub.com/julien/love.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

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