Rarible NFT royalties in your custom smart contract

Martin
Rarible Protocol
Published in
9 min readSep 7, 2021

--

A goal for us as creators is to create pieces that have continued value in the eyes of our buyers. This goes beyond the primary sale and continues into all subsequent secondary sales.

Smart contracts, which are the underlying foundation to all NFTs, allow us to integrate many amazing features into our work, and luckily programmable royalties is one of them! This allows us to benefit from each time a new buyer purchases our existing NFT. In my own NFT project, Aisthisi, which we sell our pieces on the Rarible marketplace, we incorporated this royalty functionality to ensure all creatives continue to benefit from their hard work.

This tutorial is meant to guide you in creating your own NFT custom smart contract that includes a built in functionality to always collect royalties when it is sold on the Rarible marketplace. Let’s get started!

Prerequisite and set up

We will mainly be using the following tools in this tutorial:

  • Node.js — Javascript engine (for running our JS programs)
  • Hardhat — smart contract developer environment
  • OpenZeppelin — audited smart contract templates

First step is to install Node.js (≥14 version) if you do not have it already. You can use this…

--

--