IERC1363
Title: IERC1363
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/interfaces/IERC1363.sol)
Interface of the ERC-1363 payable token (https://eips.ethereum.org/EIPS/eip-1363): an ERC-20 extension
that calls the recipient after transfer/transferFrom and the spender after approve, in one
transaction. Its interfaceId is the canonical 0xb0202a11.
Declares only the six ERC-1363 functions, so type(IERC1363).interfaceId is the standard id. The ERC-20
surface stays under IERC20 and ERC-165 under the diamond's supportsInterface. The errors come from
OpenZeppelin's ERC1363 (the three *Failed) and ERC1363Utils (the two Invalid*).
Functions
transferAndCall
Moves value tokens from the caller to to, then calls IERC1363Receiver.onTransferReceived on to.
function transferAndCall(address to, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| to | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | True unless it reverts. |
transferAndCall
Variant of transferAndCall that forwards data to the receiver.
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| to | address | |
| value | uint256 | |
| data | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
transferFromAndCall
Moves value tokens from from to to using the caller's allowance, then calls
IERC1363Receiver.onTransferReceived on to.
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | True unless it reverts. |
transferFromAndCall
Variant of transferFromAndCall that forwards data to the receiver.
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| value | uint256 | |
| data | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
approveAndCall
Sets value as spender's allowance over the caller's tokens, then calls
IERC1363Spender.onApprovalReceived on spender.
function approveAndCall(address spender, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | True unless it reverts. |
approveAndCall
Variant of approveAndCall that forwards data to the spender.
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | |
| value | uint256 | |
| data | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
Errors
ERC1363TransferFailed
The transfer part of a transferAndCall returned false.
error ERC1363TransferFailed(address receiver, uint256 value);Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address | |
| value | uint256 |
ERC1363TransferFromFailed
The transferFrom part of a transferFromAndCall returned false.
error ERC1363TransferFromFailed(address sender, address receiver, uint256 value);Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | |
| receiver | address | |
| value | uint256 |
ERC1363ApproveFailed
The approve part of an approveAndCall returned false.
error ERC1363ApproveFailed(address spender, uint256 value);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | |
| value | uint256 |
ERC1363InvalidReceiver
receiver has no code, or did not accept the transfer.
error ERC1363InvalidReceiver(address receiver);Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address |
ERC1363InvalidSpender
spender has no code, or did not accept the approval.
error ERC1363InvalidSpender(address spender);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address |