IERC1363.sol 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 0xb0202a11.
  9. * 0xb0202a11 ===
  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. * bytes4(keccak256('approveAndCall(address,uint256)')) ^
  15. * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
  16. */
  17. /**
  18. * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  19. * @param to address The address which you want to transfer to
  20. * @param value uint256 The amount of tokens to be transferred
  21. * @return true unless throwing
  22. */
  23. function transferAndCall(address to, uint256 value) external returns (bool);
  24. /**
  25. * @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  26. * @param to address The address which you want to transfer to
  27. * @param value uint256 The amount of tokens to be transferred
  28. * @param data bytes Additional data with no specified format, sent in call to `to`
  29. * @return true unless throwing
  30. */
  31. function transferAndCall(address to, uint256 value, bytes memory data) external returns (bool);
  32. /**
  33. * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  34. * @param from address The address which you want to send tokens from
  35. * @param to address The address which you want to transfer to
  36. * @param value uint256 The amount of tokens to be transferred
  37. * @return true unless throwing
  38. */
  39. function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
  40. /**
  41. * @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  42. * @param from address The address which you want to send tokens from
  43. * @param to address The address which you want to transfer to
  44. * @param value uint256 The amount of tokens to be transferred
  45. * @param data bytes Additional data with no specified format, sent in call to `to`
  46. * @return true unless throwing
  47. */
  48. function transferFromAndCall(address from, address to, uint256 value, bytes memory data) external returns (bool);
  49. /**
  50. * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  51. * and then call `onApprovalReceived` on spender.
  52. * @param spender address The address which will spend the funds
  53. * @param value uint256 The amount of tokens to be spent
  54. */
  55. function approveAndCall(address spender, uint256 value) external returns (bool);
  56. /**
  57. * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  58. * and then call `onApprovalReceived` on spender.
  59. * @param spender address The address which will spend the funds
  60. * @param value uint256 The amount of tokens to be spent
  61. * @param data bytes Additional data with no specified format, sent in call to `spender`
  62. */
  63. function approveAndCall(address spender, uint256 value, bytes memory data) external returns (bool);
  64. }