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

IERC1363Spender

Interface for any contract that wants to support approveAndCall from ERC-1363 token contracts.

Functions

onApprovalReceived

Whenever an ERC-1363 token owner approves this contract via approveAndCall to spend their tokens, this function is called. NOTE: To accept the approval, this must return bytes4(keccak256("onApprovalReceived(address,uint256,bytes)")) (i.e. 0x7b04a2d0, or its own function selector).

function onApprovalReceived(address owner, uint256 value, bytes calldata data) external returns (bytes4);

Parameters

NameTypeDescription
owneraddressThe address which called approveAndCall function and previously owned the tokens.
valueuint256The amount of tokens to be spent.
databytesAdditional data with no specified format.

Returns

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