Skip to content

neti-software/Tezos-NFT-Rental

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Tezos NFT Rental Project

Table of Contents

Overview

Tezos NFT Rental is an innovative platform designed for the rental of gaming items represented as Non-Fungible Tokens (NFTs), developed by Neti, a leading Blockchain Development Company.

Technology Stack

  • SmartPy: A language for developing smart contracts on the Tezos blockchain.
  • Smartpy.io IDE: An integrated development environment for SmartPy.

Key Features

  1. NFT Registration in Lease Manager Contract:

    • Users have the capability to register their NFTs for rental purposes. Upon successful registration, the NFT's status is set to 'OPEN' for rental, and it becomes non-transferable by the owner. The transfer of the NFT is exclusively managed by the Lease Manager Contract.
  2. Renting NFTs:

    • Users can rent NFTs for a predetermined duration as defined in the Lease Manager Contract. During the rental period, the lessee has usage rights but cannot transfer the NFT to other parties.
  3. Returning NFTs:

    • Post the expiration of the rental period, the NFT is returned to its original owner by the Lease Manager Contract. Subsequently, the NFT is unlocked and deregistered from the Lease Manager Contract, enabling the owner to transfer it freely.

Future Enhancements

  • Integration of Various NFT Types on the Tezos Network:

    • A future development goal involves enabling the registration of externally minted NFTs. This would be achieved by wrapping these NFTs within the Rental System’s framework, allowing them to be seamlessly integrated into the rental process without any modifications to the original NFT. This enhancement requires updates to the Tezos wallet system to recognize wrapped NFTs and reveal the original NFTs to the lessees. Implementing this feature will significantly expand the scope of assets available for rental on the Tezos network, enhancing the platform's adaptability and utility.
  • Prolongation of NFT Rental Periods:

    • An upcoming feature will allow lessees to prolongate the rental period of an NFT. This functionality will enable users to extend their lease directly through the platform, subject to the terms set in the original rental agreement. The process will be automated and integrated into the Lease Manager Contract, ensuring a seamless experience.
  • Secondary Market for NFT Rentals:

    • Future enhancements include the development of a secondary market where users can rent out NFTs they have leased to other users. This will create a dynamic and user-driven rental ecosystem. A modified Tezos wallet will be introduced to facilitate these transactions, ensuring a secure and efficient process. The system will automatically distribute fees between the original NFT owner and the Rental platform, maintaining a fair revenue-sharing model.

Installation, Setup and Testing

Use the smartpy.io environment to deploy smart contracts and run tests.

Usage: LeaseManager Contract Entrypoints

The LeaseManager contract in the Tezos NFT Rental Project has several entrypoints, each requiring specific data inputs. Below are the details for each entrypoint.

Entrypoint: register

Description

Registers an NFT for rental.

Required Data

  • token_address: Address of the NFT token (type: sp.address)
  • token_id: Unique identifier of the NFT (type: sp.nat)
  • lease_contract: Address of the lease contract (type: sp.address)

Entrypoint: lease

Description

Allows a user to lease a registered NFT.

Required Data

  • nft_data: A record with the following fields
    • token_address: Address of the NFT token (type: sp.address)
    • token_id: Unique identifier of the NFT (type: sp.nat)
    • lease_contract: Address of the lease contract (type: sp.address)

Entrypoint: unlease

Description

Returns the leased NFT to the original owner after the rental period.

Required Data

  • nft_data: A record with the following fields
    • token_address: Address of the NFT token (type: sp.address)
    • token_id: Unique identifier of the NFT (type: sp.nat)
    • lease_contract: Address of the lease contract (type: sp.address)

Ensure that all data provided to the entrypoints follow the specified types and formats. Incorrect or invalid data may result in transaction failures or unintended behavior.

Testing the LeaseManager Contract

The LeaseManager contract includes several tests to ensure its functionality and robustness. These tests simulate various scenarios to validate the contract's behavior under different conditions. Below is an overview of what each test is designed to accomplish.

Test: Registering and Leasing NFT

Objective

To verify that an NFT can be successfully registered for leasing and then leased to a user.

Procedure

  1. A test NFT is created and registered in the LeaseManager contract.
  2. The test simulates a user leasing the NFT.
  3. Checks are performed to ensure the NFT's status changes appropriately and that it cannot be transferred outside the contract's control during the lease.

Test: Returning Leased NFT

Objective

To confirm that a leased NFT is correctly returned to the owner after the rental period.

Procedure

  1. An NFT is leased as per the first test.
  2. The test simulates the passing of the rental period.
  3. The contract's unlease function is invoked to return the NFT.
  4. Checks are performed to ensure the NFT is returned to the owner and its status updated accordingly.

Test: Invalid Transfer Attempts

Objective

To test the contract's ability to prevent invalid transfers of a leased NFT.

Procedure

  1. An NFT is leased to a user.
  2. Attempts are made to transfer the NFT to another user, which should be invalid during the lease period.
  3. Checks are performed to ensure these transfer attempts fail as expected.

Test: NFT Status Updates

Objective

To ensure that the NFT's status is accurately updated throughout the lease process.

Procedure

  1. The status of an NFT is monitored as it goes through registration, leasing, and return.
  2. Checks are performed to ensure the status reflects the current state of the NFT (e.g., 'OPEN', 'LEASED').

Contributing

Contributions to the Tezos NFT Rental project are welcome. Please follow standard open-source contribution guidelines.

Contact

For more information:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages