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

Audit name:

[SCA] Tokeny | Access Control | Mar2023

Date:

Mar 21, 2023

Table of Content

→Introduction
→Audit Summary
→System Overview
→Potential Risks
→Findings
→Appendix 1. Definitions
→Appendix 2. Scope
→Appendix 3. Additional Valuables
→Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Tokeny team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Hacken OÜ (Consultant) was contracted by Tokeny (Customer) to conduct a Smart Contract Code Review and Security Analysis. This report presents the findings of the security assessment of the Customer's smart contracts.

Document

NameSmart Contract Code Review and Security Analysis Report for Tokeny
Approved ByMarcin Ugarenko
Websitehttps://docs.onchainid.com→
Changelog19/01/2023 - Initial Review
16/02/2023 - Second Review
21/03/2023 - Third Review
PlatformEVM
LanguageSolidity
Methodologyhttps://hackenio.cc/sc_methodology→

Audit Summary

35Total Findings
31Resolved
0Accepted
4Mitigated

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

Documentation quality

The total Documentation Quality score is 8 out of 10.

  • Functional requirements are partially missed.

  • NatSpec is consistent.

  • There is no apparent flow of the contracts.

  • Run instructions are provided.

Code quality

The total Code Quality score is 10 out of 10.

  • The development environment is configured.

  • Best practices are followed.

Test coverage

Test coverage of the project is 89.77% (branch coverage).

  • Deployment and basic user interactions are covered with tests.

Security score

As a result of the audit, the code contains no issues. The security score is 10 out of 10.

All found issues are displayed in the “Findings” section.

Summary

According to the assessment, the Customer's smart contract has the following score: 9.4.

System Overview

ONCHAINIDs are self-sovereign identities. This means that each holder of an identity is in control of their information and who has access to it.

Their address is a unique identifier that can safely be used by a service provider to identify their owner, and even to sign requests such as direct authentication on a website.

The project aims to achieve a means of decentralized authentication that is in control of the identity holders themselves.

The project consists of standards for claim holders and key holders, which are then combined to create identities.

Information about the contracts in the scope;

  • Identity.sol: The contract that implements the IERC734 and IERC735 standards and combines them to create an identity which can add/remove keys and claims.

  • IdFactory.sol: The contract that handles the deployment of identity proxies.

  • ClaimIssuer.sol: The contract that represents the claim issuers by extending Identity.sol.

  • IdentityProxy.sol: Proxy contract for upgradeability in Identity.

  • Structs.sol: The contract that holds struct variables for upgradeability.

  • ImplementationAuthority.sol: The contract responsible for storing and updating the implementation logic of upgradeable contracts.

  • Storage.sol: The contract that holds variables for upgradeability.

  • IIdFactory.sol: Interface for IdFactory.

  • Version.sol: The contract to hold the version of the Identity contract.

  • IERC734.sol: Key holder standard interface.

  • IERC735.sol: Claim holder standard interface.

  • IClaimIssuer.sol: Interface for ClaimIssuer.

  • IIdentity.sol: Interface for Identity.

  • IImplementationAuthority.sol: Interface for ImplementationAuthority.

Privileged roles

  • Owner: The owner of the system. Responsible for the upgrading of the contracts.

  • Claim Issuer: Responsible for issuing identity holders’ claims on their identity.

  • Identity Owner: The OnchainId identities user.

Potential Risks

The upgradeable nature of the contracts puts the implementation at risk in case of logic upgrade.

The EIP-734 and EIP-735 were closed and not integrated into the Ethereum standards. The project is building upon those standards.

The Identity.sol contract tries to implement the old EIP-725 standard, which was updated to the 725v2.

Findings

F-2025-1339Data Consistency
Status
mitigated
Severity

Critical
F-2025-1343Requirements Violation
Status
fixed
Severity

High
F-2025-1343Requirements Violation
Status
fixed
Severity

High
F-2025-1343Requirements Violation
Status
fixed
Severity

High
F-2025-1343Denial of Service
Status
fixed
Severity

High
F-2025-1345Unscalable Functionality
Status
fixed
Severity

Medium
F-2025-1345Inefficient Gas Model - Storage Abuse
Status
fixed
Severity

Medium
F-2025-1344Inconsistent Data - Incorrect Event Emitting Order
Status
fixed
Severity

Medium
F-2025-1344Best Practice Violation - Lock of Native Tokens
Status
mitigated
Severity

Medium
F-2025-1344Contradiction - NatSpec Comment Contradiction
Status
fixed
Severity

Medium
Code
―
Title
Status
Severity
F-2025-1339Data Consistency
mitigated

Critical
F-2025-1343Requirements Violation
fixed

High
F-2025-1343Requirements Violation
fixed

High
F-2025-1343Requirements Violation
fixed

High
F-2025-1343Denial of Service
fixed

High
F-2025-1345Unscalable Functionality
fixed

Medium
F-2025-1345Inefficient Gas Model - Storage Abuse
fixed

Medium
F-2025-1344Inconsistent Data - Incorrect Event Emitting Order
fixed

Medium
F-2025-1344Best Practice Violation - Lock of Native Tokens
mitigated

Medium
F-2025-1344Contradiction - NatSpec Comment Contradiction
fixed

Medium
1-10 of 35 findings

Identify vulnerabilities in your smart contracts.

Appendix 1. Definitions

Severities

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.
  • 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.

Potential Risks

The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.

Appendix 2. Scope

The scope of the project includes the following smart contracts from the provided repository:

Appendix 3. Additional Valuables

Additional Recommendations

The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.

To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:

  • Detecting changes to ownership or critical permissions.

  • Monitoring large or unexpected transactions and minting events.

  • Pausing operations when irregularities are identified.

These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.

Additional Considerations

This security assessment was conducted in accordance with the NIST SP 800-115 – Technical Guide to Information Security Testing and Assessment →. This guideline provides a structured foundation for planning, executing, and documenting technical evaluations such as testing, vulnerability assessments, and code reviews. Hacken’s internal methodology and security assessment framework extend these principles to blockchain environments to ensure consistency, repeatability, and verifiable outcomes.

Disclaimer