IERC 1155 Receiver
Last updated
Last updated
Available since v3.1.
Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a safeBatchTransferFrom
after the balances have been updated. To accept the transfer(s), this must return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))
(i.e. 0xbc197c81, or its own function selector).
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Handles the receipt of a single ERC1155 token type. This function is called at the end of a safeTransferFrom
after the balance has been updated. To accept the transfer, this must return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))
(i.e. 0xf23a6e61, or its own function selector).
Returns true if this contract implements the interface defined by interfaceId
. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
operator
address
The address which initiated the batch transfer (i.e. msg.sender)
from
address
The address which previously owned the token
ids
uint256[]
An array containing ids of each token being transferred (order and length must match values array)
values
uint256[]
An array containing amounts of each token being transferred (order and length must match ids array)
data
bytes
Additional data with no specified format
_0
bytes4
bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))
if transfer is allowed
operator
address
The address which initiated the transfer (i.e. msg.sender)
from
address
The address which previously owned the token
id
uint256
The ID of the token being transferred
value
uint256
The amount of tokens being transferred
data
bytes
Additional data with no specified format
_0
bytes4
bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))
if transfer is allowed
interfaceId
bytes4
undefined
_0
bool
undefined