ERCs

ERC-2981 — NFT Royalty Standard

eips.ethereum.org/EIPS/eip-2981

A standard way for NFTs to declare a royalty: given a sale price, the contract returns the royalty recipient and the amount.

import { royalty_info } from "@ethernauta/erc/2981";

const info = await royalty_info({
  token_id: 1n,
  sale_price: parse_ether("1"),
})(contract({ chain_id: eip155_1.chain_id, contract: collection }));
// → { receiver: Address, royalty_amount: Uint256 }

Surface

MethodShapePurpose
royalty_info({ token_id, sale_price })Callable<{ receiver, royalty_amount }>Per-sale royalty calc.

Interface ID

0x2a55205a — supports detection via ERC-165.

See also