-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(contracts-rfq):
TokenZapV1
native gas token behaviour [SLT-389] (…
…#3418) * test: add multi-hop tests for `TokenZapV1` * fix: `TokenZap` should be able to receive ETH * test: existing ETH balance, using lower `msg.value` * fix: `TokenZap` should be able to use previosuly acquired ETH * test: `TokenZap` should be able to do native transfers * fix: native ETH transfers to EOAs * docs: better wording for `msg.value` usage * docs: minor fixes * test: more revert cases around empty target / payload * fix: check for empty target * fix: separate the pure native gas token transfer case * chore: silence solhint warning in the test mock
- Loading branch information
1 parent
91dee92
commit ee3705a
Showing
3 changed files
with
347 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
import {Address} from "@openzeppelin/contracts/utils/Address.sol"; | ||
|
||
// solhint-disable no-empty-blocks | ||
/// @notice WETH mock for testing purposes. DO NOT USE IN PRODUCTION. | ||
contract WETHMock is ERC20 { | ||
constructor() ERC20("Mock Wrapped Ether", "Mock WETH") {} | ||
|
||
receive() external payable { | ||
deposit(); | ||
} | ||
|
||
/// @notice We include an empty "test" function so that this contract does not appear in the coverage report. | ||
function testWETHMock() external {} | ||
|
||
function withdraw(uint256 amount) external { | ||
_burn(msg.sender, amount); | ||
Address.sendValue(payable(msg.sender), amount); | ||
} | ||
|
||
function deposit() public payable { | ||
_mint(msg.sender, msg.value); | ||
} | ||
} |
Oops, something went wrong.