IERC1363.sol 3.6 KB

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