Introduction
We express our gratitude to the Digital Era team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
DERA is a protocol which allows to interact with the different farming pools.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | DEX |
| Timeline | 05/04/2024 - 06/05/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/Digital-Era-Foundation/smart-contracts→ |
| Commit | 4b04fec66620b39bcb67ca0686af0a8a3ef60821 |
Review Scope
- Commit
- 4b04fec66620b39bcb67ca0686af0a8a3ef60821
Audit Summary
10/10
100%
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 Digital Era |
| Audited By | Max Fedorenko, Roman Tiutiun |
| Approved By | Grzegorz Trawinski |
| Website | https://hacken.io→ |
| Changelog | 10/04/2024 - Preliminary Report; 06/05/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Digital Era
- Audited By
- Max Fedorenko, Roman Tiutiun
- Approved By
- Grzegorz Trawinski
- Website
- https://hacken.io→
- Changelog
- 10/04/2024 - Preliminary Report; 06/05/2024 - Final Report
System Overview
DERA is a protocol that allows to interaction with different farming pools and includes the following contracts:
DERA1 — simple ERC-20 token that mints all initial supply to a deployer.
DeraAdmin — a contract which allows to manage whitelisted tokens, protocol pools, and allocation percentages, among other functionalities, while ensuring only the owner can execute administrative tasks.
DeraEngine — a contract serves as the operational engine for the DERA protocol, facilitating the deposit funds to the third party protocols, minting and burning of DERA tokens based on USDT values.
BeefyProtocolConnector — a connector facilitating the deposit and withdrawal of funds from the protocol, performing necessary token swaps and liquidity operations, and ensuring seamless integration with the DERA protocol's operations.
Privileged roles
The owner of the DERA1 contract can mint, and burn tokens.
The owner of the DeraAdmin contract can add a protocol pool, set protocol allocation, update the protocol pool, remove protocol, add whitelisted tokens, remove whitelisted tokens, and set spread.
Executive Summary
Documentation quality
The total Documentation Quality score is 10 out of 10.
Code quality
The total Code Quality score is 10 out of 10.
Test coverage
Code coverage of the project is 100% (branch coverage).
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 1 medium, and 1 low severity issues, leading to a security score of 9 out of 10. Upon the retest, all issues were fixed resulting in the final 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.
Risks
Dependency on External Logic for Implemented Logic: The implemented DeraEngine and BeefyProtocolConnector logic highly depends on external contracts not covered by the audit. This reliance introduces risks if these external contracts are compromised or contain vulnerabilities, affecting the audited project's integrity.
System Reliance on External Contracts: The functioning of the system significantly relies on specific external contracts. Any flaws or vulnerabilities in these contracts adversely affect the audited project, potentially leading to security breaches or loss of funds.
Interactions with External DeFi Protocols: Dependence on external DeFi protocols inherits their risks and vulnerabilities. This might lead to direct financial losses if these protocols are exploited, indirectly affecting the audited project.
Centralized Control of Minting and Burning Process: The token contract’s design allows for centralized control over the minting and burning process, posing a risk of unauthorized token issuance, potentially diluting the token value and undermining trust in the project's economic governance.
Administrative Key Control Risks: The digital contract architecture relies on administrative keys for critical operations. Centralized control over these keys presents a significant security risk, as compromise or misuse can lead to unauthorized actions or loss of funds.
Absence of Time-lock Mechanisms for Critical Operations: Without time-locks on critical operations, there is no buffer to review or revert potentially harmful actions, increasing the risk of rapid exploitation and irreversible changes.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-2066 | Unlimited Allowance | fixed | Medium | |
| F-2024-2059 | Unrestricted System Spread | fixed | Low | |
| F-2024-2069 | Floating Pragma | accepted | Observation | |
| F-2024-2065 | Commented Code Parts TODO And NOTE Comments | fixed | Observation | |
| F-2024-2063 | Redundant Import Statement | 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/Digital-Era-Foundation/smart-contracts→ |
| Commit | 4b04fec66620b39bcb67ca0686af0a8a3ef60821 |
| Whitepaper | |
| Requirements | https://docs.google.com/document/d/1JgguR4-rnOp7Fu5lYx48M8IVqH4-9CJWgkhJu2rC86I/edit#heading=h.iviihide3wd4→ |
| Technical Requirements | https://docs.google.com/document/d/1JgguR4-rnOp7Fu5lYx48M8IVqH4-9CJWgkhJu2rC86I/edit#heading=h.iviihide3wd4→ |
Scope Details
- Commit
- 4b04fec66620b39bcb67ca0686af0a8a3ef60821
- Whitepaper