Appearance
Solidity API
PropsRoyaltyInternal
Internal contract for managing ERC2981 royalties
This contract provides internal functions for setting and retrieving royalty information
ERC2981InvalidDefaultRoyalty
solidity
error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator)Error thrown when an invalid default royalty is set
Parameters
| Name | Type | Description |
|---|---|---|
| numerator | uint256 | The invalid fee numerator |
| denominator | uint256 | The fee denominator |
ERC2981InvalidDefaultRoyaltyReceiver
solidity
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver)Error thrown when an invalid default royalty receiver is set
Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address | The invalid receiver address |
ERC2981InvalidTokenRoyalty
solidity
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator)Error thrown when an invalid token royalty is set
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The token ID for which the invalid royalty was attempted to be set |
| numerator | uint256 | The invalid fee numerator |
| denominator | uint256 | The fee denominator |
ERC2981InvalidTokenRoyaltyReceiver
solidity
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver)Error thrown when an invalid token royalty receiver is set
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The token ID for which the invalid receiver was attempted to be set |
| receiver | address | The invalid receiver address |
_feeDenominator
solidity
function _feeDenominator() internal pure virtual returns (uint96)Returns the fee denominator used for royalty calculations
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint96 | The fee denominator (10000 by default) |
_setDefaultRoyalty
solidity
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtualSets the default royalty for all tokens
Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address | The address to receive royalties |
| feeNumerator | uint96 | The royalty fee numerator |
_deleteDefaultRoyalty
solidity
function _deleteDefaultRoyalty() internal virtualDeletes the default royalty information
_getDefaultRoyaltyBips
solidity
function _getDefaultRoyaltyBips() internal view returns (uint96)_setTokenRoyalty
solidity
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtualSets the royalty for a specific token
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token |
| receiver | address | The address to receive royalties for this token |
| feeNumerator | uint96 | The royalty fee numerator for this token |
_resetTokenRoyalty
solidity
function _resetTokenRoyalty(uint256 tokenId) internal virtualResets the royalty information for a specific token
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token to reset royalty for |
_setDefaultRoyaltyBips
solidity
function _setDefaultRoyaltyBips(uint96 bips) internal virtual_royaltyInfo
solidity
function _royaltyInfo(uint256 tokenId, uint256 salePrice) internal view virtual returns (address, uint256)Calculates the royalty information for a given token and sale price
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token |
| salePrice | uint256 | The sale price of the token |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address | receiver The address to receive the royalty |
| [1] | uint256 | royaltyAmount The calculated royalty amount |