Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[L1] Kopi | Kopi Money | Jun2025

Date:

Jul 24, 2025

Table of Content

→Introduction
→Audit Summary
→System Overview
→Risks
→Findings
→Appendix 1. Severity Definitions
→Appendix 2. Scope
→Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Kopi team for the collaborative engagement that enabled the execution of this Blockchain Protocol Security Assessment.

Kopi is a Cosmos-SDK-based protocol featuring a flexible TokenFactory module for on-chain custom asset issuance, metadata management, and seamless liquidity integration.

Document

NameBlockchain Protocol Review and Security Analysis Report for Kopi
Audited ByMike Mu
Approved ByNino Lipartiia, Tanuj Soni
Websitehttps://kopi.money/→
Changelog10/07/2025 - Preliminary Report
Changelog24/07/2025 - Final Report
PlatformCosmos SDK
LanguageGolang
TagsL1, Cosmos SDK
Methodologyhttps://hackenio.cc/blockchain_methodology→
  • Document

    Name
    Blockchain Protocol Review and Security Analysis Report for Kopi
    Audited By
    Mike Mu
    Approved By
    Nino Lipartiia, Tanuj Soni
    Changelog
    10/07/2025 - Preliminary Report
    Changelog
    24/07/2025 - Final Report
    Platform
    Cosmos SDK
    Language
    Golang
    Tags
    L1, Cosmos SDK

Review Scope

Repositoryhttps://github.com/kopi-money/kopi/tree/v22-rc6/x/tokenfactory→
Commit0a1232fc4bed69610dc350eb1881f6237c892863

Audit Summary

18Total Findings
17Resolved
0Accepted
1Mitigated

The system users should acknowledge all the risks summed up in the risks section of the report

Documentation quality

  • Provides clear guidance for end-users; however, additional detail for developers would enhance usability.

  • Presents strong conceptual framing, though it would benefit from the inclusion of formal specifications.

  • Follows a logical structure, but lacks a high-level architectural overview.

  • Aligned with the current codebase version, yet includes limited inline documentation.

  • Features readable and well-written prose, though offering more practical examples would further improve clarity.

Code quality

  • Effectively reuses Cosmos-SDK patterns, with some opportunities to reduce duplication. Keeper methods, message handlers, and collection wiring align well with standard SDK idioms, offering immediate familiarity for Cosmos-SDK developers.

  • Employs well-structured cache prefixes. The use of typed collections.Prefix constants with cache.New creates clear and strongly-typed storage namespaces.

  • Demonstrates strong typing and well-defined domain models.

  • The code is generally readable and idiomatic Go, though a few minor naming inconsistencies remain.

  • Maintains a lean dependency footprint. While schema setup can be verbose, it is clear and explicit.

  • Inline documentation is limited but partially offset by clear, self-documenting code structure.

Architecture quality

  • Modular, Cosmos-SDK–native design. Tokenfactory plugs cleanly into the Cosmos-SDK keeper/model framework, inheriting its well-understood module lifecycle, upgrade path, and governance hooks.

  • In-chain performance & scalability. All Tokenfactory logic runs on the existing Tendermint-powered chain, so it benefits from Cosmos’s low-latency, high-throughput consensus without adding extra inter-module hops.

  • Clear separation of concerns. State management (via collections), business logic (in keeper methods), and parameter tuning (via on-chain Params) are neatly layered, making each component easier to reason about and test.

  • Limited observability & metrics. There’s no built-in telemetry for critical flows (e.g. mint/burn rates, rate-limit breaches), so you’ll need external instrumentation to monitor performance and anomalies.

Test coverage

Code coverage of the project is ~30% and mutation score of ~60%

  • Branch coverage is primarily focused on happy paths; error-handling branches (e.g., if err != nil or negative conditions) are generally not exercised in tests.

  • Critical edge cases and negative scenarios are underrepresented - many Err... conditions in keeper logic and message validation remain untested.

  • Potential issues with cache and prefix usage are not currently covered by tests.

System Overview

The Tokenfactory is the on-chain minting and metadata subsystem in the Kopi protocol, built as a Cosmos-SDK module. It lets users spin up fully on-chain custom tokens, control their lifecycle (minting, metadata updates, admin changes), and wire them into decentralized liquidity pools. All state is managed via the module’s keeper and persisted using the Cosmos-SDK collections framework.

