Skip to content

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

NameTypeDescription
numeratoruint256The invalid fee numerator
denominatoruint256The fee denominator

ERC2981InvalidDefaultRoyaltyReceiver

solidity
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver)

Error thrown when an invalid default royalty receiver is set

Parameters

NameTypeDescription
receiveraddressThe invalid receiver address

ERC2981InvalidTokenRoyalty

solidity
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator)

Error thrown when an invalid token royalty is set

Parameters

NameTypeDescription
tokenIduint256The token ID for which the invalid royalty was attempted to be set
numeratoruint256The invalid fee numerator
denominatoruint256The fee denominator

ERC2981InvalidTokenRoyaltyReceiver

solidity
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver)

Error thrown when an invalid token royalty receiver is set

Parameters

NameTypeDescription
tokenIduint256The token ID for which the invalid receiver was attempted to be set
receiveraddressThe invalid receiver address

_feeDenominator

solidity
function _feeDenominator() internal pure virtual returns (uint96)

Returns the fee denominator used for royalty calculations

Return Values

NameTypeDescription
[0]uint96The fee denominator (10000 by default)

_setDefaultRoyalty

solidity
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual

Sets the default royalty for all tokens

Parameters

NameTypeDescription
receiveraddressThe address to receive royalties
feeNumeratoruint96The royalty fee numerator

_deleteDefaultRoyalty

solidity
function _deleteDefaultRoyalty() internal virtual

Deletes the default royalty information

_getDefaultRoyaltyBips

solidity
function _getDefaultRoyaltyBips() internal view returns (uint96)

_setTokenRoyalty

solidity
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual

Sets the royalty for a specific token

Parameters

NameTypeDescription
tokenIduint256The ID of the token
receiveraddressThe address to receive royalties for this token
feeNumeratoruint96The royalty fee numerator for this token

_resetTokenRoyalty

solidity
function _resetTokenRoyalty(uint256 tokenId) internal virtual

Resets the royalty information for a specific token

Parameters

NameTypeDescription
tokenIduint256The 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

NameTypeDescription
tokenIduint256The ID of the token
salePriceuint256The sale price of the token

Return Values

NameTypeDescription
[0]addressreceiver The address to receive the royalty
[1]uint256royaltyAmount The calculated royalty amount