Appearance
Solidity API
PropsReceiver
This contract allows the inheriting contract to receive ERC721 and ERC1155 tokens.
Abstract contract implementing receiver functions for ERC721 and ERC1155 tokens.
onERC721Received
solidity
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) public virtual returns (bytes4)Handles the receipt of a single ERC721 token
Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | The address which called safeTransferFrom function |
| from | address | The address which previously owned the token |
| tokenId | uint256 | The NFT identifier which is being transferred |
| data | bytes | Additional data with no specified format |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes4 | bytes4 bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")) |
onERC1155Received
solidity
function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) public virtual returns (bytes4)Handles the receipt of a single ERC1155 token type
Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | The address which called safeTransferFrom function |
| 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 |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes4 | bytes4 bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) |
onERC1155BatchReceived
solidity
function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) public virtual returns (bytes4)Handles the receipt of multiple ERC1155 token types
Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | The address which called safeBatchTransferFrom function |
| from | address | The address which previously owned the tokens |
| ids | uint256[] | An array containing ids of each token being transferred |
| values | uint256[] | An array containing amounts of each token being transferred |
| data | bytes | Additional data with no specified format |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes4 | bytes4 bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) |
_findFacet
solidity
function _findFacet(bytes4 functionSelector) internal view returns (address facet)Internal function to find a facet that implements a given function selector
Parameters
| Name | Type | Description |
|---|---|---|
| functionSelector | bytes4 | The function selector to look for |
Return Values
| Name | Type | Description |
|---|---|---|
| facet | address | The address of the facet that implements the function, or address(0) if none found |