Core Responsibilities

Token Issuance Supply Control

  • Users (the “creator”/admin) call MsgCreateDenom to mint an initial supply of a new “factory” token.

  • Post-creation, they can mint or burn further units (if allowed) via module messages.

Metadata Management

  • Through MsgUpdateDescription, MsgUpdateWebsite, and MsgUpdateIconHash, admins can tweak human-readable fields (description text, website URL, image hash), subject to on-chain rate limits.

Permissioned Admin Role

  • Each token has an on-chain Admin address. Ownership can be transferred with MsgChangeAdmin, guaranteeing only the current admin may update supply or metadata.

Custom Liquidity Pools

  • Optionally at creation (or any time later), a new factory token can be paired against the protocol’s base kCoin in a Constant Product pool (x/tokenfactory pools), enabling trading via the DEX keeper.

Fee Reserve Mechanics

  • Every trade routed through a Tokenfactory pool splits fees between the liquidity pool and the protocol reserve, according to on-chain parameters.

Major Components

Keeper

  • Orchestrates state reads/writes via typed collections.Prefix caches (denoms, pools, offers, vestings, etc.)

  • Implements handlers for all tokenfactory messages (create, update, trade, admin change).

Types Messages

  • FactoryDenom struct: on-chain record of token supply, admin, metadata, and timing-windows.

  • LiquidityPool struct: reserves of kCoin vs. factory token, fee parameters, reserve-fee share.

  • Proto messages (MsgCreateDenom, MsgSell/MsgBuy, etc.) with ValidateBasic logic.

Parameters from onchain Params

  • MaxDenomNameLength, MaxDescriptionLength, MaxWebsiteLength: enforce metadata size limits.

  • ChangeSecondsDescription, ChangeSecondsWebsite, ChangeSecondsImage: rate-limit how often metadata can be updated.

  • ReserveFeeShare: fraction of trade fees that goes to the protocol reserve vs. the pool.

Auxiliary Modules

  • BankKeeper: mints/burns coins and moves them between accounts and module accounts.

  • DexKeeper: if using the DEX abstraction for cross-token trades.

  • Reserve module: for storing protocol revenues.

Risks

While TokenFactory’s integration with the Cosmos-SDK offers a solid foundation, certain design choices introduce operational risks. Admin-controlled minting and metadata updates concentrate power in a single address, which could impact trust and governance if misused. Additionally, unrestricted pool creation may lead to liquidity fragmentation, reducing market depth and increasing slippage for users.

Findings

F-2025-1121Erroneous Categories.Equal Method Implementation
Status
fixed
Severity

High
F-2025-1137Inappropriate Prefix Usage in Cache Initialization
Status
fixed
Severity

Medium
F-2025-1153Missing Request Parameter Null Checks in Query Functions
Status
fixed
Severity

Low
F-2025-1151CLI Command Parameter Name Mismatch in AutoCLI Configuration
Status
fixed
Severity

Low
F-2025-1137Missing State Validation in DisableMinting Operation
Status
fixed
Severity

Low
F-2025-1122Error Handling and Parsing Issues
Status
fixed
Severity

Low
F-2025-1122Incorrect Timestamp Field Usage in UpdateWebsite Method
Status
fixed
Severity

Low
F-2025-1121Insufficient or Missing Input Validation
Status
fixed
Severity

Low
F-2025-1157Inconsistent Module Account Naming Convention
Status
fixed
Severity

Observation
F-2025-1157Error Code and Naming Issues in Error Definitions
Status
fixed
Severity

Observation
Code
―
Title
Status
Severity
F-2025-1121Erroneous Categories.Equal Method Implementation
fixed

High
F-2025-1137Inappropriate Prefix Usage in Cache Initialization
fixed

Medium
F-2025-1153Missing Request Parameter Null Checks in Query Functions
fixed

Low
F-2025-1151CLI Command Parameter Name Mismatch in AutoCLI Configuration
fixed

Low
F-2025-1137Missing State Validation in DisableMinting Operation
fixed

Low
F-2025-1122Error Handling and Parsing Issues
fixed

Low
F-2025-1122Incorrect Timestamp Field Usage in UpdateWebsite Method
fixed

