-
Notifications
You must be signed in to change notification settings - Fork 11.7k
/
IERC1363Spender.sol
29 lines (26 loc) · 1.25 KB
/
IERC1363Spender.sol
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
27
28
29
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0-rc.0) (interfaces/IERC1363Spender.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for any contract that wants to support {IERC1363-approveAndCall}
* from {ERC1363} token contracts.
*/
interface IERC1363Spender {
/*
* Note: the ERC-165 identifier for this interface is 0x7b04a2d0.
* 0x7b04a2d0 === bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))
*/
/**
* @notice Handle the approval of ERC1363 tokens
* @dev Any ERC1363 smart contract calls this function on the recipient
* after an `approve`. This function MAY throw to revert and reject the
* approval. Return of other than the magic value MUST result in the
* transaction being reverted.
* Note: the token contract address is always the message sender.
* @param owner address The address which called `approveAndCall` function
* @param amount uint256 The amount of tokens to be spent
* @param data bytes Additional data with no specified format
* @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`unless throwing
*/
function onApprovalReceived(address owner, uint256 amount, bytes memory data) external returns (bytes4);
}