Introduction
We express our gratitude to the AugmentLabs team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
AugmentLabs has developed a stablecoin protocol called AGC with an Automated Marketcap Comparison (AMCF). The protocol was constructed to be novel and resilient to attacks of all forms by addressing fundamental issues of existing designs and having dynamic systems that can change the underlying way in which the algorithmic system reacts to an attack vector, especially a massive depegging event.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | ERC20; Staking |
| Timeline | 13/01/2023 - 28/02/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/augmentlabs-io/contracts→ |
| Commit | 87bbcbe571601c52cc6e9823558fc2f7115d0666 |
Review Scope
- Commit
- 87bbcbe571601c52cc6e9823558fc2f7115d0666
Audit Summary
10/10
84.94%
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 AugmentLabs |
| Audited By | Hacken |
| Website | https://augmentlabs.io/→ |
| Changelog | 20/01/2023 - Initial Review |
| 16/02/2023 - Second Review | |
| 28/02/2023 - Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for AugmentLabs
- Audited By
- Hacken
- Website
- https://augmentlabs.io/→
- Changelog
- 20/01/2023 - Initial Review
- 16/02/2023 - Second Review
- 28/02/2023 - Third Review
System Overview
AugmentLabs is a mixed-purpose ERC20/Stacking system with the following contracts:
AGC — upgradable ERC-20 token that mints all initial supply to a deployer. Minting and burning is allowed by the Minter on demand. It has the following attributes:
Name: AGC
Symbol: AGC
Differences from the ERC20 standard: the token is not transferable.
USC — upgradable ERC-20 token that mints all initial supply to a deployer. Minting is allowed by the Minter on demand. It has the following attributes:
Name: USC
Symbol: USC
Other parameters are default for the ERC20 standard
TokenController — an upgradable smart contract that will have MINTER_ROLE of AGC & USC to perform the redeem functionality between AGC/USC.
Has a safety switch.
Role-based authentication.
Can burn USC and mint AGC to a specific user address.
Can burn AGC and mint USC to a specific user address.
MasterChef — an upgradable smart contract that allows users to stake USDT and get USC rewards at a specified ROI/year.
Has a safety switch.
Can mint USC to yield rewards to pool stakers.
Privileged roles
The MasterChef contact has a single owner role.
The TokenController contract has PAUSERROLE, UPGRADERROLE and REDEEMERROLE roles and must take the MINTERROLE of USC and AGC.
The MINTER_ROLE of AGC and USC can mint tokens on demand without any restrictions. The burn functions in USC are unprotected.
Recommendations
The system relies on the security of the privileged roles’ private keys, which can impact the execution flow and security of the funds. We recommend those accounts to be at least ⅗ multi-sig.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
A Whitepaper is provided.
NatSpec is included in the code.
Technical description and functional requirements are provided.
Code quality
The total Code quality score is 9 out of 10.
The development environment is configured.
5 out of 103 tests are failing.
Test coverage
Code coverage of the project is 84.94% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is present.
Security score
Upon auditing, the code was found to contain 1 critical, 5 high, 7 medium, and 16 low severity issues. Out of these, 29 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 9.3. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
No substantial risks were identified.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-0265 | Token Supply Manipulation | fixed | Critical | |
| F-2023-0270 | Data Inconsistency | fixed | High | |
| F-2023-0269 | Undocumented Behavior | fixed | High | |
| F-2023-0268 | Requirements Violation | fixed | High | |
| F-2023-0267 | Requirements Violation | fixed | High | |
| F-2023-0266 | Requirements Violation | fixed | High | |
| F-2023-0277 | Best Practice Violation - Unchecked Transfer | fixed | Medium | |
| F-2023-0276 | Using Block Number Attribute as a Proxy of Time | fixed | Medium | |
| F-2023-0275 | Missing Functionality | fixed | Medium | |
| F-2023-0274 | Undocumented Functionality | fixed | Medium |
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/augmentlabs-io/contracts→ |
| Commit | 87bbcbe571601c52cc6e9823558fc2f7115d0666 |
| Whitepaper | Provided→ |
| Requirements | Provided→ |
| Technical Requirements | Provided→ |