Giter Site home page Giter Site logo

nft_royalties_market's Introduction

ERC-721 NFT Marketplace with royalties payment (EIP-2981)

Overview

EIP-2981 introduces a "standardized way to retrieve royalty payment information for non-fungible tokens (NFTs)". Marketplaces can retrieve information about how much royalties to send to whom by calling the NFT contract's royaltyInfo() function.

The contracts in this repository are a sample implementation of the EIP's recommendation. They include:

  • A simple ERC-721 token (Token.sol) which stipulates a fixed 5% royalty percentage to be paid to a single recipient's address for every sale of every NFT minted by the contract. (Note that the flat percentage fee is not a requirement of EIP-2981 and more exotic schemes are possible).
  • A marketplace (Marketplace.sol) which allows user to place buy offers on the NFT generated by the contracts. Token holders can choose to accept a buy offers and sell their tokens at the offer's price. Or they can place their own sell offers at the price they desire and wait for a user to purchase. All transactions are conducted in ETH. Every time a sale occurs, the marketplace contract calls the token contract to retrieve the amount of royalties due. That amount is then transferred to the royalties' recipients' address.
  • A royalties payment middleware contract (RoyaltiesPayment.sol). EIP-2981 stipulates that royalty payments must be made to a single address. In the case where an NFT has multiple rightholders, this means that the payment from the marketplace must be further split, either off-chain or through another contract. The contract in this repository allows for multiple rightholders. Every time a payment is made to the contract, the amount is split equally among all the registered rightsholders. They then have the possibility to withdraw all or part of their balance on the contract.

The token contract is based on OpenZeppelin's ERC-721 contracts.

Setup

Dependencies

Install the required python dependencies: pip install -r requirements.txt

Running the tests

brownie test

License

This project is licensed under the MIT license.

nft_royalties_market's People

Contributors

benber86 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.