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

Audit name:

[SCA] Kresus | Wallet | Mar2023

Date:

Apr 18, 2023

Table of Content

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

Want a comprehensive audit report like this?

Introduction

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

Kresus is a user-friendly crypto & Web3 wallet complete with total recoverability.

titlecontent
PlatformEVM
LanguageSolidity
TagsStorage Vault
Timeline02/03/2023 - 21/04/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Audit Summary

    Total9.9/10
    Security Score

    10/10

    Test Coverage

    98.94%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    50Total Findings
    44Resolved
    0Accepted
    4Mitigated

    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

    NameSmart Contract Code Review and Security Analysis Report for Kresus
    Audited ByHacken
    Websitehttps://www.kresus.com/→
    Changelog09/03/2023 - Initial Review
    03/04/2023 - Second Review
    21/04/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Kresus
      Audited By
      Hacken
      Changelog
      09/03/2023 - Initial Review
      03/04/2023 - Second Review
      21/04/2023 - Third Review

    System Overview

    Kresus Vault is a blockchain-based secure storage facility for digital assets like cryptocurrency, NFTs, and other tokens. The system consists from the following contracts:

    • BaseModule — an abstract contract for a module, containing mainly internal view functions.

    • Utils \- a library which contains helper methods dealing with signatures and function selectors.

    • KresusModule \- a contract representing a module i.e. a vault of valuables.

    • KresusRelayer \- an abstract contract with methods for executing transactions signed by accounts outside of Ethereum.

    • SecurityManager \- an abstract contract dealing with security features of the KresusModule i.e. guardians, lock, recovery etc.

    • TransactionManager \- an abstract contract for executing transactions in sequence or calling third-party contracts.

    • Storage \- a contract containing methods on voting, setting locks and assigning guardians.

    • Proxy \- a contract which delegated all calls to another fixed contract.

    • Factory \- a contract which deploys new vaults against a set deployer, which can be changed.

    Privileged roles

    • The Module in Storage contract can set locks, toggle votings, add/revoke guardians, add/revoke heirs.

    • The Deployer of the Factory contract can set a new deployer address and deploy a new vault.

    • The KresusGuardian in the KresusModule contract can revoke guardian from a specific vault, lock or unlock vault. When voting is enabled - KresusGuardian signature is also required to  revoke guardian.

    • The Guardian in the KresusModule contract can revoke guardian. During voting guardian signature is also required to enable ERC1155 token receiver, add new module, add new guardian, transfer vault ownership, revoke guardian, lock vault, perform multicall, toggle voting and set time delay.

    • The Owner’s signature in the KresusModule can be necessary for certain types of transactions.

    • The Module in the BaseVault can authorize modules, enable static calls, set an owner, or invoke a generic transaction.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • No Whitepaper is provided.

    • Functional and technical requirements are provided and well describe the project.

    • The NatSpec comments are extensive.

    Code quality

    The total Code quality score is 10 out of 10.

    • The code is well structured with separation of concerns.

    • The development environment is configured, though it requires manually setting environment variables from the developer.

    Test coverage

    Code coverage of the project is 98.94% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • Only a few negative cases are covered.

    • Interactions by several users are not tested thoroughly.

    Security score

    Upon auditing, the code was found to contain 0 critical, 7 high, 7 medium, and 36 low severity issues. Out of these, 44 issues have been addressed and resolved, 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.9. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Front-end may receive zero address as a valid return value instead of an error.

    The systems rely heavily on low-level calls using function selectors, which may lead to vulnerabilities and unexpected behavior.

    Findings

    F-2023-0359Undocumented Behavior
    Status
    fixed
    Severity

    High
    F-2023-0358EIP Standard Violation
    Status
    fixed
    Severity

    High
    F-2023-0357Requirements Violation
    Status
    mitigated
    Severity

    High
    F-2023-0356Requirements Violation
    Status
    fixed
    Severity

    High
    F-2023-0355Requirements Violation
    Status
    fixed
    Severity

    High
    F-2023-0354Undocumented Behavior; Requirements Violation
    Status
    fixed
    Severity

    High
    F-2023-0353Requirements Violation
    Status
    fixed
    Severity

    High
    F-2023-0366Interface Mismatch
    Status
    fixed
    Severity

    Medium
    F-2023-0365Possible False-Negative Validation
    Status
    mitigated
    Severity

    Medium
    F-2023-0364Unclear Behavior
    Status
    mitigated
    Severity

    Medium
    Code
    ―
    Title
    Status
    Severity
    F-2023-0359Undocumented Behavior
    fixed

    High
    F-2023-0358EIP Standard Violation
    fixed

    High
    F-2023-0357Requirements Violation
    mitigated

    High
    F-2023-0356Requirements Violation
    fixed

    High
    F-2023-0355Requirements Violation
    fixed

    High
    F-2023-0354Undocumented Behavior; Requirements Violation
    fixed

    High
    F-2023-0353Requirements Violation
    fixed

    High
    F-2023-0366Interface Mismatch
    fixed

    Medium
    F-2023-0365Possible False-Negative Validation
    mitigated

    Medium
    F-2023-0364Unclear Behavior
    mitigated

    Medium
    1-10 of 50 findings

    Identify vulnerabilities in your smart contracts.

    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

    Repositoryhttps://github.com/Kresus-Labs-Inc/vault-mpc/tree/feat/mpc→
    Commit38db3f4
    WhitepaperNot provided
    RequirementsProvided (Readme document)
    Technical RequirementsProvided (Readme document + NatSpec in the code)

    Contracts in Scope

    contracts
    Factory.sol - contracts › Factory.sol
    modules
    common
    BaseModule.sol - contracts › modules › common › BaseModule.sol
    IModule.sol - contracts › modules › common › IModule.sol
    Utils.sol - contracts › modules › common › Utils.sol
    KresusModule.sol - contracts › modules › KresusModule.sol
    KresusRelayer.sol - contracts › modules › KresusRelayer.sol
    SecurityManager.sol - contracts › modules › SecurityManager.sol
    TransactionManager.sol - contracts › modules › TransactionManager.sol
    storage
    IStorage.sol - contracts › storage › IStorage.sol
    Storage.sol - contracts › storage › Storage.sol
    vault
    BaseVault.sol - contracts › vault › BaseVault.sol
    IVault.sol - contracts › vault › IVault.sol
    Proxy.sol - contracts › vault › Proxy.sol

    Disclaimer