Last active
May 15, 2023 09:43
-
-
Save PaulRBerg/7415a407fd5209d781163aa015c8f517 to your computer and use it in GitHub Desktop.
Generic interface for wrapping native assets into ERC-20 form
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.19; | |
import { IERC20 } from "@openzeppelin/token/ERC20/IERC20.sol"; | |
/// @notice An interface for contracts that wrap native assets in ERC-20 form, such as WETH. | |
/// @dev A generic name is used instead of "WETH" to accommodate chains with different native assets. | |
interface IWrappedNativeAsset is IERC20 { | |
/// @notice Deposits native assets to receive ERC-20 wrapped assets. | |
function deposit() external payable; | |
/// @notice Withdraws ERC-20 wrapped assets to obtain native assets. | |
/// @param amount The amount of ERC-20 wrapped assets to withdraw. | |
function withdraw(uint256 amount) external; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment