IERC1363Receiver.sol 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1363Receiver.sol)
  3. pragma solidity ^0.8.0;
  4. interface IERC1363Receiver {
  5. /*
  6. * Note: the ERC-165 identifier for this interface is 0x88a7ca5c.
  7. * 0x88a7ca5c === bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))
  8. */
  9. /**
  10. * @notice Handle the receipt of ERC1363 tokens
  11. * @dev Any ERC1363 smart contract calls this function on the recipient
  12. * after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
  13. * transfer. Return of other than the magic value MUST result in the
  14. * transaction being reverted.
  15. * Note: the token contract address is always the message sender.
  16. * @param operator address The address which called `transferAndCall` or `transferFromAndCall` function
  17. * @param from address The address which are token transferred from
  18. * @param value uint256 The amount of tokens transferred
  19. * @param data bytes Additional data with no specified format
  20. * @return `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))`
  21. * unless throwing
  22. */
  23. function onTransferReceived(
  24. address operator,
  25. address from,
  26. uint256 value,
  27. bytes memory data
  28. ) external returns (bytes4);
  29. }