|
|
|
@ -6,6 +6,13 @@ pragma solidity ^0.8.0; |
|
|
|
|
import "./IERC20.sol"; |
|
|
|
|
import "./IERC165.sol"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Interface of an ERC1363 compliant contract, as defined in the |
|
|
|
|
* https://eips.ethereum.org/EIPS/eip-1363[EIP]. |
|
|
|
|
* |
|
|
|
|
* Defines a interface for ERC20 tokens that supports executing recipient |
|
|
|
|
* code after `transfer` or `transferFrom`, or spender code after `approve`. |
|
|
|
|
*/ |
|
|
|
|
interface IERC1363 is IERC165, IERC20 { |
|
|
|
|
/* |
|
|
|
|
* Note: the ERC-165 identifier for this interface is 0xb0202a11. |
|
|
|
@ -21,53 +28,53 @@ interface IERC1363 is IERC165, IERC20 { |
|
|
|
|
/** |
|
|
|
|
* @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver |
|
|
|
|
* @param to address The address which you want to transfer to |
|
|
|
|
* @param value uint256 The amount of tokens to be transferred |
|
|
|
|
* @param amount uint256 The amount of tokens to be transferred |
|
|
|
|
* @return true unless throwing |
|
|
|
|
*/ |
|
|
|
|
function transferAndCall(address to, uint256 value) external returns (bool); |
|
|
|
|
function transferAndCall(address to, uint256 amount) external returns (bool); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver |
|
|
|
|
* @param to address The address which you want to transfer to |
|
|
|
|
* @param value uint256 The amount of tokens to be transferred |
|
|
|
|
* @param amount uint256 The amount of tokens to be transferred |
|
|
|
|
* @param data bytes Additional data with no specified format, sent in call to `to` |
|
|
|
|
* @return true unless throwing |
|
|
|
|
*/ |
|
|
|
|
function transferAndCall(address to, uint256 value, bytes memory data) external returns (bool); |
|
|
|
|
function transferAndCall(address to, uint256 amount, bytes memory data) external returns (bool); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver |
|
|
|
|
* @param from address The address which you want to send tokens from |
|
|
|
|
* @param to address The address which you want to transfer to |
|
|
|
|
* @param value uint256 The amount of tokens to be transferred |
|
|
|
|
* @param amount uint256 The amount of tokens to be transferred |
|
|
|
|
* @return true unless throwing |
|
|
|
|
*/ |
|
|
|
|
function transferFromAndCall(address from, address to, uint256 value) external returns (bool); |
|
|
|
|
function transferFromAndCall(address from, address to, uint256 amount) external returns (bool); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver |
|
|
|
|
* @param from address The address which you want to send tokens from |
|
|
|
|
* @param to address The address which you want to transfer to |
|
|
|
|
* @param value uint256 The amount of tokens to be transferred |
|
|
|
|
* @param amount uint256 The amount of tokens to be transferred |
|
|
|
|
* @param data bytes Additional data with no specified format, sent in call to `to` |
|
|
|
|
* @return true unless throwing |
|
|
|
|
*/ |
|
|
|
|
function transferFromAndCall(address from, address to, uint256 value, bytes memory data) external returns (bool); |
|
|
|
|
function transferFromAndCall(address from, address to, uint256 amount, bytes memory data) external returns (bool); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender |
|
|
|
|
* and then call `onApprovalReceived` on spender. |
|
|
|
|
* @param spender address The address which will spend the funds |
|
|
|
|
* @param value uint256 The amount of tokens to be spent |
|
|
|
|
* @param amount uint256 The amount of tokens to be spent |
|
|
|
|
*/ |
|
|
|
|
function approveAndCall(address spender, uint256 value) external returns (bool); |
|
|
|
|
function approveAndCall(address spender, uint256 amount) external returns (bool); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender |
|
|
|
|
* and then call `onApprovalReceived` on spender. |
|
|
|
|
* @param spender address The address which will spend the funds |
|
|
|
|
* @param value uint256 The amount of tokens to be spent |
|
|
|
|
* @param amount uint256 The amount of tokens to be spent |
|
|
|
|
* @param data bytes Additional data with no specified format, sent in call to `spender` |
|
|
|
|
*/ |
|
|
|
|
function approveAndCall(address spender, uint256 value, bytes memory data) external returns (bool); |
|
|
|
|
function approveAndCall(address spender, uint256 amount, bytes memory data) external returns (bool); |
|
|
|
|
} |
|
|
|
|