Skip to content

Solidity API

PropsRoyalty

This contract manages royalty information for tokens in the Props ecosystem

Implements ERC2981 royalty standard for Props ecosystem

init

solidity
function init(uint96 defaultRoyaltyBips) external

Initializes the PropsRoyalty facet

Sets up the ERC165 interface support for IERC2981

setDefaultRoyalty

solidity
function setDefaultRoyalty(address recipient, uint96 royaltyBPS) external

Sets the default royalty information for all tokens

This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner

Parameters

NameTypeDescription
recipientaddressAddress to receive royalties
royaltyBPSuint96Royalty amount in basis points (BPS). 100 BPS = 1%

deleteDefaultRoyalty

solidity
function deleteDefaultRoyalty() external

Deletes the default royalty information

This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner

getDefaultRoyaltyBips

solidity
function getDefaultRoyaltyBips() public view returns (uint96)

Retrieves the default royalty percentage in basis points (BPS)

_This function provides a public interface to access the internal getDefaultRoyaltyBips function It allows external contracts and users to query the current default royalty rate The royalty is expressed in basis points, where 1 BPS = 0.01% (e.g., 100 BPS = 1%)

Return Values

NameTypeDescription
[0]uint96uint96 The default royalty percentage in basis points For example, a return value of 250 means a 2.5% royalty

setTokenRoyalty

solidity
function setTokenRoyalty(uint256 tokenId, address recipient, uint96 royaltyBPS) external

Sets the token-specific royalty information

This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner

Parameters

NameTypeDescription
tokenIduint256ID of the token to set royalty for
recipientaddressAddress to receive royalties for this specific token
royaltyBPSuint96Royalty amount in basis points (BPS) for this specific token. 100 BPS = 1%

resetTokenRoyalty

solidity
function resetTokenRoyalty(uint256 tokenId) external

Deletes token-specific royalty information

This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner

Parameters

NameTypeDescription
tokenIduint256ID of the token to reset royalty for

royaltyInfo

solidity
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)

Returns the royalty information for a specific token and sale price

Implements IERC2981 royaltyInfo function

Parameters

NameTypeDescription
tokenIduint256ID of the token
salePriceuint256Sale price of the token

Return Values

NameTypeDescription
receiveraddressAddress of who should receive the royalties
royaltyAmountuint256Amount of royalty to be paid based on the sale price

feeDenominator

solidity
function feeDenominator() external pure returns (uint96)

Returns the fee denominator used for royalty calculations

This is typically 10000, representing basis points

Return Values

NameTypeDescription
[0]uint96The fee denominator value

supportsInterface

solidity
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

Checks if the contract supports a given interface

Overrides function from ERC165 to add support for IERC2981

Parameters

NameTypeDescription
interfaceIdbytes4The interface identifier, as specified in ERC-165

Return Values

NameTypeDescription
[0]boolbool True if the contract supports the interface, false otherwise

onlyDiamondOrOwnerOrRoyaltyManager

solidity
modifier onlyDiamondOrOwnerOrRoyaltyManager()