Audit name:

[SCA] Cradle / Airdrop / Jan2025

Date:

Jan 28, 2025

Table of Content

Introduction

Audit Summary

System Overview

Potential Risks

Findings

Appendix 1. Definitions

Appendix 2. Scope

Appendix 3. Additional Valuables

Disclaimer

Want a comprehensive audit report like this?

Introduction

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

VestedAirdrop - is a contract that facilitates token distribution using a vesting mechanism with Merkle tree validation.

Audit Summary

2Total Findings
1Resolved
1Accepted
0Mitigated

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

Documentation quality

  • Functional requirements are not provided.

  • Technical description is not provided.

Code quality

  • The code mostly follows best practices.

  • The development environment is not configured.

Test coverage

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

  • Tests were not provided.

System Overview

VestedAirdrop - is a contract that facilitates token distribution using a vesting mechanism with Merkle tree validation. It enables eligible users to claim tokens based on a vesting schedule, which includes an initial release of 31% (TGE) and linear vesting of the remaining 69% over a specified period. The contract ensures secure token distribution, tracks claimed amounts to prevent over-claiming and allows the owner to update the Merkle root or rescue unclaimed tokens

Privileged roles

  • The owner of the VestedAirdrop contract can update the Merkle root, and rescue unclaimed tokens.

Potential Risks

Owner's Unrestricted State Modification: The absence of restrictions on state variable modifications by the owner leads to arbitrary changes, affecting contract integrity and user trust, especially during critical operations like minting phases.

Findings

Code
Title
Status
Severity
F-2025-8526
Events Missing Indexed Parameters
Fixed

Observation
F-2025-8524
Missing Zero Address Validation
Accepted

Observation
1-2 of 2 findings

Identify vulnerabilities in your smart contracts.

Appendix 1. Definitions

Severities

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

    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.

Potential Risks

The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.

Appendix 2. Scope

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

Assets in Scope

VestedAidrop.vy - VestedAidrop.vy

Appendix 3. Additional Valuables

Verification of System Invariants

During the audit of Cradle, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry, a tool used for fuzz-testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.

Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Echidna fuzzing suite was prepared for this task, and throughout the assessment, 9 invariants were tested over 100,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.

  • Invariant

    The claimed_amount of a user must never exceed the total allocated amount for that user.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The claimed_amount of a user must increase only when a valid claim is processed.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The merkle_root must only be updated by the contract owner.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    Only the owner can call the rescue_tokens function.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The rescue_tokens function must reduce the contract's token balance by the specified amount.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The claim function must revert if the proof is invalid.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The claim function must revert if the current time is before the vesting_start_time.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    The vested amount calculation must align with the defined 31% TGE and 69% linear vesting formula.

    Test Result

    Passed

    Run Count

    100K+

    Invariant

    After the vesting_end_time, all tokens must be fully vested and claimable.

    Test Result

    Passed

    Run Count

    100K+

Additional Recommendations

The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.

To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:

  • Detecting changes to ownership or critical permissions.

  • Monitoring large or unexpected transactions and minting events.

  • Pausing operations when irregularities are identified.

These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.

Disclaimer