Giter Club home page Giter Club logo

protocol-contracts's Introduction

Smart contracts for Rarible protocol

Consists of:

  • Exchange v2: responsible for sales, auctions etc.
  • Tokens: for storing information about NFTs
  • Specifications for on-chain royalties supported by Rarible

Overview of the protocol

Rarible protocol is a combination of smart-contracts for exchanging tokens, tokens themselves, APIs for order creation, discovery, standards used in smart contracts.

Protocol is primarily targeted to NFTs, but it's not limited to NFTs only. Any asset on EVM blockchain can be traded on Rarible.

Smart contracts are constructed in the way to be upgradeable, orders have versioning information, so new fields can be added if needed in future.

Trade process overview

Users should do these steps to successfully trade on Rarible:

  • approve transfers for their assets to Exchange contracts (e.g.: call approveForAll for ERC-721, approve for ERC-20) - amount of money needed for trade is price + fee on top of that. learn more at exchange contracts readme
  • sign trading order via preferred wallet (order is like a statement "I would like to sell my precious crypto kitty for 10 ETH")
  • save this order and signature to the database using Rarible protocol API (in future, storing orders on-chain will be supported too)

If user wants to cancel order, he must call cancel function of the Exchange smart contract

Users who want to purchase something on Rarible should do the following:

  • find asset they like with an open order
  • approve transfers the same way (if not buying using Ether)
  • form order in the other direction (statement like "I would like to buy precious crypto kitty for 10 ETH")
  • call Exchange.matchOrders with two orders and first order signature.

protocol-contracts's People

Contributors

evgenynacu avatar skonstantins avatar sanufriev avatar ggomma 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.