IERC2981
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
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The NFT being sold. |
| salePrice | uint256 | The sale price of the NFT (in any unit of exchange). |
Returns
| Name | Type | Description |
|---|---|---|
| receiver | address | Address of the royalty recipient. |
| royaltyAmount | uint256 | The royalty payment amount. |
Errors
ERC2981InvalidDefaultRoyalty
numerator is greater than denominator (royalty exceeds 100%).
error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);Parameters
| Name | Type | Description |
|---|---|---|
| numerator | uint256 | |
| denominator | uint256 |
ERC2981InvalidDefaultRoyaltyReceiver
receiver is the zero address.
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address |
ERC2981InvalidTokenRoyalty
numerator is greater than denominator for the given tokenId.
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| numerator | uint256 | |
| denominator | uint256 |
ERC2981InvalidTokenRoyaltyReceiver
receiver is the zero address for the given tokenId.
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| receiver | address |