Appearance
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) externalInitializes the PropsRoyalty facet
Sets up the ERC165 interface support for IERC2981
setDefaultRoyalty
solidity
function setDefaultRoyalty(address recipient, uint96 royaltyBPS) externalSets the default royalty information for all tokens
This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner
Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | Address to receive royalties |
| royaltyBPS | uint96 | Royalty amount in basis points (BPS). 100 BPS = 1% |
deleteDefaultRoyalty
solidity
function deleteDefaultRoyalty() externalDeletes 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
| Name | Type | Description |
|---|---|---|
| [0] | uint96 | uint96 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) externalSets the token-specific royalty information
This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | ID of the token to set royalty for |
| recipient | address | Address to receive royalties for this specific token |
| royaltyBPS | uint96 | Royalty amount in basis points (BPS) for this specific token. 100 BPS = 1% |
resetTokenRoyalty
solidity
function resetTokenRoyalty(uint256 tokenId) externalDeletes token-specific royalty information
This function can only be called by accounts with ROYALTY_MANAGER_ROLE or the diamond owner
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | ID 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
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | ID of the token |
| salePrice | uint256 | Sale price of the token |
Return Values
| Name | Type | Description |
|---|---|---|
| receiver | address | Address of who should receive the royalties |
| royaltyAmount | uint256 | Amount 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
| Name | Type | Description |
|---|---|---|
| [0] | uint96 | The 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
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | The interface identifier, as specified in ERC-165 |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the contract supports the interface, false otherwise |
onlyDiamondOrOwnerOrRoyaltyManager
solidity
modifier onlyDiamondOrOwnerOrRoyaltyManager()