RoyaltyERC721

Description

The RoyaltyERC721 contract is a module that integrates royalty management and validation functionalities for ERC-721 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.

View on GitHub

Callback Functions

FunctionDescription
beforeTransferERC721Callback function for the ERC721.transferFrom and ERC721.safeTransferFrom functions. Validates the transfer 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-7210x80ac58cd

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.