Introduction
We express our gratitude to the GiveUs team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
GiveUs is crypto donation made easy and secure. The first crowdfunding platform for humanitarian projects, built on the Blockchain. GiveUs is a gathering of individuals who believe in the power of collective action to make a meaningful difference in the world.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | DAO; Voting |
| Timeline | 05/05/2023 - 07/07/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/Krayt78/GiveUsContracts/tree/Audit-Changes→ |
| Commit | 74e5746634be8f74042b38b7a0c982a2b82f2a36 |
Review Scope
- Commit
- 74e5746634be8f74042b38b7a0c982a2b82f2a36
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 GiveUs |
| Audited By | Hacken |
| Website | https://giveus.io/→ |
| Changelog | 12/07/2023 - Initial Review |
| 13/06/2023 - Second Review | |
| 07/07/2023 - Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for GiveUs
- Audited By
- Hacken
- Website
- https://giveus.io/→
- Changelog
- 12/07/2023 - Initial Review
- 13/06/2023 - Second Review
- 07/07/2023 - Third Review
System Overview
The scope of this audit consists of a crowdfunding contract that aims to collect donations for project owners in the form of ERC20 tokens. The projects’ specifications are determined by an admin role called UPDATER_ROLE, which acts as the coordinator of each project funding in the system.
Every project has several threshold donation values. When the donations reach thresholds, the sessions are voted by the donors for passage to the next session. If the votes are successful, project owners can withdraw the donations. If not, the session is reset and gets into a cooldown period.
The files in the scope:
Crowdfunding.sol - The main contract of the system that is responsible for storing project specifications, the collection of funds, and withdrawal of funds.
ICrowdfunding.sol - Interface for Crowdfunding.sol.
Privileged roles
Crowdfunding contract use Access Control to restrict access to important functions. In the contract, there are 3 key privileged roles:
PAUSER_ROLE - address with this privilege is permitted to pause and unpause contract in case of emergency.
UPDATER_ROLE - address with this privilege has access to most functions. This role can create new crowdfunding projects, start a vote session for a threshold for a given project, add new supported token, update donation fee for given project, update project status (set if project is active or not), update project vote cooldown and withdraw funds to other projects.
WITHDRAWER_ROLE - this role is defined in the system but never used. Address with this role does not have more privileges than other addresses. This role should be deleted.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
Technical description is provided.
Description of the development environment is provided.
NatSpec is sufficient.
Code quality
The total Code quality score is 10 out of 10.
Best practices are followed.
Development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is present.
Interactions by several users are not tested thoroughly.
Security score
Upon auditing, the code was found to contain 2 critical, 3 high, 4 medium, and 4 low severity issues. Out of these, 13 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 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
No risks have been identified for this project.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-0666 | Funds Lock | fixed | Critical | |
| F-2023-0665 | Funds Lock / Undocumented Behavior | fixed | Critical | |
| F-2023-0669 | Highly Permissive Role Access / Token Balance Manipulation | fixed | High | |
| F-2023-0668 | Undocumented Mathematical Operation | fixed | High | |
| F-2023-0667 | Unchecked Transfer | fixed | High | |
| F-2023-0673 | Contradiction | fixed | Medium | |
| F-2023-0672 | Uninitialized Inheritance | fixed | Medium | |
| F-2023-0671 | Contradiction - Missing Validation | fixed | Medium | |
| F-2023-0670 | Non-Finalized Code | fixed | Medium | |
| F-2023-0677 | Redundant Modifier Usage | 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/Krayt78/GiveUsContracts/tree/Audit-Changes→ |
| Commit | 74e5746634be8f74042b38b7a0c982a2b82f2a36 |
| Whitepaper | Provided→ |
| Requirements | Provided→ |
| Technical Requirements | Provided→ |