forked from OpenZeppelin/openzeppelin-contracts
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIERC1363Spender.sol
More file actions
26 lines (24 loc) · 1.09 KB
/
IERC1363Spender.sol
File metadata and controls
26 lines (24 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1363Spender.sol)
pragma solidity ^0.8.20;
/**
* @title ERC1363Spender
* @dev Interface for any contract that wants to support `approveAndCall`
* from ERC1363 token contracts.
*/
interface IERC1363Spender {
/**
* @dev Whenever an ERC1363 tokens `owner` approved this contract via `approveAndCall`
* to spent their tokens, this function is called.
*
* NOTE: To accept the approval, this must return
* `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`
* (i.e. 0x7b04a2d0, or its own function selector).
*
* @param owner The address which called `approveAndCall` function and previously owned the tokens.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format.
* @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))` if approval is allowed unless throwing.
*/
function onApprovalReceived(address owner, uint256 value, bytes calldata data) external returns (bytes4);
}