Introduction
We express our gratitude to the Authic Labs team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Authic Labs is a B2B SaaS loyalty platform, leveraging blockchain technology to create unique brand experiences.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | ERC1155; NFT Marketplace |
| Timeline | 10/06/2023 - 02/08/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://gitlab.com/a7717/authic-smart-contracts→ |
| Commit | e67250b |
Review Scope
- Commit
- e67250b
Audit Summary
10/10
83.71%
9/10
7/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 Authic Labs |
| Audited By | Hacken |
| Website | https://authic.io→ |
| Changelog | 15/06/2023 - Initial Review |
| 02/08/2023 - Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Authic Labs
- Audited By
- Hacken
- Website
- https://authic.io→
- Changelog
- 15/06/2023 - Initial Review
- 02/08/2023 - Second Review
System Overview
AuticLabs - is an NFT market place with following smart contracts:
FactoryV2 - is a factory smart contract for creating and managing ERC-1155 token collections. It is implemented with several features to enhance its security and functionality. The factory contract allows the creation of new token collections, each assigned a minter role to a designated marketplace.
PrimaryMarketPlaceV2 - is a marketplace smart contract that allows the purchase of ERC-1155 tokens at a fixed price. It includes the functionality to withdraw commission and pause, unpause the contract.
AuthicERC1155 - an implementation of a smart contract for ERC1155, which is a token standard on the Ethereum blockchain. The contract allows for the minting, transfer, and burning of tokens. It also includes royalty functionality, meaning that certain addresses can receive a defined percentage of transactions involving specific tokens. Additionally, it includes a mechanism to check if an address is permitted to mint tokens using a Merkle proof.
IERC1155 - an interface for ERC1155 smart contract.
IERC1155Receiver - an interface of ERC1155 token receiver.
IFactory - an interface for FactroryV2 smart contract.
IPrimaryMarketplace - an interface for PrimaryMarketPlaceV2 smart contract.
Privileged roles
FactoryV2:
Admin Role: granted to the contract deployer initially and can perform critical operations such as:
Pausing and unpausing the contract.
Modifying the marketplace and validator addresses.
PrimaryMarketPlaceV2:
Admin Role: granted to the contract deployer initially and can perform critical operations such as:
Withdraw fees, set validator pause and unpause smart contract.
AuthicERC1155:
Admin Role: granted to the contract creator during the contract deployment. It allows the holder to perform administrative functions such as:
Updating the Merkle root for whitelisting and setting the maximum supply for a token. It can add new token types to the contract.
The role is granted to the marketplace address during the contract deployment. This allows the holder to mint new tokens to a specified address.
Executive Summary
Documentation quality
The total Documentation quality score is 7 out of 10.
Technical description is inadequate:
Run instructions are provided.
Technical specification is provided.
NatSpec is sufficient.
Functional requirements are present, but only in a limited capacity:
Overall system requirements are provided.
No roles description.
Use cases are not fully described.
Code quality
The total Code quality score is 10 out of 10.
Best practice violation.
Test coverage
Code coverage of the project is 83.71% (branch coverage).
Deployment and basic user interactions are covered with tests.
Interactions by several users are tested thoroughly.
Security score
Upon auditing, the code was found to contain 2 critical, 2 high, 5 medium, and 2 low severity issues. Out of these, 11 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 8.9. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
Iterating over a dynamic array populated with custom tokenId can lead to Gas limit denial of service if the number of tokenIds gets too big.
Payment Splitter.sol is deprecated by OpenZeppelin, this can cause problems in the later stages of the project's lifecycle.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-0077 | Requirements Violation | fixed | Critical | |
| F-2023-0076 | Compilation Error | fixed | Critical | |
| F-2023-0079 | Requirements Violation | fixed | High | |
| F-2023-0078 | Funds Lock - Leftover Funds | fixed | High | |
| F-2023-0084 | Highly Permissive Role Access | mitigated | Medium | |
| F-2023-0083 | Inefficient Gas Modeling | fixed | Medium | |
| F-2023-0082 | Best Practice Violation: Usage of built-in Transfer | fixed | Medium | |
| F-2023-0081 | Unchecked Return Value | fixed | Medium | |
| F-2023-0080 | Missing Events | fixed | Medium | |
| F-2023-0086 | Function Naming Mismatch | 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://gitlab.com/a7717/authic-smart-contracts→ |
| Commit | e67250b |
| Whitepaper | Not provided |
| Requirements | Provided→ |
| Technical Requirements | Provided→ |