NFTrade’s Decentralized Creator and Community Royalties Solution

NFTrade
3 min readOct 25, 2021

--

NFT royalties should be easy to access for all, regardless of the native chain or which platform the NFT is listed or sold on. With our latest open-source implementation, the entire NFT marketplace will benefit from a robust creator and community royalties solution.

For a full walkthrough on implementation, you can clone our github repo here: https://github.com/NFTrade/royalties

Implementing royalties can be done in two ways:

  1. Implementing EIP-2981 - (https://eips.ethereum.org/EIPS/eip-2981)
  2. Adding the royalties data to our RoyaltiesManager contract.

After the royalties are transferred to the receiver, it can be sent either to a wallet address or to a smart contract that deals with community and creator royalties.

Below, we are proud to showcase our concept for a dual creator and community royalties contract. Along with traditional royalties distribution, which is fully managed via this contract, the contract can also receive and distribute funding from any wallet or smart contract that transfers cryptocurrency to the address.

An Industry-Wide Problem Solved: Auto Claim on Transfer ONLY for Wallet Addresses, Not Smart Contracts

To support the full functionality of royalties capabilities, an abstract contract needs to get integrated within the NFT collection contract.

RoyaltiesAddon.sol

By introducing this segment as part of the NFT collection contract, you allow the holders of the collection to auto claim their portion of earned royalties on every NFT transfer and sale.

*Please note* — if the current owner of the NFT is a contract, such as an on-chain marketplace or escrowed middleware, the auto claim won’t get called, saving the royalties claim ONLY for NFT owners (wallets).

Community and Creator Royalties

Our royalties implementation defines a few functions that help manage community and developer royalties.

getRoyalties

This function is used to tell the creator and community royalties percentages from the total sale amount.

getRoyalties() public view returns (uint256, uint256)

getTotalCollected

This function returns the total amount of royalties that have been sent to the Royalties contract.

getTotalCollected() public view returns (uint256)

getTokenTotalRoyalties

This function is used to tell the total royalties amount a token has been given.

getTokenBalance(uint256 tokenID) public view returns (uint256)

getTokenBalance

This function is used to tell the current token balance.

getTokenBalance(uint256 tokenID) public view returns (uint256)

claimCommunity

This function claims the amount available for a single token ID.

claimCommunity(uint256 tokenID) public

claimCommunityBatch

This function calls the claimCommunity for multiple token IDs and claims for each one.

claimCommunityBatch(uint256[] calldata tokenIDs) external

claimCreator

This function claims the amount available for the creator.

claimCreator() external

Royalties.sol

You can find a complete example of this implementation with the entire code base on our GitHub through the following link: https://github.com/NFTrade/royalties

*Disclaimer* — Please be aware that depending on the applicable jurisdiction and its changing regulation, adding community royalties to an NFT collection may make the NFT viewed as a security token or resembling a security token. NFTrade is simply offering this royalties contract as a service for the broader NFT ecosystem and is not responsible for how a collection decides to use it. You hereby warrant you will use this contract in according to the applicable law.

About NFTrade

NFTrade is the first cross-chain and blockchain-agnostic NFT platform. We are an aggregator of all NFT marketplaces and host the complete NFT lifecycle, allowing anyone to seamlessly create, buy, sell, swap, farm, and leverage NFTs across different blockchains. Using NFTrade, anyone can gain access to the entirety of their NFT, unlocking the total value of the NFT market.

Telegram | Website | Twitter | Medium | LinkedIn | Instagram | Discord

--

--

NFTrade

The first decentralized cross-chain NFT platform, allowing users to unlock the full value of the NFT ecosystem — nftrade.com