forked from AmazingAng/WTF-Solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IERC1155Receiver.sol
33 lines (30 loc) · 1.08 KB
/
IERC1155Receiver.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
30
31
32
33
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../34_ERC721/IERC165.sol";
/**
* @dev Contrato receptor de ERC1155. Para receber transferências seguras de ERC1155, é necessário implementar este contrato.
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Aceita transferência segura de ERC1155 `safeTransferFrom`
* Deve retornar 0xf23a6e61 ou `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Aceita transferências seguras em lote de ERC1155 `safeBatchTransferFrom`
* Precisa retornar 0xbc197c81 ou `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}