ERC2981CollectionRoyalties

Git Source

Inherits: IERC2981

State Variables

BASIS_POINTS

uint16 internal constant BASIS_POINTS = 10000;

INTERFACE_ID_ERC2981

bytes4 internal constant INTERFACE_ID_ERC2981 = 0x2a55205a;

Functions

supportsInterface

See {IERC165-supportsInterface}.

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

setRoyalty

Changes the royalty percentage for secondary sales.

function setRoyalty(uint256 royaltiesInBasisPoints) external;

Parameters

NameTypeDescription
royaltiesInBasisPointsuint256The royalty percentage (measured in basis points).

royaltyInfo

Called with the sale price to determine how much royalty is owed and to whom.

function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address, uint256);

Parameters

NameTypeDescription
tokenIduint256The ID of the token queried for royalty information.
salePriceuint256The sale price of the token specified.

Returns

NameTypeDescription
<none>addressA tuple with the address that should receive the royalties and the royalty payment amount for the given sale price.
<none>uint256

_setRoyalty

function _setRoyalty(uint256 royaltiesInBasisPoints) internal virtual;

_getRoyaltyAmount

function _getRoyaltyAmount(uint256, uint256 salePrice) internal view virtual returns (uint256);

_storeRoyaltiesInBasisPoints

function _storeRoyaltiesInBasisPoints(uint256 royaltiesInBasisPoints) internal virtual;

_loadRoyaltiesInBasisPoints

function _loadRoyaltiesInBasisPoints() internal view virtual returns (uint256);

_beforeRoyaltiesSet

function _beforeRoyaltiesSet(uint256 royaltiesInBasisPoints) internal view virtual;

_getRoyaltiesInBasisPointsSlot

function _getRoyaltiesInBasisPointsSlot() internal view virtual returns (uint256);

_getReceiver

function _getReceiver(uint256 tokenId) internal view virtual returns (address);