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

Audit name:

[SCA] NF3x | Airdrop | May2023

Date:

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

Nf3x is a multi-asset swaps and options platform to barter, reserve & exchange your favourite NFT collections, entirely peer-to-peer.

titlecontent
PlatformEVM
LanguageSolidity
TagsAirdrop, EIP712
Timeline07/05/2023 - 23/06/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/NF3Labs/contracts-V2→
    Commita69718e71ba8a6e220ff8665c2799abd8cad8327

    Audit Summary

    Total9/10
    Security Score

    10/10

    Test Coverage

    72.73%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    12Total Findings
    11Resolved
    0Accepted
    1Mitigated

    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 NF3x
    Audited ByHacken
    Websitehttps://nf3.exchange/→
    Changelog12/05/2023 - Initial Review
    31/05/2023 - Second Review
    23/06/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for NF3x
      Audited By
      Hacken
      Changelog
      12/05/2023 - Initial Review
      31/05/2023 - Second Review
      23/06/2023 - Third Review

    System Overview

    The audit scope consists of individual helper contracts for an NFT swapping platform that handles signature verification, validations for certain inputs, variable storage, Airdrops, and data types used in the platform. This audit covers only part of the project that includes 2 functionalities.

    • Airdrop. The protocol wants to allow users to benefit from airdrops even when their NFTs are locked in DEX contracts.

    • Signatures. The protocol wants to implement the EIP-712 standard for signatures.

    The files in the scope:

    • SigningUtil.sol: Handles the signature verifications in the platform by using the EIP712 standard.

    • AirdropClaim.sol: The contract to claim airdrops using NFTs that are reserved and locked in the vault. This allows users to continue receiving airdrops even if their NFTs are locked.

    • ValidationUtils.sol: Contract to validate complex inputs in the system and ensure that the inputs are not corrupted.

    • StorageRegistry.sol: The interface that defines all the functions related to storage for the protocol.

    • DataTypes.sol: The contract that defines complex structs used in the system.

    • IStorageRegistry.sol: Interface for the StorageRegistry.sol contract.

    • LoanDataTypes.sol: The contract that defines complex structs related to Loans in the system.

    • ISigningUtils.sol: Interface for the SigningUtil.sol contract.

    • ERC2771ContextUpgradeable.sol: The upgradeable implementation of the EIP2721 Meta transactions standard, which is implemented by Openzeppellin.

    • IAirdropClaim.sol: Interface for the AirdropClaim.sol contract.

    • IWhitelist.sol: The interface that defines all the functions related to the whitelisting of tokens. The implementation of the interface is out of scope.

    Privileged roles

    • AirdropClaim :

      • Reserve contract :

        • Can claim an airdrop.

        • Can transfer ownership and complete reservation.

      • Owner :

        • Can withdraw assets.

    • StorageRegistry :

      • only approved (swap contract, reserve contract or loan contract) :

        • Can set the nonce.

        • Can set the claim contract address.

      • Owner :

        • Can set the market address.

        • Can set the vault address.

        • Can set the reserve address.

        • Can set the whitelist address.

        • Can set the swap address.

        • Can set the loan address.

        • Can set the signing util address.

        • Can set the airdrop claim address.

        • Can set the position token address.

    • Signer: The address that creates signatures to be validated using the SigningUtil.sol contract.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are present for the functionalities covered in this audit.

    • Technical description of the contracts is present.

    • Development environment description is present.

    • NatSpecs are satisfactory.

    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 72.73% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • Some cases are not covered with tests.

    • Interactions by several users are not tested thoroughly.

    Security score

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

    Risks

    The SigningUtils.sol contract follows the EIP712 standard correctly; however, it does not have the functionality to automatically update nonce values and provide protection against signature replay attacks. The nonce variable should be updated correctly after signature verification is completed on chain. This functionality is out of the scope of this audit.

    The airdrop and ownership transfer is done in AirdropClaim.sol through Reserve.sol. Reserve.sol is out of the scope of this audit. However, it has critical function access inside the scope.

    The scope has an ERC2771 contract for Gas forwarding; however, there is no documentation on how this logic will be implemented off-chain.

    Findings

    F-2023-0721Invalid Initialization
    Status
    fixed
    Severity

    Critical
    F-2023-0720Unverifiable Logic - External Call to Untrusted Address
    Status
    mitigated
    Severity

    Critical
    F-2023-0722 Undocumented Functionality
    Status
    fixed
    Severity

    High
    F-2023-0726Data Consistency
    Status
    fixed
    Severity

    Medium
    F-2023-0725Highly Permissive Role Access - Unverifiable Logic
    Status
    fixed
    Severity

    Medium
    F-2023-0724Highly Permissive Role Access
    Status
    fixed
    Severity

    Medium
    F-2023-0723NatSpec Contradiction
    Status
    fixed
    Severity

    Medium
    F-2023-0730 Variable Shadowing
    Status
    fixed
    Severity

    Low
    F-2023-0729 Missing Zero Address Validation
    Status
    fixed
    Severity

    Low
    F-2023-0728Duplicate Code
    Status
    fixed
    Severity

    Low
    Code
    ―
    Title
    Status
    Severity
    F-2023-0721Invalid Initialization
    fixed

    Critical
    F-2023-0720Unverifiable Logic - External Call to Untrusted Address
    mitigated

    Critical
    F-2023-0722 Undocumented Functionality
    fixed

    High
    F-2023-0726Data Consistency
    fixed

    Medium
    F-2023-0725Highly Permissive Role Access - Unverifiable Logic
    fixed

    Medium
    F-2023-0724Highly Permissive Role Access
    fixed

    Medium
    F-2023-0723NatSpec Contradiction
    fixed

    Medium
    F-2023-0730 Variable Shadowing
    fixed

    Low
    F-2023-0729 Missing Zero Address Validation
    fixed

    Low
    F-2023-0728Duplicate Code
    fixed

    Low
    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/NF3Labs/contracts-V2→
    Commita69718e71ba8a6e220ff8665c2799abd8cad8327
    WhitepaperNot provided
    RequirementsProvided (NF3x ContractsV2 Flows)
    Technical RequirementsProvided (NF3x Technical Documentation)
    • Scope Details

      Commit
      a69718e71ba8a6e220ff8665c2799abd8cad8327
      Whitepaper
      Not provided
      Requirements
      Provided (NF3x ContractsV2 Flows)
      Technical Requirements
      Provided (NF3x Technical Documentation)

    Contracts in Scope

    contracts
    lib
    SigningUtil.sol - contracts › lib › SigningUtil.sol
    ValidationUtils.sol - contracts › lib › ValidationUtils.sol
    AirdropClaim.sol - contracts › AirdropClaim.sol
    StorageRegistry.sol - contracts › StorageRegistry.sol
    Interfaces
    IStorageRegistry.sol - contracts › Interfaces › IStorageRegistry.sol
    lib
    ISigningUtils.sol - contracts › Interfaces › lib › ISigningUtils.sol
    IAirdropClaim.sol - contracts › Interfaces › IAirdropClaim.sol
    IWhitelist.sol - contracts › Interfaces › IWhitelist.sol
    ERC2771ContextUpgradeable.sol - contracts › ERC2771ContextUpgradeable.sol
    utils
    DataTypes.sol - utils › DataTypes.sol
    LoanDataTypes.sol - utils › LoanDataTypes.sol

    Disclaimer