IERC1363Spender.sol 1.1 KB

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