Перейти к основному содержанию

CreatorFeeManagerWithRoyalties

This contract returns the creator fee address and the creator fee amount.

royaltyFeeRegistry

contract IRoyaltyFeeRegistry royaltyFeeRegistry

Royalty fee registry interface.

constructor

constructor(address _royaltyFeeRegistry) public

Constructor

Parameters

NameTypeDescription
_royaltyFeeRegistryaddressRoyalty fee registry address.

viewCreatorFeeInfo

function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount)

This function returns the creator address and calculates the creator fee amount.

There are two on-chain sources for the royalty fee to distribute.

  1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection.
  2. ERC2981: The NFT Royalty Standard where royalty fee is defined at an itemId level in a collection.

The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection supports ERC2981. If so, it fetches the proper royalty information for the itemId.

For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price.

If any contract relies on it to build an on-chain royalty logic, it should implement protection against:

  1. high royalties
  2. potential unexpected royalty changes that can occur after the creation of the order.

Parameters

NameTypeDescription
collectionaddressCollection address
priceuint256Transaction price
itemIdsuint256[]Array of item ids

Return Values

NameTypeDescription
creatoraddressCreator address
creatorFeeAmountuint256Creator fee amount