Introduction
We express our gratitude to the BRIKN team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
BRIKN is the distribution token of Brik by Brik which allows owners who stake their tokens to receive rewards from the entire property ecosystem. With many years in the property sector, they aim to deliver properties of exceptional quality to a high valued property portfolio.
| title | content |
|---|---|
| Platform | Polygon |
| Language | Solidity |
| Tags | ERC20 |
| Timeline | 07/02/2023 - 14/02/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/Decubate-com/smart-contracts→ |
| Commit | 01827e9e0d3746235776745019e8035d4b20e0bb |
Review Scope
- Commit
- 01827e9e0d3746235776745019e8035d4b20e0bb
Audit Summary
10/10
100%
9/10
8/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 BRIKN |
| Audited By | Hacken |
| Website | https://brikn.io/→ |
| Changelog | 27/01/2023 – Initial Review |
| 09/02/2023 – Second Review | |
| 14/02/2023 – Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for BRIKN
- Audited By
- Hacken
- Website
- https://brikn.io/→
- Changelog
- 27/01/2023 – Initial Review
- 09/02/2023 – Second Review
- 14/02/2023 – Third Review
System Overview
BRIKN is a mixed-purpose smart contract system which includes the audit scope contracts:
Whitelisted — access control contract. Roles supported:
Owner.
Whitelisted accounts.
Blacklisted accounts.
BRIKToken — burnable ERC20 token (inherit Whitelisted). Features:
is not mintable.
transfers are blocked for blacklisted accounts.
transfers are blocked till specified moment (except of transfers from/to whitelisted accounts).
swaps in set pairs are blocked till specified moment.
Privileged roles
Owner:
able to set whitelisted accounts.
able to lock owned assets, transferring them to the 0xdEaD address.
Whitelisted accounts:
able to setup blacklisted accounts.
able to setup date till which tokens selling would not be possible.
able to setup date till which tokens transfers would not be possible.
Executive Summary
Documentation quality
The total Documentation quality score is 8 out of 10.
Functional requirements are partially outdated.
Technical description does not correspond to the dev environment.
Code quality
The total Code quality score is 9 out of 10.
The development environment is configured.
Some project dependencies (truffle) are considered to be installed globally and are not mentioned in the package.json file.
Contract misses an event for state variable updation
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, 4 medium, and 7 low severity issues. Out of these, 9 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.6. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
In case the user account is blacklisted, user funds are locked.
Whitelisted users may pause transactions on the contract for any period of time.
Whitelisted users may pause swaps at any exchange service (in the pairs include the BRIKToken asset) for any period of time.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-121 | Requirement Violation | fixed | Medium | |
| F-2023-1217 | Undocumented Behavior | fixed | Medium | |
| F-2023-121 | Requirement Violation | fixed | Medium | |
| F-2023-1215 | Duplicated State Variable | fixed | Medium | |
| F-2023-122 | Missing Event for State Updation | unfixed | Low | |
| F-2023-122 | Documentation Mismatch | unfixed | Low | |
| F-2023-122 | Redundant Statements | fixed | Low | |
| F-2023-122 | Documentation Mismatch | fixed | Low | |
| F-2023-122 | Unchecked Return Value | fixed | Low | |
| F-2023-122 | Redundant Use of SafeMath | 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/Decubate-com/smart-contracts→ |
| Commit | 01827e9e0d3746235776745019e8035d4b20e0bb |
| Whitepaper | Provided→ |
| Requirements | Provided |
| Technical Requirements | Provided |
Scope Details
- Commit
- 01827e9e0d3746235776745019e8035d4b20e0bb
- Whitepaper
- Provided→
- Requirements
- Provided
- Technical Requirements
- Provided