ERC2981
Inherits: IERC2981
Title: ERC2981
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol)
Stateless Diamond facet for the ERC-2981 NFT Royalty Standard.
All logic — including admin auth — lives in ERC2981Lib. Pure delegator.
Notes:
- lattice-version: 0.1.0
- lattice-source: OpenZeppelin v5.6.1
Functions
royaltyInfo
Returns royalty information for a token sale.
function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256);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 |
|---|---|---|
| <none> | address | Address of the royalty recipient. |
| <none> | uint256 | The royalty payment amount. |
setDefaultRoyalty
Sets the default royalty receiver and fraction. Admin-gated.
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address | |
| feeNumerator | uint96 |
deleteDefaultRoyalty
Deletes the default royalty configuration. Admin-gated.
function deleteDefaultRoyalty() public virtual;setTokenRoyalty
Sets a per-token royalty override. Admin-gated.
function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| receiver | address | |
| feeNumerator | uint96 |
resetTokenRoyalty
Removes the per-token royalty override. Admin-gated.
function resetTokenRoyalty(uint256 tokenId) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 |
exportSelectors
ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).
Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches
forge inspect ERC2981 methodIdentifiers (alphabetical by signature); kept in exact parity by
ExportSelectorsParityTest. Chunks:
deleteDefaultRoyalty() 0xaa1b103f
resetTokenRoyalty(uint256) 0x8a616bc0
royaltyInfo(uint256,uint256) 0x2a55205a
setDefaultRoyalty(address,uint96) 0x04634d8d
setTokenRoyalty(uint256,address,uint96) 0x5944c753
function exportSelectors() external pure virtual returns (bytes memory selectors);Returns
| Name | Type | Description |
|---|---|---|
| selectors | bytes |