Introduction
We express our gratitude to the Kryptomon team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Kryptomon is a groundbreaking game, that adopts Chainlink CCIP to manage multiple chain assets from a single platform.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | ERC721, ERC1155, ERC20, Chainlink CCIP |
| Timeline | 06/02/2024 - 26/02/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/KryptomonDAO/chain-migration-contracts→ |
| Commit | a36e6a1 |
Review Scope
- Commit
- a36e6a1
Audit Summary
10/10
95%
10/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 Kryptomon |
| Audited By | Turgay Arda Usman |
| Approved By | Grzegorz Trawinski |
| Website | https://www.kryptomon.co→ |
| Changelog | 12/02/2024 - Preliminary Report && 26/02/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Kryptomon
- Audited By
- Turgay Arda Usman
- Approved By
- Grzegorz Trawinski
- Website
- https://www.kryptomon.co→
- Changelog
- 12/02/2024 - Preliminary Report && 26/02/2024 - Final Report
System Overview
Kryptomon is a groundbreaking game, that adopts Chainlink CCIP to manage multiple chain assets from a single platform. It has the following contracts:
KmonMinter — Minter contract that users interact with.
StakKmonMigrate — The contract that actually mints the NFTs and handles funds transfers to users' wallets.
Privileged roles
The owner of the
KmonMinter.solcontract can modify the source chain, allowed addresses, withdraw funds, trigger migrations,The owner of the
KmonMigrate.solcan validate and modify tokens for the system, modify the router and its arguments, modify allowed tokens, withdraw funds, pause the contractAllowed addresses can receive ccip messages via
KmonMinter.sol
Executive Summary
Documentation quality
The total Documentation Quality score is 6 out of 10.
Functional requirements are partially provided.
Technical description are provided.
Code quality
The total Code Quality score is 10 out of 10.
The code follows best practices and style guides.
The development environment is configured.
Test coverage
Code coverage of the project is 95.00% (branch coverage),
Deployment and basic user interactions are covered with tests.
Negative case coverage is taken into consideration.
Interactions by several users are tested .
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 0 medium, and 1 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
The KmonMigrate.sol and KmonMinter.sol owners can withdraw funds from the contract any time without notifying anyone.
As per the Chainlink documentation → the CCIP version 1.0.0 has been deprecated, on mainnet. The system should take that into consideration.
This audit report focuses exclusively on the security assessment of the contracts within the specified review scope. Interactions with out-of-scope contracts are presumed to be correct and are not examined in this audit. We want to highlight that Interactions with contracts outside the specified scope, such as:
DAOFacet.sol
LibItems.sol
LibAppStorage.sol
LibERC1155.sol
DAOFacet.sol
ItemsFacet.sol
KmonMigrationFacet.sol
LibKmonMigration.sol
LibKryptomon.sol
KryptomonFacet.sol
LibStrings.sol
ItemsTransferFacet.sol
LibMeta.sol
LibERC721.sol
have not been verified or assessed as part of this report.
While we have diligently identified and mitigated potential security risks within the defined scope, it is important to note that our assessment is confined to the isolated contracts within this scope. The overall security of the entire system, including external contracts and integrations beyond our audit scope, cannot be guaranteed.
Users and stakeholders are urged to exercise caution when assessing the security of the broader ecosystem and interactions with external contracts. For a comprehensive evaluation of the entire system, additional audits and assessments outside the scope of this report are necessary.
In other words, HACKEN hereby disclaims any responsibility for security issues arising from interactions with out-of-scope contracts, including but not limited to
DAOFacet.sol
LibItems.sol
LibAppStorage.sol
LibERC1155.sol
DAOFacet.sol
ItemsFacet.sol
KmonMigrationFacet.sol
LibKmonMigration.sol
LibKryptomon.sol
KryptomonFacet.sol
LibStrings.sol
ItemsTransferFacet.sol
LibMeta.sol
LibERC721.sol
Despite HACKEN's differing opinion on the matter, it is explicitly stated that security checks were not conducted on these out-of-scope interactions. HACKEN cannot be held liable for any security issues that may have occurred in connection with these out-of-scope contracts or any issues arising from the interactions with them, as HACKEN was not granted permission to assess their logic.
This report serves as a snapshot of the security status of the audited contracts within the specified scope at the time of the audit. We strongly recommend ongoing security evaluations and continuous monitoring to maintain and enhance the overall system's security.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-0828 | Unchecked Transfer Operations for ERC20 Tokens | fixed | Low | |
| F-2024-0832 | Redundant Receive() Function | fixed | Observation | |
| F-2024-0831 | Missing Zero Address Validation | fixed | Observation | |
| F-2024-0830 | Out-of-Gas Error Due to Excessive Loop Iterations Edit Write comment Edit | fixed | Observation | |
| F-2024-0827 | Floating Pragma | fixed | Observation |
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/KryptomonDAO/chain-migration-contracts→ |
| Commit | 2325f0431ebe9676800e0a4aa146d6d2da4976d8 |
| Whitepaper | - |
| Requirements | provided as files |
| Technical Requirements | provided as files |
Scope Details
- Commit
- 2325f0431ebe9676800e0a4aa146d6d2da4976d8
- Whitepaper
- -
- Requirements
- provided as files
- Technical Requirements
- provided as files