Introduction
We thank Farcana for allowing us to conduct a Smart Contract Security Assessment. This document outlines our methodology, limitations, and results of the security assessment.
Farcana integrates blockchain technology with traditional game development for a seamless, immersive gaming experience.
title | content |
---|---|
Platform | EVM |
Language | Solidity |
Tags | ERC-20, Vesting |
Timeline | 12/12/2023 - 29/12/2023 |
Methodology | https://hackenio.cc/sc_methodology→ |
Last Review Scope | |
---|---|
Repository | https://github.com/farcana/smart-contracts→ |
Commit | 3a8a187 |
Last Review Scope
- Commit
- 3a8a187
Audit Summary
10/10
0%
9/10
6/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 Farcana |
Audited By | Ivan Bondar |
Approved By | Przemyslaw Swiatowiec, Ataberk Yavuzer |
Website | https://www.farcana.com→ |
Changelog | 29/12/2023 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Farcana
- Audited By
- Ivan Bondar
- Approved By
- Przemyslaw Swiatowiec, Ataberk Yavuzer
- Website
- https://www.farcana.com→
- Changelog
- 29/12/2023 - Final Report
System Overview
Farcana integrates blockchain technology with traditional game development for a seamless, immersive gaming experience. As the first project of its kind, our flagship multiplayer online game, Farcana, leverages web3 technologies. The game has a fully player-controlled economy, marketplace, and asset ownership.
The files in the scope:
FarcanaToken — is an ERC20 token. Upon deployment, it is initialized with a specified name, symbol, decimal count, total supply, and an owner address. The token supply is predetermined and fixed, with no provisions for minting additional tokens post-deployment. However, it includes a burn function, allowing the owner to reduce the total supply by burning tokens.
FarcanaVesting — token vesting mechanism designed for the Farcana ecosystem. It allows for the creation of multiple vesting schedules per beneficiary, enabling the controlled and gradual release of tokens. Key features include:
Flexible Vesting Schedules: Each beneficiary can have multiple vesting schedules, each with its own cliff, duration, start time, and total amount of tokens to be released.
Claim Functionality: Beneficiaries can claim their vested tokens once they are due for release.
Substantial Initial Release: The contract is designed such that a significant portion of tokens becomes claimable immediately after the cliff period, with the remaining amount vested linearly over the rest of the duration.
Privileged roles
FarcanaToken.sol:
Owner:
Capable of burning tokens from their own holdings.
Authorized to transfer ownership of the contract.
FarcanaVesting.sol:
Owner:
Authorized to set the TGE (Token Generation Event) timestamp.
Empowered to add vesting schedules for any beneficiary.
Able to change the beneficiary address for existing vesting schedules.
Can access and review all data related to a specific beneficiary's vesting schedule.
Executive Summary
Documentation quality
The total Documentation Quality score is 6 out of 10.
Functional requirements are not provided.
Overall system requirements are provided.
No roles description.
No Tokenomics.
Technical description is not provided.
NatSpec is partially missing.
Code quality
The total Code Quality score is 9 out of 10.
The development environment is not configured.
Test coverage
Code coverage of the project is 0.0% (branch coverage).
No tests.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 2 medium, and 3 low severity issues, 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.4. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
Beneficiary Change Risk:
The FarcanaVesting contract grants the owner the authority to modify the beneficiary address of any existing vesting schedule. While this offers flexibility, it also introduces a significant risk factor. If the owner mistakenly inputs an incorrect address or in the event of a compromise of the owner's keys, the tokens intended for one beneficiary could be erroneously or maliciously redirected to another address.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2023-0125 | Unrestricted Authority to Alter Vesting Beneficiary Addresses | fixed | Medium | |
F-2023-0124 | Insufficient Parameter Validation in addVestingSchedule() Function of Vesting Contract | fixed | Medium | |
F-2023-0128 | Non-Utilization of SafeERC20 for Token Transfers in Vesting Contract | fixed | Low | |
F-2023-0127 | Inappropriate Mutability of tgeTime in Vesting Contract | fixed | Low | |
F-2023-0126 | Single-Step Ownership Transfer | fixed | Low | |
F-2023-0135 | Missing zero address checks | fixed | Observation | |
F-2023-0134 | State variables default visibility | fixed | Observation | |
F-2023-0133 | Lack of Event Emissions in Key Functions of Vesting Contract | fixed | Observation | |
F-2023-0132 | Redundant SafeMath | fixed | Observation | |
F-2023-0131 | Floating Pragma | fixed | Observation |
Identify vulnerabilities in your smart contracts.
Appendix 1. Severity Definitions
When auditing smart contracts Hacken is using a risk-based approach that considers the potential impact of any vulnerabilities and the likelihood of them being exploited. The matrix of impact and likelihood is a commonly used tool in risk management to help assess and prioritize risks.
The impact of a vulnerability refers to the potential harm that could result if it were to be exploited. For smart contracts, this could include the loss of funds or assets, unauthorized access or control, or reputational damage.
The likelihood of a vulnerability being exploited is determined by considering the likelihood of an attack occurring, the level of skill or resources required to exploit the vulnerability, and the presence of any mitigating controls that could reduce the likelihood of exploitation.
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/farcana/smart-contracts→ |
Commit | 0c8f5193b9249d5b02fdb57de1ecdbf4ebe30dbb |
Whitepaper | N/A |
Requirements | NatSpec |
Technical Requirements | N/A |
Scope Details
- Commit
- 0c8f5193b9249d5b02fdb57de1ecdbf4ebe30dbb
- Whitepaper
- N/A
- Requirements
- NatSpec
- Technical Requirements
- N/A
Contracts in Scope
contracts/FarcanaToken.sol
contracts/FarcanaVesting.sol