Harbor Finance Info
Harbor Finance is a high-performance, gamified DeFi ecosystem that seamlessly merges NFT-based asset structures, sustainable passive income strategies, and immersive financial gameplay. Our mission: to make automated earning not just simple, but genuinely enjoyable. Engineer intricate Yield Items. Harvest $FISH. Collect ongoing incentives. Rise through the ranks as a master-class Fishercat.
TrustNet Score
The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.
Real-Time Threat Detection
Real-time threat detection, powered by Cyvers.io,
is currently not
activated
for this project.
This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks.
For more information, click here.
Security Assessments
Summary and Final Words
No crucial issues found
The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.
Contract owner cannot mint
It is not possible to mint new tokens.
Contract owner cannot blacklist addresses.
It is not possible to lock user funds by blacklisting addresses.
Contract owner cannot set high fees
The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.
Contract cannot be locked
Owner cannot lock any user funds.
Token cannot be burned
There is no burning within the contract without any allowances
Ownership is not renounced
The owner retains significant control, which could potentially be used to modify key contract parameters.
Contract is not upgradeable
The contract does not use proxy patterns or other mechanisms to allow future upgrades. Its behavior is locked in its current state.
Scope of Work
This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.
The auditing process consists of the following systematic steps:
- Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
- Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
- Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
- Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
- Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
- Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
- Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.
A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.
Final Words
The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.
Ownership Privileges
TerritoryNFT.sol
- The DEFAULT_ADMIN_ROLE can grant/revoke all other roles in the system.
- The MINTER_ROLE can mint new territory NFTs (mintByRole).
- The STAKING_MANAGER_ROLE can stake items into territories (stakeItem).
- The STAKING_MANAGER_ROLE can unstake items from territories (unstakeItem).
- The ADMIN_ROLE can update the TerritoryRegistry address (updateTerritoryRegistry).
Note - This Audit report consists of a security analysis of the Harbor smart contract. This analysis did not include functional testing (or unit testing) of the contract’s logic. Moreover, we only audited the mentioned contract for the Harbor team. Other contracts associated with the project were not audited by our team. We recommend investors do their own research before investing.
Files and details
Findings and Audit result
medium Issues | 3 findings
Resolved
#1 medium Issue
Missing 'isContract' check.
The contract lacks a validation check to ensure that specific parameters are contract addresses. Without this check, there is a risk that non-contract addresses (such as externally owned accounts, or EOAs) could be mistakenly set for parameters intended to reference other contracts. This could lead to failures in executing critical interactions within the contract, as EOAs do not support contract-specific functions.
Resolved
#2 medium Issue
Duplicate itemId staking
The TerritoryNFT contract contains a critical vulnerability allowing the same item to be staked multiple times. The stakeItem function only checks if a specific slot is empty, but fails to verify whether an item is already staked elsewhere. The unstakeItem function's implementation confirms this flaw by only removing the first occurrence of an item from the tracking array before exiting the loop. This high-impact vulnerability could lead to asset duplication, reward multiplication, and economic imbalance within the ecosystem.
Resolved
#3 medium Issue
Unlimited Territory Minting
The mintByRole function allows unlimited minting of territory NFTs with no maximum supply cap. While this is a common design pattern in GameFi projects that provides flexibility for game expansion and economy management, it creates centralization risks if misused.
low Issues | 3 findings
Acknowledged
#1 low Issue
Missing Role Assignments in TerritoryNFT Constructor
The TerritoryNFT contract defines multiple privileged roles (MINTER_ROLE and STAKING_MANAGER_ROLE) that control essential functionality, but the constructor fails to assign these roles to any address. While it correctly grants ADMIN_ROLE and DEFAULT_ADMIN_ROLE to the admin parameter, it omits initialization of the other critical roles. This creates a post-deployment vulnerability where core functionality like minting new territories and managing staked items remains completely inaccessible until an admin manually grants these roles in separate transactions. If admin access is compromised before these assignments occur, the territory minting and staking management functionality would be permanently disabled.
Resolved
#2 low Issue
Missing boundary check
he function fails to verify that slotIndex is within the valid range (0 to maxSlots-1). While it checks if there are sufficient slots available using territory.usedSlots + slotsRequired <= maxSlots, it does not validate that the provided slotIndex itself is valid. This allows staking at invalid slot positions that exceed the territory's boundaries, potentially causing unexpected behavior or data corruption.
Resolved
#3 low Issue
Multi-slot Handling Design Limitation
The contract uses a simplified slot tracking model where only the starting slot of multi-slot items is recorded in the _slotItems mapping. While this approach is consistently applied in both staking and unstaking functions, it makes individual slot status tracking impossible and could create confusion when implementing front-end interfaces or interacting with contracts. This design choice, though functional, limits visibility into exactly which slots are occupied within a territory.
informational Issues | 1 findings
Acknowledged
#1 informational Issue
Floating pragma solidity version
Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.