|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity >=0.6.2; |
| 3 | + |
| 4 | +/// @title IERC7914 |
| 5 | +interface IERC7914 { |
| 6 | + /// @notice Thrown when the caller's allowance is exceeded when transferring |
| 7 | + error AllowanceExceeded(); |
| 8 | + /// @notice Thrown when the sender is not the expected one |
| 9 | + error IncorrectSender(); |
| 10 | + /// @notice Thrown when the transfer of native tokens fails |
| 11 | + error TransferNativeFailed(); |
| 12 | + |
| 13 | + /// @notice Emitted when a transfer from native is made |
| 14 | + event TransferFromNative(address indexed from, address indexed to, uint256 value); |
| 15 | + /// @notice Emitted when a native approval is made |
| 16 | + event ApproveNative(address indexed owner, address indexed spender, uint256 value); |
| 17 | + /// @notice Emitted when a transfer from native transient is made |
| 18 | + event TransferFromNativeTransient(address indexed from, address indexed to, uint256 value); |
| 19 | + /// @notice Emitted when a transient native approval is made |
| 20 | + event ApproveNativeTransient(address indexed owner, address indexed spender, uint256 value); |
| 21 | + /// @notice Emitted when the native allowance of a spender is updated when a transfer happens |
| 22 | + event NativeAllowanceUpdated(address indexed spender, uint256 value); |
| 23 | + |
| 24 | + /// @notice Returns the allowance of a spender |
| 25 | + function nativeAllowance(address spender) external view returns (uint256); |
| 26 | + |
| 27 | + /// @notice Returns the transient allowance of a spender |
| 28 | + function transientNativeAllowance(address spender) external view returns (uint256); |
| 29 | + |
| 30 | + /// @notice Transfers native tokens from the caller to a recipient |
| 31 | + /// @dev Doesn't forward transferFrom requests - the specified `from` address must be address(this) |
| 32 | + function transferFromNative(address from, address recipient, uint256 amount) external returns (bool); |
| 33 | + |
| 34 | + /// @notice Approves a spender to transfer native tokens on behalf of the caller |
| 35 | + function approveNative(address spender, uint256 amount) external returns (bool); |
| 36 | + |
| 37 | + /// @notice Transfers native tokens from the caller to a recipient with transient storage |
| 38 | + /// @dev Doesn't forward transferFrom requests - the specified `from` address must be address(this) |
| 39 | + function transferFromNativeTransient(address from, address recipient, uint256 amount) external returns (bool); |
| 40 | + |
| 41 | + /// @notice Approves a spender to transfer native tokens on behalf of the caller with transient storage |
| 42 | + function approveNativeTransient(address spender, uint256 amount) external returns (bool); |
| 43 | +} |
0 commit comments