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

IERC1363Receiver

Interface for any contract that wants to support transferAndCall or transferFromAndCall from ERC-1363 token contracts.

Functions

onTransferReceived

Whenever ERC-1363 tokens are transferred to this contract via transferAndCall or transferFromAndCall by operator from from, this function is called. NOTE: To accept the transfer, this must return bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)")) (i.e. 0x88a7ca5c, or its own function selector).

function onTransferReceived(address operator, address from, uint256 value, bytes calldata data)
    external
    returns (bytes4);

Parameters

NameTypeDescription
operatoraddressThe address which called transferAndCall or transferFromAndCall function.
fromaddressThe address which the tokens are transferred from.
valueuint256The amount of tokens transferred.
databytesAdditional data with no specified format.

Returns

NameTypeDescription
<none>bytes4bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)")) if transfer is allowed unless throwing.