Coder Social home page Coder Social logo

shay360 / nft-royalties Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nsinthunont/nft-royalties

1.0 0.0 0.0 177 KB

Smart contract template to support NFTs whereby the artist gets a royalty from all future transactions of the NFT

JavaScript 44.63% Solidity 55.37%

nft-royalties's Introduction

NFT Royalties

Introduction

This repo contains a template smart contract to create an NFT that pays royalties to the original artist each time it is transacted in the future. This feature is an extremely important one to have as many artists are currently struggling to monetize. In an ideal scenario, the royalty scheme can be customized at the NFT level.

Openzeppelin

This smart contract relies on Openzeppelin's ERC721 standard for NFTs. There is also another ERC20 smart contract for a test token called NSToken (this can be replaced with any token)

Setup dependencies

To install all the dependencies in a all project:

npm install --save ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers web3modal @openzeppelin/contracts 

We will also want to install some dev dependencies for testing purposes

npm install --save-dev @openzeppelin/test-helpers @nomiclabs/hardhat-web3 web3

Don't forget to modify the hardhat.config.js file by adding the following to the top or else the test-helpers will not function properly

require("@nomiclabs/hardhat-web3");

Usage

To test the smart contracts using the provide test file:

npx hardhat test

Future

There are several upgrades that are available to the current template including:

  • The royalty fee can be paid in any token currency that is equivalent to the fee which can be denominated in ETH (i.e. assume fee is 1 ETH and today the price of 1 ETH = 10 LINK then the royalty fee can either be paid using 1 ETH or 10 LINK)
  • Allow either the buyer or the seller of the NFT to cover the fee cost

nft-royalties's People

Contributors

socomy-nick avatar nsinthunont avatar

Stargazers

Hadj H. avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.