IERC1363Receiver.sol 1.2 KB

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