Audit name:

[SCA] NodeTerminal / Node-Terminal-Contracts / Sep2024

Date:

Sep 17, 2024

Table of Content

Introduction

Audit Summary

System Overview

Potential Risks

Findings

Appendix 1. Definitions

Appendix 2. Scope

Disclaimer

Introduction

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

Node Terminal created a sale contract, responsible for handling nodes sale using Node Terminal platform. It collects payments in ERC-20 token (in particular USDT) and increases number of nodes assigned to the account. This data will be used for future NFT airdrop.

  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for NodeTerminal
    Audited By
    Niccolò Pozzolini, Viktor Raboshchuk
    Approved By
    Grzegorz Trawinski
    Changelog
    16/09/2024 - Preliminary Report; 17/09/2024 Final Report
    Platform
    Arbitrum, BSC, Ethereum, Base
    Language
    Solidity
    Tags
    Marketplace

Audit Summary

9Total Findings
7Resolved
1Accepted
0Mitigated

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

Documentation quality

  • Functional requirements are partially provided.

  • Technical description is provided.

Code quality

  • The development environment is configured.

Test coverage

Code coverage of the project is 98.81% (branch coverage)

  • Deployment and basic user interactions are covered with tests.

  • Negative cases coverage are present.

  • Interactions by several users are not tested thoroughly.

System Overview

Node Terminal project includes a single Lumia Node sale contract:

NodeSale.sol - This is smart contract that is responsible for handling nodes sale using Node Terminal platform. It collects payments in ERC-20 token (in particular USDT) and increases number of nodes assigned to the account. This data will be used for future NFT airdrop.

Privileged roles

  • MASTER_ROLE \- This role has the authority to activate or deactivate the sale using the setIsSaleActive function. Only addresses assigned to this role can modify the sale status.

  • ADMIN_ROLE \- Holders of the ADMIN_ROLE are responsible for tasks such as adjusting the maximum supply of nodes, setting the price per node, and establishing wallet purchase limits. Additionally, they can add nodes to user accounts and set wallet-specific caps.

  • DEFAULT_ADMIN_ROLE \- Holders of this role can manage nodes on individual accounts by adjusting the number of nodes assigned to each wallet.

Potential Risks

Single Points of Failure and Control: The project is fully or partially centralized, introducing single points of failure and control. This centralization can lead to vulnerabilities in decision-making and operational processes, making the system more susceptible to targeted attacks or manipulation. The setNumberOfNodes function allows an account with the DEFAULT_ADMIN_ROLE to arbitrarily set the number of nodes for any user. This includes the ability to reduce the number of nodes, effectively removing nodes from a user's account.

Findings

Code
Title
Status
Severity
F-2024-6048
Missing Commisions Upperbound Leads to Calculation issues
Fixed

Medium
F-2024-6067
Wallets Receiving Funds are Immutable
Fixed

Low
F-2024-6062
The getAccountsAndNumberOfNodes Function is Missing a Pagination Feature
Fixed

Low
F-2024-6060
The setNumberOfNodes Missing Cap Per Wallet Validation
Fixed

Low
F-2024-6052
Use of transfer() to Send Native Assets may Revert
Fixed

Low
F-2024-6046
Missing Zero Value Check
Unfixed

Low
F-2024-6122
Lack of Monitoring on Key Functions
Accepted

Observation
F-2024-6066
sendPayments Function not Refunding Excessive Native Payments
Fixed

Observation
F-2024-6061
Possible Max Node Assignment to One Account
Fixed

Observation
1-9 of 9 findings

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, do not affect security score but can affect code quality score.

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:

Contracts in Scope

contracts
NodesSale.sol - contracts/NodesSale.sol

Disclaimer