Introduction
We express our gratitude to the Lumia team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Lumia is a high-performance Layer 2 rollup built with Polygon CDK, offering fast, secure, and scalable solutions. It’s a leading chain for Real World Assets (RWA) and DeFi applications.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for Lumia |
| Audited By | Adam Idarrha, Farrukh Odinaev |
| Approved By | Yves Toiser |
| Website | https://lumia.org/→ |
| Changelog | 15/10/2024 - Preliminary Report |
| Platform | Ethereum |
| Language | Solidity |
| Tags | Fungible Token |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Lumia
- Audited By
- Adam Idarrha, Farrukh Odinaev
- Approved By
- Yves Toiser
- Website
- https://lumia.org/→
- Changelog
- 15/10/2024 - Preliminary Report
- Platform
- Ethereum
- Language
- Solidity
- Tags
- Fungible Token
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/orionprotocol/lumia/blob/audit/contracts/Lumia.sol→ |
| Commit | e2ae999704434f4d337d0dbf9f031371b29ba1b3 |
Review Scope
- Commit
- e2ae999704434f4d337d0dbf9f031371b29ba1b3
Audit Summary
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 conforms with the Solidity Style Guide.
The code does follow best practices for readability & gas efficiency.
The development environment is configured.
Test coverage
Code coverage of the project is 0% (branch coverage).
Tests are not mandatory for project with LoC less than 250.
Unit and coverage tests are present but fail to run correctly.
System Overview
Lumia is a project with the following contracts:
Lumia — simple ERC-20 token able to be minted by addresses allowed by the owner, and also burnable by the owner.
It has the following attributes:
Name: Lumia Token
Symbol: LUMIA
Decimals: 18
Total supply: 238m tokens.
Privileged roles
The owner of the Lumia contract can arbitrarily add or remove minters, granting them the ability to mint tokens up to defined cap.
The owner also has the authority to burn tokens from any account.
Potential Risks
Centralization Risk: The owner can add/remove minters, allowing token minting up to the defined cap, which centralizes control and risks token supply manipulation.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-6646 | Owner Can Arbitrarily Burn User Tokens in Lumia Contract | accepted | Medium | |
| F-2024-6581 | Restriction on User-Initiated Token Burns | accepted | Observation | |
| F-2024-6580 | Use ERC20Capped Instead of Custom Capping Implementation | accepted | Observation | |
| F-2024-6579 | Introduce custom errors to improve gas efficiency | accepted | Observation | |
| F-2024-6578 | solidity style guide violation | accepted | Observation | |
| F-2024-6576 | Public Functions Not Called Internally Should Be Declared as external | accepted | Observation | |
| F-2024-6574 | Consider indexing events | accepted | Observation | |
| F-2024-6573 | Floating Pragma | accepted | Observation | |
| F-2024-6572 | Missing Two-step Ownership Transfer Process | accepted | 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. |
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:
Scope Details | |
|---|---|
| Repository | https://github.com/orionprotocol/lumia/blob/audit/contracts/Lumia.sol→ |
| Commit | e2ae999704434f4d337d0dbf9f031371b29ba1b3 |
| Whitepaper | N/a |
| Requirements | N/a |
| Technical Requirements | N/a |
Scope Details
- Commit
- e2ae999704434f4d337d0dbf9f031371b29ba1b3
- Whitepaper
- N/a
- Requirements
- N/a
- Technical Requirements
- N/a