Skip to content
Lattice

IERC1363

Git Source

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

NameTypeDescription
toaddress
valueuint256

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
toaddress
valueuint256
databytes

Returns

NameTypeDescription
<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

NameTypeDescription
fromaddress
toaddress
valueuint256

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
fromaddress
toaddress
valueuint256
databytes

Returns

NameTypeDescription
<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

NameTypeDescription
spenderaddress
valueuint256

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
spenderaddress
valueuint256
databytes

Returns

NameTypeDescription
<none>bool

Errors

ERC1363TransferFailed

The transfer part of a transferAndCall returned false.

error ERC1363TransferFailed(address receiver, uint256 value);

Parameters

NameTypeDescription
receiveraddress
valueuint256

ERC1363TransferFromFailed

The transferFrom part of a transferFromAndCall returned false.

error ERC1363TransferFromFailed(address sender, address receiver, uint256 value);

Parameters

NameTypeDescription
senderaddress
receiveraddress
valueuint256

ERC1363ApproveFailed

The approve part of an approveAndCall returned false.

error ERC1363ApproveFailed(address spender, uint256 value);

Parameters

NameTypeDescription
spenderaddress
valueuint256

ERC1363InvalidReceiver

receiver has no code, or did not accept the transfer.

error ERC1363InvalidReceiver(address receiver);

Parameters

NameTypeDescription
receiveraddress

ERC1363InvalidSpender

spender has no code, or did not accept the approval.

error ERC1363InvalidSpender(address spender);

Parameters

NameTypeDescription
spenderaddress