Introduction
We express our gratitude to the CaviarNine team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
CaviarNine is a forward-thinking fintech company focused on providing web3 users with advanced and user-friendly DeFi trading products built on the Radix platform.
| title | content |
|---|---|
| Platform | Radix |
| Language | Rust |
| Tags | DeFi, Exchange |
| Timeline | 28/09/2023 - 26/10/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/InvariancePte/scrypto-caviar→ |
| Commit | ef8cf80a21c9faa3ab5bfcc422ce6cc8f050dda0 |
Review Scope
- Commit
- ef8cf80a21c9faa3ab5bfcc422ce6cc8f050dda0
Audit Summary
10/10
10/10
10/10
10/10
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 | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for CaviarNine |
| Audited By | Hacken |
| Website | https://www.caviarnine.com/→ |
| Changelog | 17/10/2023 – Initial Review |
| 26/10/2023 – Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for CaviarNine
- Audited By
- Hacken
- Website
- https://www.caviarnine.com/→
- Changelog
- 17/10/2023 – Initial Review
- 26/10/2023 – Second Review
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
The project boasts comprehensive and meticulously detailed documentation, reflected in a well-structured README.md file. This not only provides essential overviews and introductions but also serves as a reliable reference for users and developers alike.
One of the standout attributes of the project's documentation is the consistent commenting throughout the codebase. Each significant function is supplemented with clear and concise comments, shedding light on the purpose, functionality, and underlying mechanics. These annotations effectively bridge any potential gaps in understanding and offer valuable insights into the code's nuances.
Moreover, the code itself embodies a degree of clarity that makes it innately comprehensible. Designed with the developer's perspective in mind, most segments of the code are self-explanatory.
Code quality
The total Code quality score is 10 out of 10.
The codebase is a clear example of high-quality coding standards. It's not just well-organized and clean, but it's also built using best practices, making it easy to read and understand. The added documentation in comments helps explain each part, ensuring anyone looking at the code can understand it easily.
Importantly, the testing approach is impressive. With nearly 100% coverage for both functions and lines, it's clear that a lot of effort has been put into making sure the code works as expected. This level of testing is not just good for this project but sets a great example for other projects in the Radix ecosystem. It's a clear indicator of the value the team places on quality and reliability.
The developers have also shown a deep understanding of the Radix ecosystem. Their expertise is evident in the way they've used the platform, ensuring that the code isn't just strong on its own, but also makes the most of what Radix protocol has to offer.
Architecture quality
Code coverage of the project is 10 out of 10.
The project's architectural design is both efficient and well-organized. The quantaswap interacts with other packages that match the same high quality as the audited package. These interactions are streamlined, with each package maintained as separate projects, ensuring clarity and ease of management.
A clear indicator of the project's well-thought-out architecture is the event system. Every action within the project triggers the appropriate events, ensuring transparency and facilitating easier debugging and monitoring.
Data storage within the project has been approached with efficiency in mind. The chosen methods ensure that data is stored compactly, minimizing overhead and ensuring fast access.
Moreover, when it comes to the functional implementation, the project doesn't compromise. Each function is designed to be gas-efficient, ensuring that operations are not just effective but also cost-effective. There's a clear emphasis on avoiding any wastage, optimizing both in terms of performance and resource consumption.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 0 medium, and 1 low severity issues. Out of these, 1 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 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-1576 | Lack of bucket address validation in burnliquidityreceipt | fixed | Low |
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 | |
|---|---|
| Repository | https://github.com/InvariancePte/scrypto-caviar→ |
| Commit | ef8cf80a21c9faa3ab5bfcc422ce6cc8f050dda0 |
| Whitepaper | Provided |
| Requirements | Provided |
| Technical Requirements | Provided |
Scope Details
- Commit
- ef8cf80a21c9faa3ab5bfcc422ce6cc8f050dda0
- Whitepaper
- Provided
- Requirements
- Provided
- Technical Requirements
- Provided