Introduction
We express our gratitude to the Gunzilla team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Gunzilla aims to craft captivating gaming experiences that deeply resonate with players, shaping our game development process around their preferences from inception. We prioritize assembling resilient teams of self-driven individuals, fostering an environment where everyone can unleash their full potential and collaborate harmoniously.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | ERC20; Vesting |
| Timeline | 02/04/2023 - 05/05/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/Gunzilla-Games/tokenomics-smart-contract→ |
| Commit | afe95e57 |
Review Scope
- Commit
- afe95e57
Audit Summary
10/10
100.00%
8/10
9/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 Gunzilla |
| Audited By | Hacken |
| Website | https://gunzillagames.com/en/→ |
| Changelog | 11/04/2023 - Initial Review |
| 05/05/2023 - Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Gunzilla
- Audited By
- Hacken
- Changelog
- 11/04/2023 - Initial Review
- 05/05/2023 - Second Review
System Overview
Gunzilla is a mixed-purpose system with the following contracts:
GunzillaToken — ERC-20 token that mints all initial supply to an address passed during initialization. It is an upgradable, pausable smart contract.
It has the following attributes:
Name: Gunzilla Token
Symbol: GUN
Decimals: 18
Total supply: 10b tokens.
WGUN — ERC-20 token, which is wrap for the GunzillaToken It is an upgradable, pausable smart contract. Tokens can be minted in an amount equal to the amount Ether sent to the smart contract. Tokens can be burned by any holder, amount of Ether equal to burned amount would be transferred to the user.
It has the following attributes:
Name: Wrapped Gunzilla Token
Symbol: WGUN
Decimals: 18
GunzillaPaymentPlan – an abstract upgradable smart contract that is used for creating vesting for system users.
GunzillaLinearPaymentPlan – a smart contract inherited from the GunzillaPaymentPlan. This smart contract uses linear token vesting. The cliff and periods duration and amount can be set by the owner.
GunzillaFixedDatePaymentPlan – a smart contract inherited from the GunzillaPaymentPlan. This smart contract uses fixed dates to unlock tokens for certain users. The unlock schedule can be set by the owner.
IBotProtector – an interface for using BotProtector smart contract functionality.
Privileged roles
The admin of the GunzillaToken contract can set the
BotProtectorvariable.The PAUSEROLE of the GunzillaToken_ contract can pause/unpause smart contracts.
The admin of the WGUN contract can set the
BotProtectorvariable.The PAUSEROLE of the WGUN_ contract can pause/unpause smart contracts.
The owner of the GunzillaPaymentPlan can pause/unpause smart contracts. The owner can set vesting settings for the user.
The owner of the GunzillaLinearPaymentPlan is available to set payment plans for the vesting.
The owner of the GunzillaFixedDatePaymentPlan is available to set payment plans for the vesting.
Executive Summary
Documentation quality
The total Documentation quality score is 9 out of 10.
NatSpec is provided with a full repository description.
No whitepaper.
Run instructions are provided.
Technical specification is provided.
Functional requirements are provided.
Code quality
The total Code quality score is 8 out of 10.
Solidity Style Guide violations.
Best practice violations.
Test coverage
Code coverage of the project is 100.00% (branch coverage).
Deployment and basic user interactions are covered with tests.
Security score
Upon auditing, the code was found to contain 0 critical, 2 high, 1 medium, and 7 low severity issues. Out of these, 4 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.5. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The smart contracts WGUN, GunzillaToken call functions from the external BotProtector smart contract, which is out of the audit scope. Its functionality cannot be verified.
The logic of the vestTokens() function allows to provide tokens instantly if the owners of the smart contract set the appropriate vesting settings.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-0046 | Data Consistency | mitigated | High | |
| F-2023-0045 | Unverifiable Logic | mitigated | High | |
| F-2023-0047 | Missing Event for Critical Value Update | fixed | Medium | |
| F-2023-0054 | Functions that Can Be Declared External | unfixed | Low | |
| F-2023-0053 | Functions that Can Be Declared External | fixed | Low | |
| F-2023-0052 | Unnecessary State Variable | fixed | Low | |
| F-2023-0051 | Use of Hard-Coded Values | unfixed | Low | |
| F-2023-0050 | Style Guide: Maximum Line Length | unfixed | Low | |
| F-2023-0049 | Floating Pragma | fixed | Low | |
| F-2023-0048 | Missing Zero Address Validation | unfixed | 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/Gunzilla-Games/tokenomics-smart-contract→ |
| Commit | afe95e57 |
| Whitepaper | Not provided |
| Requirements | Provided→ |
| Technical Requirements | Not provided |
Scope Details
- Commit
- afe95e57
- Whitepaper
- Not provided
- Requirements
- Provided→
- Technical Requirements
- Not provided