IERC1363.sol 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1363.sol)
  3. pragma solidity ^0.8.0;
  4. import "./IERC20.sol";
  5. import "./IERC165.sol";
  6. interface IERC1363 is IERC165, IERC20 {
  7. /*
  8. * Note: the ERC-165 identifier for this interface is 0x4bbee2df.
  9. * 0x4bbee2df ===
  10. * bytes4(keccak256('transferAndCall(address,uint256)')) ^
  11. * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
  12. * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
  13. * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)'))
  14. */
  15. /*
  16. * Note: the ERC-165 identifier for this interface is 0xfb9ec8ce.
  17. * 0xfb9ec8ce ===
  18. * bytes4(keccak256('approveAndCall(address,uint256)')) ^
  19. * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
  20. */
  21. /**
  22. * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  23. * @param to address The address which you want to transfer to
  24. * @param value uint256 The amount of tokens to be transferred
  25. * @return true unless throwing
  26. */
  27. function transferAndCall(address to, uint256 value) external returns (bool);
  28. /**
  29. * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  30. * @param to address The address which you want to transfer to
  31. * @param value uint256 The amount of tokens to be transferred
  32. * @param data bytes Additional data with no specified format, sent in call to `to`
  33. * @return true unless throwing
  34. */
  35. function transferAndCall(address to, uint256 value, bytes memory data) external returns (bool);
  36. /**
  37. * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  38. * @param from address The address which you want to send tokens from
  39. * @param to address The address which you want to transfer to
  40. * @param value uint256 The amount of tokens to be transferred
  41. * @return true unless throwing
  42. */
  43. function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
  44. /**
  45. * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  46. * @param from address The address which you want to send tokens from
  47. * @param to address The address which you want to transfer to
  48. * @param value uint256 The amount of tokens to be transferred
  49. * @param data bytes Additional data with no specified format, sent in call to `to`
  50. * @return true unless throwing
  51. */
  52. function transferFromAndCall(address from, address to, uint256 value, bytes memory data) external returns (bool);
  53. /**
  54. * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  55. * and then call `onApprovalReceived` on spender.
  56. * @param spender address The address which will spend the funds
  57. * @param value uint256 The amount of tokens to be spent
  58. */
  59. function approveAndCall(address spender, uint256 value) external returns (bool);
  60. /**
  61. * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  62. * and then call `onApprovalReceived` on spender.
  63. * @param spender address The address which will spend the funds
  64. * @param value uint256 The amount of tokens to be spent
  65. * @param data bytes Additional data with no specified format, sent in call to `spender`
  66. */
  67. function approveAndCall(address spender, uint256 value, bytes memory data) external returns (bool);
  68. }