The user generated collections (Decentraland Collections V2) does not support royalties out of the box when a transfer occurs.
Decentraland marketplaces (Marketplace and Bid) can support royalties with the help of a new module: Royalties Manager.
For the first version, the royalties manager will return just the royalties receiver which is the address where the royalties should be sent. The royalties receiver is going to be defined by quering the collection on-chain:
Moreover, if the collection is not a Decentraland collection V2 compliant, the royalties receiver will be the zero address.
The collection is compliant, if implements the following interface:
interface IERC721CollectionV2 {
function creator() external view returns (address);
function decodeTokenId(uint256 _tokenId) external view returns (uint256, uint256);
function items(uint256 _itemId) external view returns (string memory, uint256, uint256, uint256, address, string memory, string memory);
}
The interface proposed for the Royalties Manager is
interface IRoyaltiesManager {
function getRoyaltiesReceiver(address _contractAddress, uint256 _tokenId) external view returns (address);
}
getRoyaltiesReceiver
: must not revert at any circumstances (only run out of
gas). It is 100% recommended to use staticCall
to be 100% sure that it won't
allow any state changes.