Skip to content

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

NameTypeDescription
operatoraddressThe address which called safeTransferFrom function
fromaddressThe address which previously owned the token
tokenIduint256The NFT identifier which is being transferred
databytesAdditional data with no specified format

Return Values

NameTypeDescription
[0]bytes4bytes4 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

NameTypeDescription
operatoraddressThe address which called safeTransferFrom function
fromaddressThe address which previously owned the token
iduint256The ID of the token being transferred
valueuint256The amount of tokens being transferred
databytesAdditional data with no specified format

Return Values

NameTypeDescription
[0]bytes4bytes4 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

NameTypeDescription
operatoraddressThe address which called safeBatchTransferFrom function
fromaddressThe address which previously owned the tokens
idsuint256[]An array containing ids of each token being transferred
valuesuint256[]An array containing amounts of each token being transferred
databytesAdditional data with no specified format

Return Values

NameTypeDescription
[0]bytes4bytes4 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

NameTypeDescription
functionSelectorbytes4The function selector to look for

Return Values

NameTypeDescription
facetaddressThe address of the facet that implements the function, or address(0) if none found