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

Audit name:

[SCA] Cinch Protocol | Yield Farming | Apr2023

Date:

May 11, 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 Cinch Protocol team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Cinch Protocol is a referral system for blockchain applications aimed at democratizing economic opportunity by providing accessible decentralized financial products through seamless integration with wallets.

titlecontent
PlatformEVM
LanguageSolidity
TagsYield Farming
Timeline10/04/2023 - 12/05/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/cinchprotocol/contracts→
    Commitab6639e019f64ca27c22876c9b62a3ca2baedf73

    Audit Summary

    Total9.8/10
    Security Score

    10/10

    Test Coverage

    100%

    Code Quality Score

    10/10

    Documentation Quality Score

    8/10

    21Total Findings
    21Resolved
    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 Cinch Protocol
    Audited ByHacken
    Websitehttps://www.cinchprotocol.io→
    Changelog19/04/2023 - Initial Review
    09/05/2023 - Second Review
    12/05/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Cinch Protocol
      Audited By
      Hacken
      Changelog
      19/04/2023 - Initial Review
      09/05/2023 - Second Review
      12/05/2023 - Third Review

    System Overview

    **Cinch Protocol** is a referral system for blockchain applications aimed at democratizing economic opportunity by providing accessible decentralized financial products through seamless integration with wallets, with the following contracts:

    • GeneralRevenueShareLogic – an abstract smart contract that implements revenue share business logic with a referral system.

    • GeneralYieldSourceAdapter - an abstract smart contract that serves as a template for creating yield source adapters that interact with various yield source vaults in a revenue-sharing system. The contract provides a set of functions to interact with yield source vaults, such as depositing assets, redeeming assets based on shares, converting assets to shares, and converting shares to assets.

    • RevenueShareVault – a smart contract inherited from GeneralRevenueShareLogic and  GeneralYieldSourceAdapter  enables users to deposit and withdraw assets into a yield source product, with support for referrals. It provides functionalities for managing asset deposits, share minting, asset redemptions, and querying account balances with pausable and access control features.

    • RevenueShareVaultDHedge – a smart contract that extends RevenueShareVault and specializes in depositing and redeeming assets in dHedge yield source vaults. It provides conversion functions for assets to yield source shares, calculating share price, and querying account balances in the yield source.

    • RevenueShareVaultRibbonEarn – a smart contract that extends RevenueShareVault and specializes in depositing assets into Ribbon Earn yield source vaults. It provides functions for depositing assets, querying share price and balances, and converting assets to and from yield source shares.

    • IYieldSourceContract – an interface for a yield source contract that enables depositing and redeeming assets, as well as querying share price, total supply, and individual account balances.

    • IYieldSourceDHedge – an interface that enables depositing funds, withdrawing funds, querying token price, total supply, and account balances.

    • IYieldSourceDHedgeSwapper – an interface that enables withdrawing underlying assets while swapping them to a specified asset with slippage protection.

    Privileged roles

    • The owner of the GeneralRevenueShareLogic can manage referrals, adjust share allocations, and modify the Cinch performance fee percentage, allowing them to control revenue share distribution and enable deposits and withdrawals for the revenue shares.

    • The owner of the GeneralYieldSourceAdapter can update the address of the yield source vault.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 8 out of 10.

    • NatSpec is detailed.

    • Run instructions are provided.

    • Project overview is detailed.

    • Use cases are described.

    • The technical documentation for integration implementation is partially provided.

    Code quality

    The total Code quality score is 10 out of 10.

    • Development environment is configured.

    • Code follows best practices.

    Test coverage

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

    • Deployment and basic user interactions are covered with tests.

    • Negative cases coverage is present.

    • Interactions by several users are tested.

    Security score

    Upon auditing, the code was found to contain 0 critical, 4 high, 2 medium, and 15 low severity issues. Out of these, 21 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 9.8. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Integration with Ribbon Finance is only done in a limited form, allowing users to forward deposits in their name. Withdrawal of funds is left to be managed by users outside of the Cinch Protocol. Integration is centralized and requires maintenance operations from the contract owner.

    Cinch protocol integrates external protocols into its system, which can introduce various risks and security concerns. The correctness of the integrations is out of the audit scope.

    Findings

    F-2023-0090Race Condition; Data Consistency
    Status
    fixed
    Severity

    High
    F-2023-0089Denial of Service; Ambiguous Third-Party Integration
    Status
    fixed
    Severity

    High
    F-2023-0088Data Consistency
    Status
    fixed
    Severity

    High
    F-2023-0087Invalid Calculations
    Status
    fixed
    Severity

    High
    F-2023-0092Unchecked Approve
    Status
    fixed
    Severity

    Medium
    F-2023-0091Gas Limit in Loops
    Status
    fixed
    Severity

    Medium
    F-2023-0107Redundant Code
    Status
    fixed
    Severity

    Low
    F-2023-0106Redundant Import
    Status
    fixed
    Severity

    Low
    F-2023-0105Commented Code
    Status
    fixed
    Severity

    Low
    F-2023-0104Redundant Code
    Status
    fixed
    Severity

    Low
    Code
    ―
    Title
    Status
    Severity
    F-2023-0090Race Condition; Data Consistency
    fixed

    High
    F-2023-0089Denial of Service; Ambiguous Third-Party Integration
    fixed

    High
    F-2023-0088Data Consistency
    fixed

    High
    F-2023-0087Invalid Calculations
    fixed

    High
    F-2023-0092Unchecked Approve
    fixed

    Medium
    F-2023-0091Gas Limit in Loops
    fixed

    Medium
    F-2023-0107Redundant Code
    fixed

    Low
    F-2023-0106Redundant Import
    fixed

    Low
    F-2023-0105Commented Code
    fixed

    Low
    F-2023-0104Redundant Code
    fixed

    Low
    1-10 of 21 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/cinchprotocol/contracts→
    Commitab6639e019f64ca27c22876c9b62a3ca2baedf73
    WhitepaperNot provided
    RequirementsProvided→
    Technical RequirementsProvided→

    Contracts in Scope

    v1
    hardhat
    contracts
    revenueshare
    GeneralRevenueShareLogic.sol - v1 › hardhat › contracts › revenueshare › GeneralRevenueShareLogic.sol
    GeneralYieldSourceAdapter.sol - v1 › hardhat › contracts › revenueshare › GeneralYieldSourceAdapter.sol
    RevenueShareVault.sol - v1 › hardhat › contracts › revenueshare › RevenueShareVault.sol
    RevenueShareVaultDHedge.sol - v1 › hardhat › contracts › revenueshare › RevenueShareVaultDHedge.sol
    RevenueShareVaultRibbonEarn.sol - v1 › hardhat › contracts › revenueshare › RevenueShareVaultRibbonEarn.sol
    interfaces
    IYieldSourceContract.sol - v1 › hardhat › contracts › revenueshare › interfaces › IYieldSourceContract.sol
    IYieldSourceDHedge.sol - v1 › hardhat › contracts › revenueshare › interfaces › IYieldSourceDHedge.sol

    Disclaimer