Introduction
We express our gratitude to the Kepler Digitals team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Avia is an ERC-20 token which presents burnable and blacklist functionalities. Its total supply caps to 100 Million token units.
Following the audit, an additional verification was conducted due to a parsing issue identified with Avalanche blockchain explorers. The token's name and symbol parameters, initially passed directly to the inherited ERC20 constructor, were not correctly detected by the Avalanche explorer, though they functioned as expected on other EVM-compatible networks such as Ethereum and Polygon.
To address this, a modification is implemented in commit bb7cbfd4a4e2a8bc307f7595240db8e50c2b5171, explicitly including the name and symbol parameters in the contract's constructor. This post-audit check solely confirmed the update to these parameters, ensuring they are correctly recognized by the explorer without impacting any other aspects of the contract's functionality or security.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for Kepler Digitals |
| Audited By | Turgay Arda Usman, Giovanni Franchi |
| Approved By | Grzegorz Trawinski |
| Website | {Client_Website} |
| Changelog | 15/10/2024 - Preliminary Report |
| 31/10/2024 - Final Report | |
| Platform | Avalanche |
| Language | Solidity |
| Tags | ERC20, Fungible Token |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Kepler Digitals
- Audited By
- Turgay Arda Usman, Giovanni Franchi
- Approved By
- Grzegorz Trawinski
- Website
- {Client_Website}
- Changelog
- 15/10/2024 - Preliminary Report
- 31/10/2024 - Final Report
- Platform
- Avalanche
- Language
- Solidity
- Tags
- ERC20, Fungible Token
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/KeplerDigitals/Avia-Token→ |
| Commit | 6360569 |
Review Scope
- Commit
- 6360569
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are fully provided.
Technical description is provided.
NatSpecs are detailed and insightful.
Code quality
The code mostly follows best practises in terms of readability and gas efficiency.
See informational findings for more details.
The development environment is configured.
Test coverage
Code coverage of the project is 93.75% (branch coverage).
The basic user behavior is thoroughly tested.
Negative test case coverage is sufficient.
System Overview
Kepler Digitals is a fungible token protocol with the following contract:
AVIA — simple ERC-20 token that mints all initial supply to an admin address which is passed as a constructor parameter. Additional minting is not allowed. Additionally the token enables burn, blacklist and pause functionalities.
It has the following attributes:
Name: Kepler
Symbol: AVIA
Decimals: 18
Total supply: 100m tokens.
Privileged roles
The
ADMIN_ROLEcan blacklist an address therefore making it unable to transfer or receive tokens.The
ADMIN_ROLEcan pause or unpause the contract effectively halting the possibility to transfer or burn tokens.The
DEFAULT_ADMIN_ROLEcan grantADMIN_ROLErights to new addresses.
Potential Risks
The project concentrates minting tokens in a single address, raising the risk of fund mismanagement or theft, especially if key storage security is compromised.
The project includes a blacklist feature, allowing users to be arbitrarily blacklisted by an entity with the ADMIN_ROLE. This creates a centralisation risk, where a malicious admin could unjustly prevent legitimate users from transferring or receiving tokens, leading to potential denial-of-service without valid justification.
The project implements pause and unpause functionalities, which can be valuable in emergency situations. However, this also introduces a centralization risk, as it grants the power to restrict users from transferring or receiving tokens, potentially disrupting normal operations.
The project implements a blacklist feature that restricts certain addresses from transferring or receiving tokens. However, this deviates from the ERC20 standard, potentially causing compatibility issues with systems relying on full ERC20 compliance.
Granting significant control to whitelist users without adequate checks leads to unpredictable operational disruptions, impacting user confidence and system stability.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-6637 | Admin can frontrun user transfers | accepted | Low | |
| F-2024-6636 | Unauthorized Token Burn via burnFrom Function | fixed | Low | |
| F-2024-6808 | Role Revocation Could Lead to Unrestricted Token Transfers for Former Role Holders | accepted | Low | |
| F-2024-6639 | Admin can be blacklisted | fixed | Observation | |
| F-2024-6630 | Non-Compliance with naming conventions for contract and file names | fixed | Observation | |
| F-2024-6629 | Lack of fine-grained access control | fixed | Observation | |
| F-2024-6628 | Functions not used internally can be marked as external | fixed | Observation | |
| F-2024-6627 | Lack of named parameters in mapping | 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. |
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/KeplerDigitals/Avia-Token→ |
| Commit | 6360569571c9d1976e3040a2bf145d6312494c04 |
| Whitepaper | N/A |
| Requirements | Kepler (AVIA) Token Requirements Document→ |
| Technical Requirements | Kepler (AVIA) Token Requirements Document→ |
Scope Details
- Commit
- 6360569571c9d1976e3040a2bf145d6312494c04
- Whitepaper
- N/A
- Requirements
- Kepler (AVIA) Token Requirements Document→
- Technical Requirements
- Kepler (AVIA) Token Requirements Document→
Assets in Scope
Appendix 3. Additional Valuables
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.