Skip to content
Lattice

IERC2981

Git Source

Title: IERC2981

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/interfaces/IERC2981.sol)

Interface for the ERC-2981 NFT Royalty Standard.

Functions

royaltyInfo

Returns royalty information for a token sale.

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

Parameters

NameTypeDescription
tokenIduint256The NFT being sold.
salePriceuint256The sale price of the NFT (in any unit of exchange).

Returns

NameTypeDescription
receiveraddressAddress of the royalty recipient.
royaltyAmountuint256The royalty payment amount.

Errors

ERC2981InvalidDefaultRoyalty

numerator is greater than denominator (royalty exceeds 100%).

error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);

Parameters

NameTypeDescription
numeratoruint256
denominatoruint256

ERC2981InvalidDefaultRoyaltyReceiver

receiver is the zero address.

error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);

Parameters

NameTypeDescription
receiveraddress

ERC2981InvalidTokenRoyalty

numerator is greater than denominator for the given tokenId.

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

Parameters

NameTypeDescription
tokenIduint256
numeratoruint256
denominatoruint256

ERC2981InvalidTokenRoyaltyReceiver

receiver is the zero address for the given tokenId.

error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);

Parameters

NameTypeDescription
tokenIduint256
receiveraddress