Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ERC1363Utils

Library that provides common ERC-1363 utility functions. See https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].

Functions

checkOnERC1363TransferReceived

*Performs a call to {IERC1363Receiver-onTransferReceived} on a target address. Requirements:

  • The target has code (i.e. is a contract).
  • The target to must implement the {IERC1363Receiver} interface.
  • The target must return the {IERC1363Receiver-onTransferReceived} selector to accept the transfer.*
function checkOnERC1363TransferReceived(address operator, address from, address to, uint256 value, bytes memory data)
    internal;

checkOnERC1363ApprovalReceived

*Performs a call to {IERC1363Spender-onApprovalReceived} on a target address. Requirements:

  • The target has code (i.e. is a contract).
  • The target spender must implement the {IERC1363Spender} interface.
  • The target must return the {IERC1363Spender-onApprovalReceived} selector to accept the approval.*
function checkOnERC1363ApprovalReceived(address operator, address spender, uint256 value, bytes memory data) internal;

Errors

ERC1363InvalidReceiver

Indicates a failure with the token receiver. Used in transfers.

error ERC1363InvalidReceiver(address receiver);

Parameters

NameTypeDescription
receiveraddressAddress to which tokens are being transferred.

ERC1363InvalidSpender

Indicates a failure with the token spender. Used in approvals.

error ERC1363InvalidSpender(address spender);

Parameters

NameTypeDescription
spenderaddressAddress that may be allowed to operate on tokens without being their owner.