RoyaltyERC1155

Description

The RoyaltyERC1155 contract is a module that integrates royalty management and validation functionalities for ERC-1155 token transfers. This module ensures that royalties are appropriately handled during token transfers, and allows for the validation of these transfers through a customizable transfer validator.

GitHub
View on GitHub

Callback Functions

FunctionDescription
beforeTransferERC1155Callback function for the ERC1155.transferFrom and ERC1155.safeTransferFrom functions. Validates the transfer via the transferValidator.
beforeBatchTransferERC1155Callback function for batch transfers of ERC-1155 tokens. Validates each transfer in the batch via the transferValidator.

Fallback Functions

FunctionDescription
royaltyInfoReturns the royalty recipient and amount for a given sale.
getDefaultRoyaltyInfoReturns the default royalty info (recipient and BPS) for the token contract.
getRoyaltyInfoForTokenReturns the royalty info (recipient and BPS) for a specific token.
getTransferValidatorReturns the transfer validator contract address for this token contract.
getTransferValidationFunctionReturns the function selector and view status for the transfer validator's validation function.
hasRoleChecks if the given account has the specified role.
setDefaultRoyaltyInfoSets the default royalty info (recipient and BPS). Requires manager role.
setRoyaltyInfoForTokenSets the royalty info (recipient and BPS) for a specific token. Requires manager role.
setTransferValidatorSets the transfer validator contract address. Requires manager role.

Required Interfaces

InterfaceID
ERC-11550xd9b67a26

Supported Interfaces

InterfaceID
IERC29810x2a55205a
ICreatorToken0xad0d7f6c
ICreatorTokenLegacy0xa07d229a

Installation Callback

This module uses an installation callback to set up initial parameters such as the default royalty information and the transfer validator contract.