Introduction
We express our gratitude to the RWA.Inc team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
RWA.inc is an ERC20 token that facilitates seamless transfers, balance inquiries, approval allowances and several other accessibility-related functionalities.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | ERC20 |
| Timeline | 21/12/2023 - 4/1/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Last Review Scope | |
|---|---|
| Repository | https://github.com/RWAinc/Testcase→ |
| Commit | c64874c6f97098922eac972a75371dc22e2ad96c |
Last Review Scope
- Repository
- https://github.com/RWAinc/Testcase→
- Commit
- c64874c6f97098922eac972a75371dc22e2ad96c
Audit Summary
10/10
91.67%
9/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 RWA.Inc |
| Audited By | Carlo Parisi, Roman Tiutiun |
| Approved By | Ataberk Yavuzer |
| Website | https://www.rwa.inc/→ |
| Changelog | 4/1/2024 - Preliminary Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for RWA.Inc
- Audited By
- Carlo Parisi, Roman Tiutiun
- Approved By
- Ataberk Yavuzer
- Website
- https://www.rwa.inc/→
- Changelog
- 4/1/2024 - Preliminary Report
System Overview
RWA.inc is an ERC20 token with multiple functionalities such as Approval, Allowance, Balance Inquiry, Access Controls and Token Metadata.
It has the following attributes:
Name: RWA
Symbol: $RWA
Decimals: 18
Total supply: 1B tokens.
Privileged roles
The owner of RWA.inc can update the router address, transfer ownership and update exemption restriction for trading the token.
The project owner can receive tokens mistakenly sent to the contracts.
Executive Summary
Documentation quality
The total Documentation Quality score is 10 out of 10.
Functional requirements are provided
Technical description is provided.
NatSpec is present.
Code quality
The total Code Quality score is 9 out of 10.
The code duplicates commonly known contracts instead of reusing them.
Test coverage
Code coverage of the project is 91.67% (branch coverage)
Deployment and basic user interactions are covered with tests.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 0 medium, and 2 low severity issues, 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 9.5. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
There are external contracts which interacts with RWA.inc contract, such as IRouter and IFactory. This interactions could lead to unexpected consequences that are not predictable in this audit since these contracts are excluded from the audit scope.
The audited code appears unfinalized since there are comments throughout the contracts that describe the current code as for testing instead of production.
The contract is centralized. Before the trading is enabled, only authorized parties can transfer the token.
The contracts are a fork of OpenZeppelin contracts and libraries, customizations are performed in the function _transfer() in direct contrast to OpenZeppelin's advice to modify only the function _update() for transfer related customizations “All customizations that are required for transfers, mints, and burns should be done by overriding this function.”
The functionality that limits trading while not enabled will cause transaction to cost more gas even after the trading has been enabled.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-0310 | Token transfers may not be compatible for non-standard ERC20 tokens | fixed | Low | |
| F-2023-0258 | Unnecessary receive() function | fixed | Low | |
| F-2023-0315 | Owner can renounce the ownership of the contract | accepted | Observation | |
| F-2023-0257 | Missing zero address check | fixed | Observation | |
| F-2023-0256 | Floating pragma | fixed | Observation |
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/RWAinc/Testcase→ |
| Commit | c64874c6f97098922eac972a75371dc22e2ad96c |
| Requirements | https://github.com/RWAinc/Testcase/blob/main/README.md→ |
| Technical Requirements | https://github.com/RWAinc/Testcase/blob/main/README.md→ |
Scope Details
- Repository
- https://github.com/RWAinc/Testcase→
- Commit
- c64874c6f97098922eac972a75371dc22e2ad96c
- Technical Requirements
- https://github.com/RWAinc/Testcase/blob/main/README.md→