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

Audit name:

[SCA] Gotbit | Bridge Solana | May2023

Date:

Jun 13, 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 Gotbit team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

GotBit Labs is a provider of web3 development and consulting services. They perform in diverse areas within the web3 ecosystem, including blockchain technology, crafting decentralized applications (DApps), pioneering contract development, and other associated fields.

titlecontent
PlatformSolana
LanguageRust
TagsBridge
Timeline11/05/2023 - 15/06/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/GotBit/bridge→
    Commitb3a36262ddfd5c28a2da1e4ca175e7010f19babd

    Audit Summary

    Total9.5/10
    Security Score

    10/10

    Test Coverage

    95%

    Code Quality Score

    9/10

    Documentation Quality Score

    9/10

    18Total Findings
    11Resolved
    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 Gotbit
    Audited ByHacken
    Websitehttps://gotbit.io/→
    Changelog18/05/2023 - Initial Review
    07/06/2023 -Second Review
    15/06/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Gotbit
      Audited By
      Hacken
      Changelog
      18/05/2023 - Initial Review
      07/06/2023 -Second Review
      15/06/2023 - Third Review

    System Overview

    GotBit Bridge — is a system that allows cross-chain token transfers. The system contains the smart contract (bridge_solana), which was audited.

    The smart contract's main purpose is processing incoming and outcoming transfer requests. The system allows creation of several bridge instances for bridging different tokens.

    The smart contract has the following entrypoints:

    • initialize — creates a new bridge instance.

    • setparams_ — configures a given existing bridge instance.

    • setchaindata — allows whitelisting chains where the bridge instances are deployed.

    • fulfill — execute a transfer on this end of the bridge.

    • send — save transaction details to be processed later by the bridge authority.

    • withdraw — transfer all tokens from bridge associated account to a specified address.

    The bridge fully relies on the owner, the authority for processing outcoming transfer requests (distributing funds to receivers on the chain). The system fully trusts the owner and does not require any additional confirmations except for the owner’s will to distribute funds to users.

    The system does not allow to cancel transfer requests and does not provide any guarantees that the transfer request will be fulfilled.

    Privileged roles

    The bridge instance owner is able to:

    • update transfer fees up to 99.99%

    • fulfill or ignore transfer requests

    • withdraw all deposited funds

    • configure bridge destination chains.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 9 out of 10.

    • Functional requirements are provided.

    • Architecture in Solana implementation differs from Ethereum one making the requirements vague.

    • The technical description on how to build and test the project is provided.

    Code quality

    The total Code quality score is 9 out of 10.

    • Functions that process common parameters, accept them differently.

    • All the code is implemented in one file making navigation harder.

    • Development environment is consistent with the requirements.

    Test coverage

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

    • Unit tests are not provided.

    • Integration test coverage is a manual approximation.

    Security score

    Upon auditing, the code was found to contain 0 critical, 1 high, 4 medium, and 2 low severity issues. Out of these, 3 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.5. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Unless the smart contract is deployed with the --final parameter, it could be upgraded and its functionality may be changed.

    The owner is able to withdraw all the deposited funds to an arbitrary address.

    The owner is able to set an unlimited fee for transactions.

    There are no guarantees that a transfer request will be fulfilled.

    Anyone is able to initialize a bridge instance. It is strongly recommended to check if the used bridge instance is initialized by a trusted account and the account is not compromised.

    The owner cannot be changed. In an emergency situation, the only option for the owner is to:

    1. Withdraw all the funds from the bridge.

    2. Abandon the bridge and all the data associated with it (nonces, bridge parameters, chain data and transaction history details will be lost).

    3. Create a fresh new bridge instance with a new account.

    Findings

    F-2023-0694Denial of Service
    Status
    mitigated
    Severity

    High
    F-2023-0698Undocumented Behavior
    Status
    fixed
    Severity

    Medium
    F-2023-0697Highly Permissive Role
    Status
    fixed
    Severity

    Medium
    F-2023-0696Immutable Ownership
    Status
    mitigated
    Severity

    Medium
    F-2023-0695Eager Division
    Status
    fixed
    Severity

    Medium
    F-2023-0700 Leak of Authorization
    Status
    mitigated
    Severity

    Low
    F-2023-0699 Unlimited Fees
    Status
    mitigated
    Severity

    Low
    I-2023-0165 Used Variables Marked as Unused
    Status
    fixed
    Severity

    Observation
    I-2023-0164Unformatted Code
    Status
    fixed
    Severity

    Observation
    I-2023-0163Inconsistent Code
    Status
    unfixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2023-0694Denial of Service
    mitigated

    High
    F-2023-0698Undocumented Behavior
    fixed

    Medium
    F-2023-0697Highly Permissive Role
    fixed

    Medium
    F-2023-0696Immutable Ownership
    mitigated

    Medium
    F-2023-0695Eager Division
    fixed

    Medium
    F-2023-0700 Leak of Authorization
    mitigated

    Low
    F-2023-0699 Unlimited Fees
    mitigated

    Low
    I-2023-0165 Used Variables Marked as Unused
    fixed

    Observation
    I-2023-0164Unformatted Code
    fixed

    Observation
    I-2023-0163Inconsistent Code
    unfixed

    Observation
    1-10 of 18 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/GotBit/bridge→
    Commitb3a36262ddfd5c28a2da1e4ca175e7010f19babd
    WhitepaperNot provided
    RequirementsProvided→
    Technical RequirementsProvided→

    Contracts in Scope

    anchor
    programs
    bridge-solana
    src
    lib.rs - anchor › programs › bridge-solana › src › lib.rs

    Disclaimer