TRUST Summit | Nov 3, 2025 | NYCWhere decision-makers define the next chapter of secure blockchain adoption.
Learn more

Audit name:

[SCA] DefiSpot | Vesting Contract | Apr2024

Date:

Apr 30, 2024

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 DefiSpot team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

DeFi Spot provides trading solutions for easy access to fragmented liquidity pools.

titlecontent
PlatformEVM
LanguageSolidity
TagsERC20, Vesting
Timeline11/04/2024 - 22/04/2024
Methodologyhttps://hackenio.cc/sc_methodology

    Review Scope

    Repositoryhttps://github.com/DefiSpot/vesting-contract
    Commita92b20d581d152e2c340b52d5556b6d3e795dda0

    Audit Summary

    Total8.4/10
    Security Score

    10/10

    Test Coverage

    68%

    Code Quality Score

    10/10

    Documentation Quality Score

    6/10

    12Total Findings
    10Resolved
    2Accepted
    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 DefiSpot
    Audited ByNiccolò Pozzolini, Kornel Światłowsk
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.defispot.com/
    Changelog17/04/2024 - Preliminary Report
    22/04/2024 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for DefiSpot
      Audited By
      Niccolò Pozzolini, Kornel Światłowsk
      Approved By
      Przemyslaw Swiatowiec
      Changelog
      17/04/2024 - Preliminary Report
      22/04/2024 - Second Review

    System Overview

    DeFi Spot is a vesting of a Spot Token with the following contracts:

    DefispotToken — Simple ERC-20 token that mints all initial supply to a deployer. Additional minting is allowed to addresses with MINTER role. It has the following attributes:

    • Name: Provided during deployment

    • Symbol: Provided during deployment

    • Decimals: 18

    • Total supply: 1000000_000  tokens.

    TokenVesting— a contract that allows the contract owner or whitelisted address to create vesting schedules for the ERC20 token defined during contract deployment.

    Privileged roles

    DefispotToken contract uses the AccessControl library to grant privileged roles. The contract has following roles:

    • MINTER - Addresses with this role can mint new ERC20 tokens.

    • MINTER_MAKER - Addresses with this role can grant a given address a MINTER role.

    TokenVesting contract uses an Ownable library to grant a privileged role. The contract owner can:

    • Create a new vesting schedule.

    • Revoke the vesting schedule for the given identifier.

    • Withdraw the specified amount of vested tokens if some vesting has been revoked.

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 6 out of 10.

    • Functional requirements are present, but only at a high-level.

    • Technical description is present, but only at a high-level.

    Code quality

    The total Code Quality score is 10 out of 10.

    • The development environment is configured.

    Test coverage

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

    • Deployment and basic user interactions are covered with tests.

    • Negative cases coverage is missing.

    Security score

    Upon auditing, the code was found to contain 0 critical, 0 high, 1 medium, and 2 low severity issues. The medium issue has been fixed, 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 8.4. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Centralized Control of Minting Process: The token contract’s design allows for centralized control over the minting process, posing a risk of unauthorized token issuance, potentially diluting the token value and undermining trust in the project's economic governance.

    Findings

    Code
    Title
    Status
    Severity
    F-2024-2113Whitelisted users can manipulate slicePeriodSeconds and revocable parameters
    fixed

    Medium
    F-2024-2142Missing two-step ownership transfer process
    accepted

    Low
    F-2024-2138Missing validation of input parameters
    fixed

    Low
    F-2024-2145Redundant argument in the release function
    fixed

    Observation
    F-2024-2141 Redundant the getCurrentTime wrapper leads to higher deployment cost
    accepted

    Observation
    F-2024-2140Violation of Check-Effects-Interactions (CEI) pattern in the _createVestingSchedule function
    fixed

    Observation
    F-2024-2139Commented code parts, TODO comments and developer notes
    fixed

    Observation
    F-2024-2119Low readability of long literals in MAX_SUPPLY constant
    fixed

    Observation
    F-2024-2118Non-descriptive error message in release function
    fixed

    Observation
    F-2024-2117Unnecessary external call in _createVestingSchedule function
    fixed

    Observation
    1-10 of 12 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/DefiSpot/vesting-contract
    Commita92b20d581d152e2c340b52d5556b6d3e795dda0
    Whitepaper-
    Requirements-
    Technical Requirements-

    Contracts in Scope

    contracts
    TokenVesting.sol - contracts › TokenVesting.sol
    DefispotToken.sol - contracts › DefispotToken.sol
    interfaces
    IDefispotToken.sol - contracts › interfaces › IDefispotToken.sol

    Disclaimer