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 |
| Website | https://www.nodeterminal.com→ |
| Changelog | 16/09/2024 - Preliminary Report; 17/09/2024 Final Report |
| Platform | Arbitrum, BSC, Ethereum, Base |
| Language | Solidity |
| Tags | Marketplace |
| Methodology | https://hackenio.cc/sc_methodology→ |
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
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/Node-Terminal/node-terminal-contracts→ |
| Commit | caf557e |
Review Scope
- Commit
- caf557e
Audit Summary
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
setIsSaleActivefunction. Only addresses assigned to this role can modify the sale status.ADMIN_ROLE \- Holders of the
ADMIN_ROLEare 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 |
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 | 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.
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:
Scope Details | |
|---|---|
| Repository | https://github.com/Node-Terminal/node-terminal-contracts→ |
| Commit | caf557e462ff870578143f6ad40e329183714e6e |
| Whitepaper | https://nodeterminal.gitbook.io/nodeterminal→ |
| Requirements | README.md, NatSpec |
| Technical Requirements | README.md |
Scope Details
- Commit
- caf557e462ff870578143f6ad40e329183714e6e
- Requirements
- README.md, NatSpec
- Technical Requirements
- README.md