Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] Zharta | Vault | Nov2023

Date:

Dec 20, 2023

Table of Content

→Introduction
→Audit Summary
→Document Information
→System Overview
→Executive Summary
→Risks
→Findings
→Appendix 1. Severity Definitions
→Appendix 2. Scope
→Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Zharta team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Zharta is a platform that provides instant loans & renting services using NFTs as collateral, enabling NFT holders to get liquidity & yield without having to sell their NFTs

titlecontent
PlatformEVM
LanguageVyper
TagsNFT Renting; Escrow; ERC721; Delegation
Timeline30/11/2023 - 11/12/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/Zharta/lotm-renting-protocol→
    Commitd455048

    Audit Summary

    Total10/10
    Security Score

    10/10

    Test Coverage

    100%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    3Total Findings
    3Resolved
    0Accepted
    0Mitigated

    The system users should acknowledge all the risks summed up in the risks section of the report

    Document Information

    This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.

    The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.

    Document

    NameSmart Contract Code Review and Security Analysis Report for Zharta
    Audited ByDavid Camps Novi, Viktor Lavrenenko
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.zharta.io/→
    Changelog06/12/2023 - Initial Review
    11/12/2023 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Zharta
      Audited By
      David Camps Novi, Viktor Lavrenenko
      Approved By
      Przemyslaw Swiatowiec
      Changelog
      06/12/2023 - Initial Review
      11/12/2023 - Second Review

    System Overview

    The LOTM Renting Protocol is a trustless way for LOTM players to rent game assets from users.

    The NFT renting process in this protocol is as follows:

    1. A lender deposits NFT in a vault, setting the lending terms (price + rental duration).

    2. A borrower gets the NFT they wish, by paying the rental price upfront.

    3. The vault containing the NFT delegates it to the borrower’s specific wallet for a specific duration.

    4. Once the loan duration is reached, the rental finishes.

      • The borrower can end the rental before the end date, recovering the funds corresponding to the period unused.

    Fees are defined in Renting.vy as protocol_fee and protocol_wallet, which are used when a new rental is created through Vault.start_rental.

    Protocol contracts:

    • Vault - holds the core functionality of the NFT lending.

    • Renting - entry point for users and other protocols.

      • Contains the admin protocol methods to update the protocol fee and the protocol admin.

    Privileged roles

    • Renting.vy:

      • Admin - sets the protocol fees and the protocol wallet that receives those fees.

        • Admin can be changed via propose_admin and claim_ownership functions.

    • Vault.vy:

      • Owner - the owner of each NFT in the vault. Only this address can interact with the vault through the Renting.vy contract.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are provided:

      • Project overview is provided.

      • Use cases are described and detailed.

      • All the project’s features are mentioned.

      • Roles and authorization are described.

    • Technical description is sufficient:

      • Technical specifications are present.

      • Deployment instructions are provided.

    Code quality

    The total Code quality score is 10 out of 10.

    • The code maintains a high standard.

    • Best practices are followed.

    Test coverage

    Code coverage of the project is 100% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • Negative case coverage is present.

    • Interactions by several users are tested.

    Security score

    Upon auditing, the code was found to contain 0 critical, 0 high, 0 medium, and 2 low severity issues. Out of these, 2 issues have been addressed and resolved, leading to a Security score of 10 out of 10.

    All identified issues are detailed in the “Findings” section of this report.

    Summary

    The comprehensive audit of the customer's smart contract yields an overall score of 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    The Vault contract calls ERC20’s methods transfer and transferFrom, checking the return value. However, if a token were used that does not revert or return at all, functions including the aforementioned calls would fail.

    Renting time can be set to unlimited, resulting in the loss of control over the rented NFT.

    When a renter sets an allowance higher than the original listing.price, there is a risk that the nft_owner can frontrun the renter by changing the listing.price via set_listings() function.

    Interactions with delegation_registry_addr (warm.xyz) are out of scope of this audit and cannot be validated (see the following risk statement).

    Findings

    Code
    ―
    Title
    Status
    Severity
    F-2023-0743Missing Zero Address Checks
    fixed

    Low
    F-2023-0742Missing Maximum Protocol Fee Check
    fixed

    Low
    I-2023-0188Unused Parameter
    fixed

    Observation
    1-3 of 3 findings

    Identify vulnerabilities in your smart contracts.

    Appendix 1. Severity Definitions

    When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.

    Reference on how risk scoring is done is available through the repository in our Github organization:

    Severity

    Description

    Critical
    Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

    High
    High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

    Medium
    Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

    Low
    Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
    • Severity

      Critical

      Description

      Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

      Severity

      High

      Description

      High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

      Severity

      Medium

      Description

      Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

      Severity

      Low

      Description

      Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.

    Appendix 2. Scope

    The scope of the project includes the following smart contracts from the provided repository:

    Scope Details

    Repositoryhttps://github.com/Zharta/lotm-renting-protocol→
    Commitd455048
    WhitepaperProvided→
    RequirementsProvided→
    Technical RequirementsProvided→

    Contracts in Scope

    contracts
    Renting.vy - contracts › Renting.vy
    Vault.vy - contracts › Vault.vy

    Disclaimer