Token standards & NFTs

ERC-2981

ERC-2981 is the standard way for an NFT contract to tell the world who should receive a royalty and how much. It defines a single function, royaltyInfo(tokenId, salePrice), which returns two values: the address that should be paid (receiver) and the amount owed (royaltyAmount) for a sale at that price. A contract declares support for it via ERC-165 interface detection, so a marketplace can ask any NFT 'do you have royalty info?' and, if yes, read the recipient and figure.

The deliberate design choice is that ERC-2981 only signals — it does not, and cannot, force payment. The standard provides a uniform place to look up the fee, replacing the previous mess where every marketplace stored royalties in its own proprietary database. But the actual transfer of the royalty still happens in the marketplace's settlement code, which calls royaltyInfo and chooses whether to honor the result. Nothing in the ERC-721 or ERC-2981 transfer path deducts the fee automatically.

Because the amount is computed from a salePrice passed in by the caller, the figure is only as honest as the price reported. The standard also returns a flat amount rather than a percentage in its interface (implementations usually compute it as a percentage internally), and it is silent on splits among multiple creators, leaving those to the implementation. ERC-2981 is best understood as the answer to 'how does a marketplace discover the royalty', not the answer to 'how is the royalty guaranteed' — that guarantee does not exist at the token level.

function royaltyInfo(uint256 tokenId, uint256 salePrice)
    external view
    returns (address receiver, uint256 royaltyAmount)
{
    receiver = _creator;
    royaltyAmount = (salePrice * 750) / 10000;  // 7.5%
}

ERC-2981 is an advertisement board, not a toll gate. It standardizes how the royalty is read; whether it is actually paid is entirely up to the marketplace doing the settlement.

Also called
NFT royalty standardNFT 權利金標準