Giter VIP home page Giter VIP logo

contracts's Introduction

๐Ÿฅ‚ ReNFT Contract

ReNFT

Table of content

๐Ÿ–ผ๏ธ What is ReNFT

ReNFT is an Ethereum protocol for ERC-721 and ERC-1155 lending and renting. The protocol is incredibly minimalistic. The core contract is implemented in src/ReNFT.sol, you can find the interface in src/interfaces/IReNFT.sol. It allows for a combination of ERC-721 and ERC-1155 to be lent in a single transaction. There is a complementary npm package, that will help you pass the arguments to the contract correctly, such that your users save on gas. This library prepares the arguments to be passed to the contract such that ERC1155s invoke their batch functions.

There is a subgraph implementation, you can find it here.

๐Ÿ–ผ๏ธ๐ŸŒŠ Flow

  1. Lender specifies a number of parameters

    a. maximum number of days that his NFT can be rented out for

    why? we don't want renters to hold on to NFTs for too long

    b. daily rent price

    c. NFT price. In case the NFT is not returned, the lender is entitled to claim the collateral

    d. payment token. The lender receives rent payments in this token. Collateral is priced in this token, as well.

  2. Lender lends NFT(s)

  3. Renter agrees to the terms and pays full collateral and all of the rent up front

  4. Step 5 or Step 6 below

  5. Renter returns in time

    4a. Unused rent amounts + collateral gets returned to the renter

    4b. NFT(s) is/are returned to the lender and deposited back into the ReNFT contract

    why? so that the lender does not have to re-deposit the NFT(s) back for lending

  6. Renter does no return in time

    5a. Lender claims the collateral

    5b. Collateral along with full rent payment gets sent to the lender

๐Ÿค๐Ÿป ReNFT contract spec

๐Ÿค๐Ÿป๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Events

Lent - when an NFT(s) is/are lent.

Rented - when an NFT(s) is/are rented out.

Returned - when an NFT(s) is/are returned by the renter back into ReNFT contract.

CollateralClaimed - when the renter fails to return the NFT(s) in time, lender can claim collateral. Emmitted when lender claimed this collateral(s).

LendingStopped - lender can stop lending their NFT(s), these will be sent from the ReNFT contract back to the lender.

๐Ÿค๐Ÿป๐Ÿ‘ฉ๐Ÿฝโ€โœˆ๏ธ Functions

lend - lend some/all of your NFTs. These get sent to ReNFT contract for escrow, until the renter is found.

rent - rent one/many ERC721/ERC1155 NFTs from the users that have lent them, and which reside in ReNFT for escrow.

returnIt - return one/all of the rented ERC721/ERC1155 NFTs before the deadline.

claimCollateral - called by lender if the renter missed their return date.

stopLending - called by lender to release their lent NFT back to them. This marks end of the interaction with ReNFT smart contract.

๐ŸŽจ Marketing

For ReNFT branding materials, head here.

contracts's People

Contributors

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