Sample NFT Marketplace contracts with EIP-2981 support |
EIP-2981 introduces a “standardized way to obtain royalty payment information for non-fungible tokens (NFTs).” Marketplaces can obtain information about how much royalty to send to whom by calling the royaltyInfo() function of the NFT contract. A simple ERC-721 token (Token.sol) that provides a fixed royalty percentage of 5% to be paid to a single recipient address for each sale of each NFT minted under the contract. (Note that the fixed percentage fee is not a requirement of EIP-2981, and more exotic schemes are possible.) Royalty Payment Middleware Contract (RoyaltiesPayment.sol). EIP-2981 stipulates that royalty payments must be made to a single address. In the case of an NFT with multiple rights holders, this means that the marketplace payment must be further split either off-chain or through another contract. The contract in this repository allows for multiple rights holders. Every time a payment is made to the contract, the amount is split equally between all registered rights holders. They then have the option to withdraw all or part of their balance from the contract. Go back |
28-07-2025, 21:31 |