Low
F-2025-1121Insufficient or Missing Input Validation
fixed

Low
F-2025-1157Inconsistent Module Account Naming Convention
fixed

Observation
F-2025-1157Error Code and Naming Issues in Error Definitions
fixed

Observation
1-10 of 18 findings

Findings like these can secure your blockchain.

Appendix 1. Severity Definitions

Severity

Description

Critical
Vulnerabilities that can lead to a complete breakdown of the blockchain network's security, privacy, integrity, or availability fall under this category. They can disrupt the consensus mechanism, enabling a malicious entity to take control of the majority of nodes or facilitate 51% attacks. In addition, issues that could lead to widespread crashing of nodes, leading to a complete breakdown or significant halt of the network, are also considered critical along with issues that can lead to a massive theft of assets. Immediate attention and mitigation are required.

High
High severity vulnerabilities are those that do not immediately risk the complete security or integrity of the network but can cause substantial harm. These are issues that could cause the crashing of several nodes, leading to temporary disruption of the network, or could manipulate the consensus mechanism to a certain extent, but not enough to execute a 51% attack. Partial breaches of privacy, unauthorized but limited access to sensitive information, and affecting the reliable execution of smart contracts also fall under this category.

Medium
Medium severity vulnerabilities could negatively affect the blockchain protocol but are usually not capable of causing catastrophic damage. These could include vulnerabilities that allow minor breaches of user privacy, can slow down transaction processing, or can lead to relatively small financial losses. It may be possible to exploit these vulnerabilities under specific circumstances, or they may require a high level of access to exploit effectively.

Low
Low severity vulnerabilities are minor flaws in the blockchain protocol that might not have a direct impact on security but could cause minor inefficiencies in transaction processing or slight delays in block propagation. They might include vulnerabilities that allow attackers to cause nuisance-level disruptions or are only exploitable under extremely rare and specific conditions. These vulnerabilities should be corrected but do not represent an immediate threat to the system.
  • Severity

    Critical

    Description

    Vulnerabilities that can lead to a complete breakdown of the blockchain network's security, privacy, integrity, or availability fall under this category. They can disrupt the consensus mechanism, enabling a malicious entity to take control of the majority of nodes or facilitate 51% attacks. In addition, issues that could lead to widespread crashing of nodes, leading to a complete breakdown or significant halt of the network, are also considered critical along with issues that can lead to a massive theft of assets. Immediate attention and mitigation are required.

    Severity

    High

    Description

    High severity vulnerabilities are those that do not immediately risk the complete security or integrity of the network but can cause substantial harm. These are issues that could cause the crashing of several nodes, leading to temporary disruption of the network, or could manipulate the consensus mechanism to a certain extent, but not enough to execute a 51% attack. Partial breaches of privacy, unauthorized but limited access to sensitive information, and affecting the reliable execution of smart contracts also fall under this category.

    Severity

    Medium

    Description

    Medium severity vulnerabilities could negatively affect the blockchain protocol but are usually not capable of causing catastrophic damage. These could include vulnerabilities that allow minor breaches of user privacy, can slow down transaction processing, or can lead to relatively small financial losses. It may be possible to exploit these vulnerabilities under specific circumstances, or they may require a high level of access to exploit effectively.

    Severity

    Low

    Description

    Low severity vulnerabilities are minor flaws in the blockchain protocol that might not have a direct impact on security but could cause minor inefficiencies in transaction processing or slight delays in block propagation. They might include vulnerabilities that allow attackers to cause nuisance-level disruptions or are only exploitable under extremely rare and specific conditions. These vulnerabilities should be corrected but do not represent an immediate threat to the system.

Appendix 2. Scope

The scope of the project includes the following components from the provided repository:

Scope Details

Repositoryhttps://github.com/kopi-money/kopi/tree/v22-rc6/x/tokenfactory→
Commit0a1232fc4bed69610dc350eb1881f6237c892863
Whitepaperhttps://kopi-money.gitbook.io/docs→

Components in Scope

The entire tokenfactory module.

  • Message Definitions & Validation

  • Keeper Logic & State Management

  • Persistence Layer & Prefixes

  • Trading & Fee Mechanics

  • Metadata Updates & Rate-Limits

Disclaimer