IERC1363Spender.sol 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1363Spender.sol)
  3. pragma solidity ^0.8.0;
  4. interface IERC1363Spender {
  5. /*
  6. * Note: the ERC-165 identifier for this interface is 0x7b04a2d0.
  7. * 0x7b04a2d0 === bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))
  8. */
  9. /**
  10. * @notice Handle the approval of ERC1363 tokens
  11. * @dev Any ERC1363 smart contract calls this function on the recipient
  12. * after an `approve`. This function MAY throw to revert and reject the
  13. * approval. 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 owner address The address which called `approveAndCall` function
  17. * @param value uint256 The amount of tokens to be spent
  18. * @param data bytes Additional data with no specified format
  19. * @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
  20. * unless throwing
  21. */
  22. function onApprovalReceived(
  23. address owner,
  24. uint256 value,
  25. bytes memory data
  26. ) external returns (bytes4);
  27. }